The Web Widget messenger customization API lets you control the widget's appearance in real-time by updating its color theme through JavaScript.

API usage

Call zE("messenger:set", "customization") from your web page to update the widget's colors:

zE("messenger:set", "customization", {  theme: {    primary: "#FE5E41",    onPrimary: "#FFFFFF",    message: "#F3C178",    onMessage: "#5F0F00",    action: "#B0DB43",    onAction: "#000000",    businessMessage: "#fff",    onBusinessMessage: "#F10404",    background: "#DFE0E2",    onBackground: "#F10404",    error: "#FF1744",    onError: "#FFFFFF",    notify: "#FF007F",    onNotify: "#FFFFFF"  }})

Notes:

  • This function can be called at any time. The widget will immediately apply the new colors.
  • The theme object defines colors for the widget interface.
  • Unknown properties or invalid color values trigger an error in the browser console. Updates are rejected and no colors will change.
  • All values must be valid CSS color strings: hex, rgb, hsl, or named colors.

Theme color properties

The theme object supports these properties:

PropertyDescription
primaryBackground color for the widget header and launcher.
onPrimaryText and icon color on primary backgrounds.
messageBackground color for end-user messages.
onMessageText and icon color on message backgrounds.
businessMessageBackground color for business messages (messages from the business or agents).
onBusinessMessageText and icon color on business message backgrounds.
actionBackground color for action buttons such as creating new conversation, message, forms and carousel buttons.
onActionText and icon color on action backgrounds.
backgroundBackground color for the entire widget (message log, conversation list, channel linking, voice).
onBackgroundColor for descriptive elements on background (timestamps, names, message status), with 65% opacity.
errorBackground color for alert elements such as failed messages or upload errors.
onErrorText and icon color on error backgrounds.
notifyColor for unread message badges and new message divider in the conversation log.
onNotifyText color on unread badge backgrounds.
onSecondaryActionColor overriding border and text for secondary action buttons, also used as for composer's active state.

Fallback behavior

If primary, message, or action colors are not set, the widget uses the colors configured in Admin Center. The default colors are:

PropertyDefault Color
primaryAdmin Center primary color
onPrimaryBlack or white for accessibility
messageAdmin Center message color
onMessageBlack or white for accessibility
actionAdmin Center action color
onActionBlack or white for accessibility
businessMessage#F4F6F8
onBusinessMessage#000000
background#FFFFFF
onBackground#000000
error#FFF0F1
onError#8C232C
notify#CC3340
onNotify#FFFFFF
onSecondaryActionFalls back to action color

Unsupported elements

The following widget elements use fixed colors and cannot be customized with this API:

  • Wait time banner
  • Forms and form inputs, including text fields
  • Settings dropdown menus
  • Carousel UI elements

Visual examples of customizable properties

Troubleshooting

  • Check the browser console for errors if your colors do not apply.
  • All property names must be correct and all color values must be valid CSS strings.

Additional information