Base URL & headers
All requests go to your Statisfy gateway (e.g.https://api.statisfy.app). Every SDK data request carries:
Authentication
POST /sdk/auth — mint a session token
Exchanges a signed-in user’s identity for a short-lived Statisfy session token.
Request
200
tenant_id, customer_id, portal_id, email, iss (statisfy-sdk), iat, and exp. The gateway scopes every subsequent request to that customer_id.
Error codes
Project endpoints (/sdk/v1)
Authenticated by the session token’s own tenant_id + customer_id claims (token-only — the publishable key is not required here). All errors return { "detail": { "code": "...", "message": "..." } }.
For
module=portal, the config response exposes the account’s onboarding project under the onboarding_project__c_ key.
Error codes
Chat endpoints (/sdk/dw/v1)
Authenticated by the publishable key (resolves the tenant) plus the session/worker token.
The chat endpoints moved under the
/sdk namespace (from /dw/v1/... to /sdk/dw/v1/...). The old /dw/v1/workers/... paths still work as a deprecated alias, but new integrations should use /sdk/dw/v1. The official SDK already calls the new paths — upgrade to pick them up automatically.Streaming frames
/messages/stream emits these SSE frame types:
The headless client (
createDigitalWorkerClient) maps these frames to the streamMessage handler callbacks — see Digital Worker Chat.
TypeScript types
The package is fully typed. Public exports: Provider & chatSecurity notes
- The publishable key is safe in client-side code; it only identifies the tenant and can’t authenticate on its own.
- The session token is short-lived (default 1 hour) and scoped to a single customer. Re-mint it via
/sdk/authbefore expiry inside yourgetTokencallback. - Cross-origin requests are scoped per publishable key — the gateway only accepts SDK requests from origins configured for your key.
- The gateway derives
customer_idfrom the signed token, never from client-supplied input, so a customer can only ever read or write their own project and conversations.