Skip to main content
When you verify a user’s identity, the agent can access personalized data and perform privileged actions. The widget supports two methods: passing identity at initialization and programmatic JWT identification.

Identity at initialization

Pass the user object when initializing the widget. The widget calls the HMAC verification endpoint automatically:
The hmac value must be computed on your backend. See Identity Verification for server-side signing examples.

JWT identification

Use identify() to verify the user with a JWT token after the widget has initialized:
The token must be signed with your project’s HMAC secret using HS256. Required claim: sub (user ID). Optional claims: email, name.

Auto-refresh tokens

For long-lived sessions, set up automatic token refresh so the identity stays valid:
The widget calls your fetcher when the current token expires and re-identifies the user automatically.

Backend token endpoint

Here’s an example backend endpoint that issues identity tokens:

Verification flow