Visitor Identity
Some agentic actions are personal: showing a visitor their orders, invoices, subscription, or support tickets. The bot runs these only when it can prove who the visitor is. You prove it by sending a short JWT, signed in your backend, that carries the visitor’s email.Identity is only needed for personal actions. Public actions (browse products, book a call, open a ticket) already work for anonymous visitors.
How It Works
Your backend signs a JWT
Using your BestChatBot signing key (HS256), your backend mints a short token that holds the visitor’s email.
What the Token Must Contain
The bot reads these claims. Onlyemail is required.
| Claim | Required? | What it’s for |
|---|---|---|
email | Yes | The verified identity. Must be a real, public email. The bot lowercases it. |
exp | Recommended | Expiry (Unix seconds). Keep it short. The bot rejects tokens whose lifetime is over 24 hours. |
name | Recommended | Personalizes replies and pins the visitor’s name on actions. |
user_id | Optional | The user’s ID in your system, handy for your own records. |
picture, phone, others | Optional | Passed through. The bot ignores what it doesn’t use. |
See Sign the JWT for Python, PHP, Go, Java, .NET, and per-provider examples (WordPress, Clerk, Firebase, Supabase, Auth0).
Get Your Signing Key
Open your widget settings in the dashboard, go to Security / Identity Verification, and create a Signing Key. Copy it once and store it as a backend secret. You can keep up to 3 active keys, so you can rotate without downtime: sign with the new key while the old one still verifies, then retire the old one.Hand the Token to the Widget
Pick whichever fits your app. Both send the token to the bot asAuthorization: Bearer <jwt>.
Option A, runtime (SPAs): call the widget API once you have the token.
Security Rules
Anonymous and Invalid Tokens
| Situation | What the bot does |
|---|---|
| No token sent | Treats the visitor as anonymous. Personal actions stay off; the bot answers safely. |
| Valid token | Runs personal actions with the verified email. |
| Expired or tampered token | Blocks the action by design. It does not fall back to anonymous. |
Email with a reserved domain (.local, .test, etc.) | Treated as anonymous. Use a real public email. |
Next Steps
Sign the JWT
Backend code for every stack and language.
Available Integrations
See which actions need a signed-in visitor.

