Skip to main content
User identification lets you securely pass user information to the chat widget. This enables personalized conversations, linking chats to your user records, and showing user context to your support team.

How it works

  1. Your frontend requests a token from your backend
  2. Your backend generates a signed JWT using your Identity Secret
  3. Your frontend passes the token to the widget
  4. Replyful verifies the token and links the conversation to the user

Get your identity secret

  1. Go to your Replyful dashboard
  2. Navigate to SettingsSecurity
  3. Copy your Identity Secret
Keep your Identity Secret secure. Never expose it in client-side code.

Generate a token on your backend

Create an API endpoint that generates a signed JWT for authenticated users.
Install the jsonwebtoken package:
Create a token endpoint:

Call identify from your frontend

After a user logs in, fetch the token from your backend and pass it to the widget:

React example

Token payload

Security best practices

  1. Never expose your Identity Secret in client-side code
  2. Generate tokens server-side only to prevent tampering
  3. Use short expiration times (1 hour recommended)
  4. Authenticate users before generating tokens
  5. Use HTTPS for all API requests
The widget handles missing or invalid tokens gracefully — users can still chat anonymously.