How it works
- Your frontend requests a token from your backend
- Your backend generates a signed JWT using your Identity Secret
- Your frontend passes the token to the widget
- Replyful verifies the token and links the conversation to the user
Get your identity secret
- Go to your Replyful dashboard
- Navigate to Settings → Security
- Copy your Identity Secret
Generate a token on your backend
Create an API endpoint that generates a signed JWT for authenticated users.- Node.js
- PHP
Install the Create a token endpoint:
jsonwebtoken package: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
- Never expose your Identity Secret in client-side code
- Generate tokens server-side only to prevent tampering
- Use short expiration times (1 hour recommended)
- Authenticate users before generating tokens
- Use HTTPS for all API requests