Skip to main content
The widget exposes a global Decimal object with the following methods.

Decimal.boot(options)

Manually initializes the widget. Required when using data-disable-autoboot.

Decimal.show(options)

Opens the chat widget programmatically. Equivalent to clicking the launcher button.
If called before the widget has finished loading, the open is queued and runs once it’s ready. In modal presentation, clicking the backdrop or pressing Esc closes the widget.

Decimal.hide()

Closes the chat widget programmatically. Equivalent to clicking the launcher button again.

Decimal.showButton() / Decimal.hideButton()

Show or hide the launcher button without removing the widget. Unlike the data-hide-button attribute (which hides the button for the entire session), these toggle it at runtime — for example, hiding the launcher on certain pages or revealing it after a user action.
The widget can still be opened while the button is hidden by calling Decimal.show().

Decimal.shutdown()

Removes the chat widget completely. Call Decimal.boot() again to restart from scratch.

Decimal.update(options)

Updates widget metadata after initialization. Merged with existing metadata and included when escalating to a human.
The widget automatically tracks the current page and includes it in metadata as _pageUrl and _pageTitle (query strings are stripped to avoid leaking tokens or PII). Single-page-app navigations are detected and synced automatically — you don’t need to call update() on route changes.

Decimal.theme(options)

Customizes widget appearance. Can be called before or after Decimal.boot(). To reset to defaults, call Decimal.theme(Decimal.DEFAULT_THEME).

Colors

Pass null for any color to reset it to the component default.

Position & Size

These options only affect the widget container in floating mode, designed for use with data-hide-button. All values are CSS strings (e.g. '20px', '50%').

Button Position

Position the launcher button independently from the widget container.

Content

theme() also accepts content overrides for the widget’s header and greeting. These can be set here or via data attributes on the script tag.