Documentation Index
Fetch the complete documentation index at: https://docs.billingos.dev/llms.txt
Use this file to discover all available pages before exploring further.
createSessionToken
Create a session token to authenticate a customer with the React SDK.Parameters
| Name | Type | Required | Description |
|---|---|---|---|
externalUserId | string | Yes | Your user’s unique ID from your database |
externalOrganizationId | string | No | Organization ID for B2B scenarios |
expiresIn | number | No | Token lifetime in seconds (60–86400, default: 3600) |
allowedOperations | string[] | No | Scope the token to specific operations |
metadata | Record<string, any> | No | Additional metadata (IP, user agent, etc.) |
Response
revokeSessionToken
Revoke a previously created session token.Token format
Session tokens are prefixed based on your API key environment:| API key | Token prefix | Routes to |
|---|---|---|
sk_test_* | bos_session_test_* | Sandbox API |
sk_live_* | bos_session_live_* | Production API |
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