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.
ParameterTypeDescription
user_tokenstringA signed JWT for authenticated sessions. Required when identity verification is enabled.
metadataobjectKey-value pairs included with escalation tickets (e.g. account ID, plan type).
Decimal.boot({
  user_token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...',
  metadata: {
    account_id: 'id_asdf',
    plan: 'enterprise',
  }
});

Decimal.show()

Opens the chat widget programmatically. Equivalent to clicking the launcher button.
Decimal.show();

Decimal.hide()

Closes the chat widget programmatically. Equivalent to clicking the launcher button again.
Decimal.hide();

Decimal.shutdown()

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

Decimal.update(options)

Updates widget metadata after initialization. Merged with existing metadata and included when escalating to a human.
ParameterTypeDescription
metadataobjectKey-value pairs to merge with existing metadata.
Decimal.update({
  metadata: {
    account_id: 'id_asdf',
    plan: 'enterprise',
  }
});

Decimal.theme(options)

Customizes widget appearance. Can be called before or after Decimal.boot(). To reset to defaults, call Decimal.theme(Decimal.DEFAULT_THEME).
Decimal.theme({
  colorScheme: 'dark',
  primaryColor: '#3B82F6',
  backgroundColor: '#18181B',
  textColor: '#FAFAFA',
  textColorSecondary: '#FFFFFF',
  textColorMuted: '#A1A1AA'
});

Colors

ParameterDescriptionDefault
colorScheme'light' | 'dark' | 'auto'. Controls browser color scheme.'light'
primaryColorLauncher button, user message bubbles, action buttons.#18181B
backgroundColorWidget background color.#FFFFFF
textColorHeadings, body text, input labels, “Powered by Decimal”.#18181B
textColorSecondaryText on primary-colored elements (user messages, buttons).#FFFFFF
textColorMutedTimestamps, secondary labels, metadata.#71717A

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%').
ParameterDescriptionDefault
widthWidget width.380px
heightWidget height.640px
topDistance from top edge.unset
bottomDistance from bottom edge.80px
leftDistance from left edge.unset
rightDistance from right edge.20px
transformOriginAnimation origin point.bottom right

Button Position

Position the launcher button independently from the widget container.
ParameterDescriptionDefault
buttonTopButton distance from top edge.unset
buttonBottomButton distance from bottom edge.20px
buttonLeftButton distance from left edge.unset
buttonRightButton distance from right edge.20px