Identity verification (HMAC)
Without verification, anyone can impersonate your users in support chat. Enable strict mode in the dashboard to require verified identity before attaching conversation history.
// Node.js
import { createHmac } from "node:crypto";
const user_hash = createHmac("sha256", process.env.ROKOCHAT_IDENTITY_SECRET!)
.update(userId).digest("hex");
// PHP (WordPress)
$user_hash = hash_hmac('sha256', (string) $user_id, getenv('ROKOCHAT_IDENTITY_SECRET'));