Trading Widget Authentication
Use partner-token for new embedded trading SSO integrations.
Recommended mode: partner-token
partner-token avoids putting short tokens in URLs and keeps apiSecret on the partner backend.
Related documentation
- Create Embed Token: backend token issuance example.
- Trading Widget Quick Start: complete initialization flow.
- Secrets & Signing: keep privileged Agent credentials on the backend.
- Troubleshooting: diagnose session, token, origin, and initialization failures.
Backend flow
tokenProvider contract
Failure handling
Compatibility mode: agent-sso
agent-sso keeps the older /agent-entry ticket flow. Prefer partner-token for new integrations.
Seconds trading and environment rules
For seconds pages, use the same partner-token authentication with page and tradingMode configured on the Widget. There is no separate prediction token. Every tokenProvider call must obtain a fresh one-time token from your backend.
Return embedToken, expireAt in Unix seconds, and the original channelId as a top-level object. The Agent SDK token response does not contain channelId; your backend echoes the current Widget channel. If your endpoint wraps responses in data, unwrap it before returning from tokenProvider.