Identifying signed-in customers
Tell the chat bubble who is signed in, so your agent can act on that customer's own account and nobody else's
When your agent can look up orders or change a subscription, it needs to know who it's talking to. Otherwise anyone who knows a customer's email could ask about their order.
The identity check solves this. Your server signs the signed-in customer's email with a secret only you and FutureBase know, and the chat bubble passes the email and signature along. FutureBase checks the signature on every message:
- Verified customers can use actions marked Verified customers only, and only on their own records: any email in the action must be theirs.
- Everyone else stays an anonymous visitor. If they ask for something that needs a signed-in customer, your agent asks them to sign in, or offers to hand off to your team.
This is optional. You only need it if your agent uses actions on customers' own accounts, see Actions.
Set it up
Create your identity secret
Open Channels → Chat bubble → Install and find Identify signed-in customers. Choose Create identity secret.
Store the secret on your server as FUTUREBASE_IDENTITY_SECRET, for example in your hosting provider's environment variables or a .env file that is not committed.
Never put the secret in your website's front-end code. Anyone who has it can sign any email.
Sign the customer's email on your server
Where your server renders a page for a signed-in customer, compute an HMAC-SHA256 of their email, trimmed and lower-cased, with the secret:
import { createHmac } from "node:crypto";
const userHash = createHmac("sha256", process.env.FUTUREBASE_IDENTITY_SECRET)
.update(user.email.trim().toLowerCase())
.digest("hex");Pass the email and signature to the bubble
Only for signed-in customers. Anonymous visitors get the bubble without these.
<script src="https://embed.futurebase.io/widget.js" data-wid="YOUR_WEBSITE_ID"
data-futurebase-user-email="[email protected]"
data-futurebase-user-hash="THE_HASH_FROM_YOUR_SERVER" defer></script>You can also pass your own customer id with data-futurebase-user-id.
If your customers don't have an email address, sign their user id instead and pass it as the id (data-futurebase-user-id or user.id), without an email.
Send more about the customer
Next to the email and signature, the bubble can pass the customer's name, phone, company, avatar and attributes from your product, like their plan or signup date. They show on the customer's page and in Live Desk. See Identifying your customers.
The signature also protects this profile. Once a customer is verified, a profile without a valid signature no longer changes them, so nobody can rename a customer or change their plan by editing your page's script tag.
Rotating the secret
Choose Make a new secret under Identify signed-in customers. Signatures made with the old secret stop working right away, so update FUTUREBASE_IDENTITY_SECRET on your server at the same time. Until you do, customers are treated as anonymous visitors.
With a coding agent
If you set up FutureBase with a coding agent, it can do this for you: the setup MCP server has a get_identity_setup tool that returns the secret and the code for your stack. It asks you before writing the secret to a file.
Set up with your coding agent
Let Claude Code, Cursor or another coding agent teach your FutureBase agent about your product, style the chat bubble and add it to your site
Identifying your customers
Send your customers' name, company and attributes like their plan from your website, your React app or your backend, so your team and your agent know who they're helping