Identify signed-in users in the messenger
Updated Nov 6, 2026
Available on: Starter, Growth, Pro, Enterprise.
By default, messenger visitors are anonymous. If your customers sign in to your website or app, you can pass who they are to the messenger. Their conversations then belong to their ChaosDesk profile and follow them across devices.
How it works
- Your server signs a short token (a JWT) for the signed-in customer.
- Your page passes it to the messenger with
zE('messenger', 'loginUser', ...). - ChaosDesk checks the signature and links the visitor to the customer with that external id, or that verified email address, or creates a new customer. An anonymous conversation they already started moves over.
Never sign the token in the browser: the secret must stay on your server.
Set up signing
- Open Admin Center, Channels, Messenger and choose Edit settings for the brand.
- Open Authenticated customers (JWT).
- Choose the Signing method:
- HS256 shared secret: enter a Shared secret that your server also knows.
- RS256 with a JWKS URL: sign with your own key pair and enter the URL where your public keys are published.
- Note the Key id. Your token header must carry it as
kid. - Save.
The token
Claims:
scope:"user";external_id: your user id (required);name,emailandemail_verified;exp(optional): when the token expires.
Call the messenger
zE('messenger', 'loginUser', function (callback) {
fetch('/my-app/chaosdesk-jwt').then((r) => r.text()).then(callback);
});
When the customer signs out of your site, call zE('messenger', 'logoutUser'). The next conversation starts anonymous.
Full details are in the messenger SDK reference.
Related
Was this article helpful?
Still need help?
Submit a request