George GiosueLet's talk
Projects

simcapture-sdk

An npm package that wraps the REST API of SimCapture — a clinical simulation recording and assessment platform — in a typed client. It stops every consuming service from hand-rolling the login, the axios handling and the shape of the responses all over again.

Features

  • Typed resources: organizations, reservations, courses, scenarios, locations and simulators
  • Authentication with token caching and transparent retry on 401
  • SimCaptureError carrying the real upstream status, not a blanket 400
  • Simplified inputs mapped onto the API’s actual shape (startstartTs, titleprivateTitle, …)
  • reservations.isAvailable to check availability by time window, room, course or organization
  • Dual ESM/CJS build with tsup and generated .d.ts types
  • Automated npm publishing through GitHub Actions

Tech

TypeScript, Bun, axios, tsup, GitHub Actions.

Install

npm install simcapture-sdk

Usage example

import { SimCaptureClient, SimCaptureError } from "simcapture-sdk";

const sc = new SimCaptureClient({
  apiUrl: process.env.SIMCAPTURE_API!,
  inventoryUrl: process.env.SIMCAPTURE_INVENTORY_API!,
  credentials: {
    username: process.env.SIMCAPTURE_USER!,
    password: process.env.SIMCAPTURE_PASSWORD!,
    clientSubdomain: process.env.SIMCAPTURE_SUBDOMAIN!,
  },
});

const reservations = await sc.reservations.findAll({
  start: "2026-07-01T05:00:00.000Z",
  end: "2026-12-31T05:00:00.000Z",
});

try {
  await sc.reservations.findOne("bad-id");
} catch (error) {
  if (error instanceof SimCaptureError) {
    console.error(error.status, error.code, error.body);
  }
}

Motivation

The two-way integration between the Interdisciplinary Center for Advanced Simulation platform and SimCapture needed the same client across several microservices. Extracting it into a versioned package removed the duplicated authentication logic and left the API responses typed in a single place.