SupportWire API
Chat Widget

Configuration

All options accepted by the widget loader, plus runtime updates.

Pass options to new SupportWireWidget({ … }).

Options

OptionTypeDefaultDescription
widgetSlugstringrequiredWidget identifier from Settings → Widgets.
appUrlstringbuild defaultBase URL of the widget app. Defaults to the host the loader was built for.
theme'light' | 'dark''light'Color scheme.
triggerPosition'bottom-right' | 'bottom-left' | 'top-right' | 'top-left''bottom-right'Launcher position.
widgetType'popup' | 'drawer' | 'center modal''popup'Layout style.
selectorstringCSS selector of a custom element to use as the trigger instead of the default launcher.
hideOnLaunchbooleanfalseStart with the launcher hidden; reveal later with showTrigger().
enableScreenshotbooleanfalseShow a screenshot-capture button in the widget.
userEmailstring''Identity by email. See Identity.
userExternalUserIdstring''Identity by your own user id. Takes precedence over userEmail.
userSignaturestring''HMAC-SHA256 signature of the identity value.
userDataobject{}Custom attributes (name, plan, custom fields…) merged onto the contact.
onOpen() => voidCalled when the widget opens.
onClose() => voidCalled when the widget closes.
onError(error: Error) => voidconsoleError handler.

Update at runtime

Call updateConfig() on the instance to change options after init:

const widget = new SupportWireWidget({ widgetSlug: 'YOUR_WIDGET_SLUG' });

widget.updateConfig({
  theme: 'dark',
  triggerPosition: 'bottom-left',
});

Intercom-compatible keys

If you use the npm SDK, these Intercom keys map automatically:

Intercom keyMaps to
app_idwidgetSlug
user_iduserExternalUserId
emailuserEmail
user_hashuserSignature
theme_modetheme
custom_launcher_selectorselector
hide_default_launcherhideOnLaunch
alignment ('left'/'right')triggerPosition

Any other keys (name, phone, company, custom attributes…) are collected into userData.

On this page