How to set and verify a visitor’s email with the JavaScript SDK
Pass a signed-in customer’s email to Crisp so they can start chatting without entering it again. You can also sign the email on your backend to show a verified badge beside it in the Inbox.
Example → A customer may ask your team to change an order’s delivery address. The badge lets the agent see that your account system authenticated the email. Your team can then apply its usual checks for changing that order.
Set the visitor email
Use the JavaScript SDK after the chatbox snippet has initialized window.$crisp. Supply the email from the customer’s signed-in account.
// Replace this value with the email from your own authenticated user data.
$crisp.push(["set", "user:email", ["user@example.com"]]);
Use a valid, nonempty email address. The SDK reports an error for invalid input unless safe mode suppresses it.
Pass the email from a PHP template
If your server renders the page with PHP, use json_encode to turn the authenticated user’s email into a JavaScript string.
<script>
$crisp.push(["set", "user:email", [<?php echo json_encode($user_email, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT); ?>]]);
</script>
Here, $user_email must contain the email of the account currently signed in to your website.
Read the current email
Define the ready callback before loading the Crisp script, or add the getter to your existing callback.
window.CRISP_READY_TRIGGER = function() {
const visitorEmail = $crisp.get("user:email");
// Use visitorEmail here.
};
The getter reads the email currently known to the browser session. The ready callback can run before queued setters, so a value read there may still be the earlier email. Check the resulting conversation in Crisp when validating an update.
Verify the email with a signed hash
Identity Verification is available from Mini. A workspace owner can enable it so agents can recognize emails authenticated by your application.
- Go to ⚙️ Settings → Workspace → Advanced configuration → Identity Verification and enable Verify user emails with cryptographic signatures.
- Copy the generated Secret key into your backend configuration.
- Sign the authenticated customer’s exact email with HMAC-SHA256, producing 64 lowercase hexadecimal characters. Return the signature and the same email string to that customer’s frontend. Preserve the capitalization of the string you signed.
- In your frontend, pass the email as the first value and its signature as the second. Include both the first time you set the email.
Example → If your backend returns the signed-in customer’s email address and its signature, your website can pass them to Crisp in the same SDK call.
$crisp.push(["set", "user:email", [customer.email, customer.emailSignature]]);
The identity verification developer guide includes a backend example.
Check the verified badge
Start a fresh visitor session and send the email and signature together. In the Inbox, open that conversation’s customer details and look for the verified badge.
If an earlier call already set the same address without a signature, Crisp may skip the update because the email hasn’t changed. That’s why the first call should include both values.

If the fresh test session remains unverified, check that verification is enabled, the signature uses the workspace’s current secret, and the email matches the string your backend signed.
Replace a verification secret
If the secret needs replacing, a workspace owner can use Roll secret in the same settings section. Update your backend with the newly generated key so future signatures match it.
To restore this customer’s conversation on another device, configure session continuity as well. It uses a private user token to recover the chat history.
Updated on: 02/12/2026
Thank you!