Identify users
When you identify a signed-in user, the bot can greet them by name, answer account-specific questions through Actions, and attach the conversation, leads and issues to that user.
Available on Starter and higher.
1. Get the identity secret
Section titled “1. Get the identity secret”Open Bot → Settings → Identity verification and copy the secret. Keep it on your server. Never put it in client-side code.
2. Compute the hash on the server
Section titled “2. Compute the hash on the server”The hash is HMAC-SHA256(identitySecret, userId) as a hex string. If you don’t have a user id, use the email.
import { createHmac } from "node:crypto";
export function feedbotHash(userId: string) { return createHmac("sha256", process.env.FEEDBOT_IDENTITY_SECRET!).update(userId).digest("hex");}import hmac, hashlib, os
def feedbot_hash(user_id: str) -> str: return hmac.new(os.environ["FEEDBOT_IDENTITY_SECRET"].encode(), user_id.encode(), hashlib.sha256).hexdigest()$hash = hash_hmac('sha256', $userId, getenv('FEEDBOT_IDENTITY_SECRET'));3. Pass it to the widget
Section titled “3. Pass it to the widget”<script src="https://w.feedbotai.com/v1/feedbot.js" data-bot-id="YOUR_BOT_ID" async></script><script> window.Feedbot = window.Feedbot || function () { (Feedbot.q = Feedbot.q || []).push(arguments) }; Feedbot("identify", { userId: "u_123", name: "Ann", hash: "HASH_FROM_YOUR_SERVER", metadata: { plan: "pro", signedUpAt: "2026-05-01" }, });</script>Commands are queued, so you can call Feedbot(...) before the loader has finished loading.
Next.js example
Section titled “Next.js example”"use client";import { useEffect } from "react";
type Props = { userId: string; email: string; name: string; hash: string };
export function FeedbotIdentify(props: Props) { useEffect(() => { const w = window as any; w.Feedbot = w.Feedbot || function (...args: unknown[]) { (w.Feedbot.q = w.Feedbot.q || []).push(args); }; w.Feedbot("identify", props); }, [props.userId]); return null;}Render it from a server component that computes hash with feedbotHash(user.id).
On logout
Section titled “On logout”Feedbot("reset");This forgets the visitor and the current conversation on this device.
Without a hash
Section titled “Without a hash”Identity sent without a valid hash is still stored, but marked as unverified. The bot won’t pass unverified identity to your Actions.