Use this guide for the canonical embed contract.Documentation Index
Fetch the complete documentation index at: https://docs.usechar.com/llms.txt
Use this file to discover all available pages before exploring further.
Auth contract (current)
publishableKey: requiredidToken: optional
<char-agent> handles ticket exchange internally through POST /api/auth/pk-ticket.Install
- npm
- Script tag
Key-only embed
Per-user identity embed
React (@mcp-b/char-react)
Security notes
- Keep
idTokenout of DOM attributes; pass it viaconnect()/setAuth(). - Treat publishable keys as public embed credentials and rotate if exposed unexpectedly.
- Restrict key usage with allowed origins in dashboard settings.
Troubleshooting
MISSING_PUBLISHABLE_KEY: providepublishable-keyorconnect({ publishableKey })INVALID_KEY: key is revoked/invalidORIGIN_NOT_ALLOWED: add the origin to allowed origins/domains for that keyINVALID_TOKEN/TOKEN_EXPIRED: refresh user session and pass a freshidToken

