Configuration
All options accepted by the widget loader, plus runtime updates.
Pass options to new SupportWireWidget({ … }).
Options
| Option | Type | Default | Description |
|---|---|---|---|
widgetSlug |
string |
required | Widget identifier from Settings → Widgets. |
appUrl |
string |
build default | Base 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. |
selector |
string |
— | CSS selector of a custom element to use as the trigger instead of the default launcher. |
hideOnLaunch |
boolean |
false |
Start with the launcher hidden; reveal later with showTrigger(). |
enableScreenshot |
boolean |
false |
Show a screenshot-capture button in the widget. |
userEmail |
string |
'' |
Identity by email. See Identity. |
userExternalUserId |
string |
'' |
Identity by your own user id. Takes precedence over userEmail. |
userSignature |
string |
'' |
HMAC-SHA256 signature of the identity value. |
userData |
object |
{} |
Custom attributes (name, plan, custom fields…) merged onto the contact. |
onOpen |
() => void |
— | Called when the widget opens. |
onClose |
() => void |
— | Called when the widget closes. |
onError |
(error: Error) => void |
console | Error 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 key | Maps to |
|---|---|
app_id |
widgetSlug |
user_id |
userExternalUserId |
email |
userEmail |
user_hash |
userSignature |
theme_mode |
theme |
custom_launcher_selector |
selector |
hide_default_launcher |
hideOnLaunch |
alignment ('left'/'right') |
triggerPosition |
Any other keys (name, phone, company, custom attributes…) are collected
into userData.