Skip to main content

Embed Code

Add this snippet before the closing </body> tag of your website:
Replace YOUR_WIDGET_ID and YOUR_CONFIG_TOKEN with the values from the widget configuration page. The exact snippet with pre-filled tokens is available under Chat Widgets > Installation. For authenticated users, see Identity Verification.

Content Security Policy (CSP)

If your site uses a Content Security Policy, add the following directives to allow the widget:
  • script-src — allows loading the widget script.
  • frame-src — allows the widget iframe to load.

Data Attributes

Configure the widget declaratively by setting attributes on the script tag. Everything except the widget ID is optional.
By default the widget boots automatically once the page loads. Set data-disable-autoboot and call Decimal.boot() when you need to pass a user_token or metadata — for example after your app knows who the signed-in user is.

Display Modes

Control how the widget appears using the data-display-mode attribute:
Sidebar modes show a vertical “Ask AI” tab on the right edge that opens the chat when clicked. The sidebar is resizable by dragging its left edge.

Hiding the Launcher Button

Hide the default launcher button with data-hide-button:
When the button is hidden, use Decimal.show() and Decimal.hide() to control visibility. Useful for custom trigger buttons or embedding in iframes.

Customization

Customize colors, position, sizing, and content with Decimal.theme(). Can be called before or after the widget loads.
See the full list of theme options.