Logged-in users
If your site knows who is signed in, you can pass that to the widget with identify(). Your server signs the user ID with an HMAC secret, and the user's conversations are labelled with their ID in the dashboard.
On this page
How it works
The widget does not compute the signature and does not know the secret. Your backend computes the signature with the assistant's HMAC secret. Find the secret in the dashboard under Settings → Installation → “Secret for signing users (HMAC)”. We show only the beginning of it. You see the full value once, when you generate a new one.
hash = hex( HMAC-SHA256( key = agent_secret, message = userId ) )Step 1. Compute the signature on your server
Node.js
const { createHmac } = require('node:crypto');
const hash = createHmac('sha256', process.env.FLOWHELP_HMAC_SECRET).update(user.id).digest('hex');PHP
$hash = hash_hmac('sha256', $user->id, getenv('FLOWHELP_HMAC_SECRET'));Python
import hmac, hashlib
hash_ = hmac.new(SECRET.encode(), user_id.encode(), hashlib.sha256).hexdigest()Step 2. Pass the identity on the page
This can run before the widget loads. It goes into the queue.
window.flowhelp = window.flowhelp || [];
window.flowhelp.push(['identify', { userId: 'u_123', hash: '<64 hex characters>' }]);
// after sign-out:
window.flowhelp.push(['identify', null]);Rules
userIdis your internal identifier (or an email): 1 to 200 printable ASCII characters, without spaces. A full name with non-ASCII characters does not pass, because the value travels in an HTTP header.- The widget rejects a bad payload with a console warning, and the previous identity (if there was one) stays unchanged.
- Sign out only with
identify(null). Switching to another user, or signing out, starts a new conversation, and the previous transcript disappears from the window. - The signature is sent with every message, and the server checks it each time. A mismatched signature returns
403before anything is counted. - Identity does not change the limits or the owner of the conversation. Those follow the visitor identifier from the browser. A conversation that started anonymously gets the identity once
identify()is called during it. - The widget sends only
userIdand the signature. Email and name are not passed. - A conversation verified with
identify()resumes only for the same signed-in user.
Keep the secret on the server side. If it leaks, click “Generate a new secret” in Settings → Installation. All signatures made with the old secret stop working immediately, so update your backend first.