Claims
Algorithm is HS256 only.
aud must match the widget. The page embedding the widget must match Allowed domains (exact origin, or https://*.example.com for one extra label); the same rule applies to anonymous sessions. Browsers enforce this through the iframe’s frame-ancestors. A server-side script can replay a stolen token from anywhere, so keep tokens short-lived and set jti if replay matters to you.
Node
Python
Ruby
Go
Rotation
Rotate identity secret issues a newkid and secret and revokes the previous customer key. Tokens signed with the old secret fail as revoked_kid or bad_signature, and every open widget session ends; visitors reconnect silently, verified users re-identify with a token from your backend. Copy the new secret immediately.
Without verification
If Verification required is off, the widget mints a random visitor id (v_ plus 24–64 lowercase letters or digits) to start a session. Those conversations are unverified: no contact mapping, no follow-up email, no signed attributes. Leave verification on unless you explicitly want anonymous chat. Anonymous visitors can start at most 10 conversations an hour each, and 20 an hour per IP address.