Overview
Chat variables come from the browser, so a visitor can change them. That’s fine for preferences like locale or theme, but not for identity: a spoofed email would let anyone act as another customer. With identity verification, your backend signs a JWT with a Typewise secret. The chat sends the token, Typewise checks the signature, and the claims inside become verified values.When you need it
You need it if any chat action or lookup uses the Trusted only check on an input mapped to a context variable. See Context Variables. Without a valid signature, the check fails. The AI Agent then asks the customer to confirm (foruser_email) or hands off to a Human Agent.
Skip it for values that don’t need to be trusted, such as UI locale, theme, or
feature flags.
Set it up
1
Copy your signing secret
Open Identity verification
under chat installation. Copy the
sk_... key and store it in your
backend’s secrets manager.Regenerating the key invalidates the previous one.2
Sign a token on your backend
Sign a JWT with HS256. Put the variables you want verified in the payload,
and keep the expiry short (7 days or less).Return the token only to the signed-in user’s page.
3
Pass the token to the chat
Pass the token as If the visitor signs in after the page loads, pass a new token with
signedVariables. Values in variables stay unverified.- Chat widget
- Chat SDK
window.twSdk.setVariables.Verification outcomes
An invalid, missing, or expired token doesn’t reject the session. Typewise
discards the token’s claims, and only values you pass separately in
variables
remain, as unverified. If an action reaches a Trusted only input mapped to
one of them, the
runtime rules
apply.
Related
- Context Variables: declare variables and configure action and lookup inputs
- Security & verification: the trust model behind input customization
- Chat configuration: chat channel overview
- Embed the chat widget in Shopify: sign variables in Liquid without a backend