Customer Agent

Messenger options

Presentation options accepted by mountWidget.

CustomerAgentWidgetOptions configures the built-in Messenger. Identity, context, language, and page metadata are client options. The required client supplies them; no repeated appId is needed when mounting UI.

Fields

OptionTypeRequiredEffect
clientCustomerAgentClientYesClient whose messages and actions the Messenger uses.
brand.namestringNoOverrides the Messenger brand display name.
header.closebooleanNoShows the panel close action unless false.
header.menubooleanNoShows the more-options menu unless false.
launcher.targetHTMLElement | stringNoUses a host element as the launcher; a selector miss falls back to the built-in launcher.
launcher.placement"top" | "right" | "bottom" | "left"NoPreferred desktop panel side around its launcher anchor.
launcher.offsetnumberNoPanel offset in pixels; negative values are clamped to zero.
launcher.styleRecord<string, number | string | undefined>NoInline styles on the built-in launcher host; color also reaches its button.
launcher.variablesWidgetLauncherVariablesNoBuilt-in button variables resolved from the host document before use inside the iframe.
messagesWidgetLocaleMessagesNoPartial UI translation overrides.
mobile.mode"fullscreen" | "bottom-sheet"NoMobile presentation; defaults to fullscreen.
mountHTMLElement | stringNoEmbeds UI in a host; defaults to document.body, including selector misses.
openOnInitbooleanNoOpens during mount; defaults to false and does not emit widget.opened.
position"bottom-right" | "bottom-left"NoDefault screen corner; defaults to bottom-right.
theme.primaryColorstringNoPrimary UI color.
theme.actionCardPartial<Record<"background" | "borderColor" | "borderRadius" | "padding" | "titleColor" | "textColor" | "primaryColor" | "primaryTextColor", string>>NoOverrides card appearance inside the Messenger iframe.

Unset brand.name, theme.primaryColor, and messages.welcome_message use the client's publicConfig brand name, primary color, and welcome message for the current locale, and follow its updates.

A resolved custom target suppresses the built-in launcher and toggles the panel on click, Enter, and Space. Host attributes are restored when that target is replaced or the widget unmounts. widget.getState().launcher.anchor exposes the actual custom target or built-in host for positioning host-owned UI. Position and placement are preferences subject to available viewport space.

Action Card Theme

Card theme fields accept CSS values and update through widget.update({ theme: { actionCard } }). Omitted fields use the existing Messenger tokens: white surface, subtle border, 16px radius, 16px padding and the Messenger primary action color. Overrides affect cards in both conversation types. Host-page selectors do not cross the iframe boundary; pass values through theme.actionCard.

The fields map to --customer-agent-card-background, --customer-agent-card-border-color, --customer-agent-card-border-radius, --customer-agent-card-padding, --customer-agent-card-title-color, --customer-agent-card-text-color, --customer-agent-card-primary-color, and --customer-agent-card-primary-text-color respectively.

Launcher Variables

WidgetLauncherVariables is a partial record of these names, each accepting a number, CSS string, or undefined:

NormalHover
bg-colorhover-bg-color
colorhover-color
border-colorhover-border-color
border-radiushover-border-radius
border-stylehover-border-style
border-widthhover-border-width
box-shadowhover-box-shadow

These styles and variables customize the built-in launcher, not a host's custom target element. Client replacement and mount changes require a new mounting call. widget.update(...) accepts presentation changes; constructor-only fields are described in Messenger methods.

On this page