Identity Verification
Identify logged-in users in the chat widget with the built-in JWT setup shown in the dashboard
Identity Verification#
Identity verification lets your website identify logged-in users to the chat widget. The setup is on the Chat widget install screen, including a secret key and copy-ready server and client examples.
Open Identity Verification#
| Step | Where |
|---|---|
| 1 | Open the agent dashboard |
| 2 | Click Deploy |
| 3 | Open Chat widget |
| 4 | Open the Install tab |
| 5 | Scroll to Identity verification |
If you do not see a secret key yet, save the chat widget settings once. Saving generates the key.
What You Need#
- Your website already has the widget installed
- A backend that can generate a JWT for the signed-in user
- The secret key shown in Identity verification
Setup Steps#
| Step | What you do |
|---|---|
| 1 | Reveal and copy the Secret key from Deploy → Chat widget → Install |
| 2 | Start from the Server-side (Node.js) example and generate a JWT on your backend |
| 3 | Use the Client-side (JavaScript) example to call window.AlonChat("identify", { ... }) after the user signs in |
| 4 | Call window.AlonChat("resetUser") when the user signs out |
| 5 | Test the widget on your site with a logged-in user |
What You See in the UI#
- Secret key for server-side token signing
- Controls to reveal the key, copy it, and rotate it
- Server-side (Node.js) sample code
- Client-side (JavaScript) sample code
Rotate key creates a new secret and invalidates JWTs signed with the old one. Update the server-side code immediately after rotating.
Important#
- Keep the secret key on the server only.
- Do not place the secret key in public client-side code.
- Rotate the key if you think it was exposed.