@sutempo/sdk
v1.0.0
Published
JavaScript client for the Sutempo booking API, generated from its OpenAPI contract.
Maintainers
Readme
@sutempo/sdk
JavaScript client for the Sutempo booking API. One method per
operation of the OpenAPI contract (https://sutempo.com/openapi.json), named after its
operationId, regenerated whenever the contract changes. No dependencies; Node 20+ or
any browser with fetch.
npm install @sutempo/sdkimport {PlatformClient} from "@sutempo/sdk";
const sutempo = new PlatformClient("https://sutempo.com", process.env.SUTEMPO_KEY);
// Every free slot of the whole team over a week, sorted by start.
const {slots} = await sutempo.searchAvailability({
path: {tenantId},
query: {serviceId, locationId, from: "2026-10-01", to: "2026-10-07"},
});
// Hold the chosen slot for five minutes, then confirm it.
const held = await sutempo.holdAppointment({
path: {tenantId},
body: {locationId, serviceId, resourceId: slots[0].resourceId, startsAt: slots[0].startsAt, customerId},
idempotencyKey: crypto.randomUUID(),
});
await sutempo.confirmAppointment({path: {tenantId, appointmentId: held.id}, idempotencyKey: crypto.randomUUID()});The key is sent as a bearer token. Keys, their permissions and webhooks are managed in
the developer console (https://sutempo.com/console). A failed call throws
PlatformApiError with the HTTP status, the error body
{error: {code, message, correlationId}} and the correlationId.
Pre-production: https://preprod.sutempo.com (test data only).
