Skip to content

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

  1. Your server signs a short token (a JWT) for the signed-in customer.
  2. Your page passes it to the messenger with zE('messenger', 'loginUser', ...).
  3. 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

  1. Open Admin Center, Channels, Messenger and choose Edit settings for the brand.
  2. Open Authenticated customers (JWT).
  3. 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.
  4. Note the Key id. Your token header must carry it as kid.
  5. Save.

The token

Claims:

  • scope: "user";
  • external_id: your user id (required);
  • name, email and email_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
Identify signed-in users in the messenger · Help Centre