Skip to content
Office

Office Chat feature

Identity verification for signed-in users

Tell the widget who your signed-in user is, and sign it on your server, so nobody can pretend to be a customer and read their conversations.

Why you'd sign it

When your app tells the widget "this is user 4182, jo@example.com", the visitor sees their past conversations on any device. Without a signature, anyone who can open the browser console could claim to be user 4182. Identity verification closes that gap.

How it works

We give your workspace a secret. Your server computes a hex HMAC-SHA256 of the user's id (or their email, if you don't send an id) with that secret, and your page passes it to the widget along with the user. We compute the same hash and compare. Turn on Require verification and any identify call without a valid hash is rejected.

In Node.js the server side is one line:

const userHash = crypto.createHmac("sha256", process.env.CHAT_SECRET).update(String(user.id)).digest("hex");

The install docs have the same line for Python, PHP and Ruby.

What you can send with it

Id, email, name and phone, plus up to 50 custom details such as plan, signup date or account id. They show in the side panel and can be used in routing rules.

Example

A SaaS app with two kinds of visitors

A project management app shows the widget on its marketing site (anonymous visitors) and inside the app (signed-in customers). In the app, the server renders each page with the user's id, email, name, plan and the signed hash. With Require verification on, a customer who opens chat on their laptop sees the conversation they started on their phone yesterday, and nobody else can.

How to set it up

  1. 1

    Open Settings > Widget > Installation and reveal your identity secret.

  2. 2

    Store it on your server, never in browser code.

  3. 3

    Compute the hash for each signed-in user and pass it with their details.

  4. 4

    Turn on Require verification once your app sends the hash everywhere.

Identity verification for signed-in users is part of Office Chat and included on every plan.

Try Office Chat with your whole team

7-day trial with every feature. Cancel from the billing page whenever you like.