Identity verification (HMAC)
By default the widget trusts the userID your client sends. For authenticated apps you can require a signature so a holder of the public key can’t impersonate another user.
How it works
Your backend computes HMAC-SHA256(identity_secret, userID) and hands the signature to your client, which passes it to the SDK. The chat backend recomputes and compares before accepting the userID.
-
Turn on
identity_verification_requiredin the dashboard (Privacy). Copy the project’s identity secret (server-only — never ship it to the browser). -
Sign on your backend (example, Node):
import crypto from 'node:crypto';const signature = crypto.createHmac('sha256', IDENTITY_SECRET).update(userId).digest('hex');// return { userId, signature } to your authenticated client -
Pass it to the SDK:
BotConfiguration(projectSecretKey: key,userID: userId,userIdSignature: signature,);
On the wire
- History
GET/DELETEsend it as theX-User-Id-Signatureheader. - Chat
POSTsends it as theuser_id_signaturebody field.