Embed the widget
Chat bubble
Add the snippet from Channels → Web before the closing</body> tag. It loads the widget and shows a floating chat bubble:
id attribute is your agent ID. Copy the ready-made snippet from the dashboard so it’s filled in for you.
Inline iframe
To place the full chat inside a page instead of a floating bubble:JavaScript API
Once the script loads, it exposes a globalwindow.totebot object.
Calls made before the widget finishes loading are queued and replayed once it’s ready, so you can call them at any time.
Identify a user
For signed-in users, pass auserId together with a userHash so the agent can trust the identity and recognize the person across sessions and channels. Generate the hash on your server (never expose your agent secret in the browser): it’s an HMAC-SHA256 of the userId, keyed with your agent secret.
Find your agent secret in Channels → Web under the identity section.
Identity verification requires the Personalization feature, available on the Basic, Pro, and Scale plans.
Listen for events
The widget posts messages to the host page so you can react to what happens in the chat:E-commerce and voice
On Shopify and WooCommerce, the widget syncs the live cart automatically, so the agent can read and update it. Voice input (the iframe’sallow="microphone") and attachments are controlled from Settings → Chat Interface. For server-to-server access to conversations, analytics, and more, use the Public API.