window.TarsConfig object, and what the widget receives from the host page.
The script tag
Copy the snippet from Distribute → Widget Embed on the agent, under the HTML tab. Paste it before the closing</body> tag.
data-region. The HTTP APIs use a per-region base URL instead, listed in API authentication.
The script adds a floating launcher in a shadow DOM, so host-page CSS cannot break it. The widget iframe is preloaded when the page goes idle, or on first hover of the launcher, whichever comes first.
window.TarsConfig
Setwindow.TarsConfig before the script tag runs to pass options and data about the end user.
Values from
TarsConfig are unverified browser data. They personalize the conversation but never overwrite a verified identity.
Locale resolution
The widget locale resolves in this order, using the first value present.TarsConfig.lang- The host page’s
?lang=URL parameter - The browser’s
navigator.language
en-US resolves to en.
Context passed to the widget
The script collects context and passes it to the iframe as a base64urlctx parameter, at the moment the iframe is built.
The encoded context is capped at 6000 characters. Over the cap,
attributes is dropped first. If the remainder still exceeds the cap, no context is sent.
Appearance is fetched per page load
The launcher and widget appearance load live from Tars on every page load, with a 2-second timeout per attempt. A server error is retried twice before the launcher falls back to defaults. Design changes made in the dashboard apply without re-embedding. The callout message, delay, and optional attention chime use the saved Design → Launcher settings. They are not fields inTarsConfig. Selecting the callout message opens the panel, while Dismiss closes only the callout.
The sound is on by default and waits for interaction with the host page. See Design the widget for its 24-hour limit and testing steps.
