Skip to content

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.

  1. Turn on identity_verification_required in the dashboard (Privacy). Copy the project’s identity secret (server-only — never ship it to the browser).

  2. 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
  3. Pass it to the SDK:

    BotConfiguration(
    projectSecretKey: key,
    userID: userId,
    userIdSignature: signature,
    );

On the wire

  • History GET/DELETE send it as the X-User-Id-Signature header.
  • Chat POST sends it as the user_id_signature body field.