Skip to content
TruCom Developers
JavaScript SDK
DocumentationWidget SDK
JAVASCRIPT SDK

Configure your installation

Set options before loading or update supported appearance and behavior at runtime.

Initial configuration

Put this object before the loader. The same appearance renderer is used by Settings previews and installed widgets.

JavaScript
window.TruComWidgetConfig = {
  color: '#245b46',
  orientation: 'left',
  offsetX: 24,
  offsetY: 24,
  hideMobileWidget: false,
  helpEnabled: true,
  serviceStatusEnabled: true
};

Runtime configuration

Runtime overrides stay on the current page. They do not silently update workspace settings. Saved defaults are reapplied on a new page; options provided by that page then take precedence. An availability refresh preserves current runtime overrides.

JavaScript
await TruComWidget.configure({
  color: '#245b46',
  launcherLabel: 'Ask our team',
  showLauncherLabel: true,
  helpEnabled: false
});

Supported options

OptionBehavior
color, agentBubbleColor, agentTextColor, customerBubbleColor, customerTextColorSix-digit hex colour; #111111 is the default primary colour.
themesystem, light or dark.
orientation / positionleft or right; or a full position: top_left, top_right, center_left, center_right, bottom_left, bottom_right.
offsetX, offsetYInteger pixels from 0 to 120.
launcherIconchat, messages, help or headset.
launcherSize / launcherShapecompact, standard, large / round, rounded.
launcherLabel / showLauncherLabelText label up to 240 characters / boolean.
panelSize / panelMaxHeightcompact, standard, wide / 440–900 desktop pixels. Mobile remains full height.
cornerRadius8–32 pixels.
fontFamily / textSizesystem, rounded, serif / compact, standard, comfortable.
logoUrlHTTPS image URL. Empty uses the configured workspace fallback.
showThemeToggle / showBrandingBoolean visibility preferences.
headerTitle, greetingTitle, greetingMessage, replyExpectation, inputPlaceholder, startButtonLabel, awayMessageText overrides, up to 500 characters each.
labelsObject containing documented label keys; each value up to 240 characters.
helpEnabled / serviceStatusEnabledWidget display only. Public knowledge and status services stay active.
ratingEnabled, reviewEnabled, fileUploadsEnabled, endConversationEnabledBoolean; enabling requires that capability to be enabled in widget settings.
hideWidgetHide the widget on this page. open() rejects until shown again.
hideMobileWidget / hideDesktopWidgetHide on the selected device category.
hideLauncherHide the default launcher; your own support button can still open the panel.
privacyNoticeEnabled / privacyNoticeUrlPrivacy link visibility / HTTPS privacy URL.
privacyNoticeCheckRequired / consentTextRequire consent for this visitor session / text for that consent. A true requirement stays latched until session reset.
preChatEnabledMay enable pre-chat. It cannot bypass pre-chat requirements saved by the workspace.
languageBCP 47 language code. Core labels have built-in translations described in Localization.
customCss / launcherCssStyles within the panel iframe / launcher shadow root, up to 20,000 characters each.
cookieDomainInitial configuration only. Parent domain for an optional non-secret first-party visitor-context cookie.
gaKeyOptional GA4 measurement ID. Requires your own gtag or dataLayer setup.
displayMode / containerInitial configuration only: floating (default) or embedded; container is a CSS selector for embedded mode.
mobileModeInitial configuration only: true to use mobile presentation in an embedded app.
nativeBridgeOpt-in native command/result and event bridge.

Validation and capabilities

Unknown option names and invalid types reject with invalid_configuration. Container, display mode, cookie domain and mobile mode must be chosen before frame creation. Required workspace identity, pre-chat, consent, routing and file rules are enforced by the server. Appearance options do not grant access to history or enable disabled backend capabilities.

TruCom DevelopersSupport that belongs in your product.

Search documentation