Skip to main content

createSessionToken

Create a session token to authenticate a customer with the React SDK.

Parameters

Response

The unresolvedCustomers field is populated when you have imported customers from Stripe that haven’t been bound yet. The SDK uses it to surface a one-time console.warn if you’re issuing tokens without email.

revokeSessionToken

Revoke a previously created session token.

Token format

Session tokens are prefixed based on your API key environment: The React SDK reads this prefix and routes requests to the correct API automatically.

Next.js example

app/api/billingos-session/route.ts

Security notes

  • Tokens are short-lived (default: 1 hour)
  • Each token is scoped to a single customer
  • Tokens are verified on every API call
  • Expired tokens are automatically rejected
  • Always authenticate the user before creating a token