Skip to main content
The official SDK is published as @tansohq/sdk. It works against a self-hosted instance with one option: baseUrl.
Without baseUrl, the SDK routes by key prefix to Tanso’s hosted endpoints. For a self-hosted instance, always set it.

The integration loop

Surface

ResourceMethods
customerscreate, get, update
subscriptionscreate, cancel, revertCancellation, changePlan, cancelScheduledChange
entitlementscheck, evaluate, list
eventsingest
planslist
featureslist, get
creditslistPools, getPool, listGrants, listTransactions
billinglistInvoices, markPaid, createCheckoutSession

Errors are typed

TansoConflictError on a duplicate idempotency key is the SDK working as designed: your retries are safe because the second write is refused.

Notes

  • List responses return { items, pagination }; plan list items nest the plan under a plan property.
  • subscriptions.create takes customerReferenceId, and the target plan must be ACTIVE (see billing lifecycle).