Decimal object with the following methods.
Decimal.boot(options)
Manually initializes the widget. Required when usingdata-disable-autoboot.
Decimal.show(options)
Opens the chat widget programmatically. Equivalent to clicking the launcher button.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. Thedata-hide-button attribute hides it for the whole session; these two toggle it at runtime, so you can drop the launcher on certain pages or reveal it after the user does something.
Decimal.show().
Decimal.logout()
Call this when a customer signs out of your site. It ends their widget session on Decimal’s side, so the next person on the same browser can’t reopen their conversation. Returns a promise that rejects if the session couldn’t be ended within 10 seconds. To sign in a different user afterwards, shut the widget down and boot it with their token:Decimal.shutdown()
Removes the chat widget completely. CallDecimal.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. Metadata comes from the browser and isn’t verified. Use signed claims for anything your team relies on._pageUrl and _pageTitle, with query strings stripped so tokens and PII don’t leak. Single-page-app navigation is picked up too, so route changes need no update() call from you.
Decimal.theme(options)
Customizes widget appearance. Can be called before or afterDecimal.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 withdata-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.