This guide uses Widget v5 beta. Install a v5 package first; the
latest
tag still installs v4. Companion is a display option, while streaming and AI
capabilities depend on your organization’s configuration.Add Companion to your site
Get your widget token from Channels → Web chat. For a React integration:initOpenScript. Use one integration on a page. If you set inline: true, inline rendering takes precedence over Companion mode.
Choose the layouts visitors can use
companion.layouts controls the choices and their order. Keep one layout to hide the picker. defaultLayout accepts compact or sidebar; when omitted, the first allowed layout is used. An empty layout list falls back to all three.
To place Companion beside your page instead of over it:
mode: 'floating' when the page layout should stay unchanged. side: 'auto' uses the right edge on left-to-right pages and the left edge on right-to-left pages.
Enable the capabilities you need
Open Channels → Web chat to copy your widget token and manage website features next to a live preview. Feature switches save as you change them; a successful save refreshes the preview. On smaller screens, use the Settings and Preview tabs.
Use Advanced settings at the bottom of the page, or open Settings → Advanced, for capabilities used across channels:
- Progress updates and Remembers past sessions control how the agent keeps customers informed and uses earlier sessions.
- Scheduled follow-ups, Task plans, Workspace and Builds mini apps are available on request. Enabled scheduled follow-ups let the agent check back and continue the same session later.
- Features available to your organization have a switch. Other features show Contact sales to request access. Editing requires the appropriate settings permission.
features: { dictation: false, clientTools: false } to its options to hide dictation and prevent the agent from highlighting that page. Setting a feature to true, or omitting it, leaves the organization setting in charge. There is no per-embed features.attachments switch.
Share the current page
Host-supplied context is sent with messages, stored in the session history, and can be included in the agent’s input. Send only the page information the agent needs. The examples combinewindow.location.origin and window.location.pathname, so query parameters and URL fragments are excluded. Those values can contain login tokens, search terms or other private data and should not become part of the stored session. If your path or page title also contains private information, replace it with an approved route label or omit it.
Use a context function so each message includes the page at the time it is sent. You can also provide the record the visitor is viewing:
options.context after initialization does not reliably update every sending path. Keep a callback that reads fresh values rather than reinitializing the widget on each navigation.
Only supply context you intend the agent to receive.
features.pageContext: false disables widget-collected page context and its controls; it does not
remove the host application’s context from messages. Remove or narrow that
callback separately when needed.Mark a region and attach a screenshot
With Sees the page enabled:- Open the expanded Companion panel and choose Mark something on the page to ask about it in the composer.
- Click the page element you want to discuss. Choose a shape such as Box, Circle or Arrow, and adjust the marked region.
- Add a note such as “Explain this balance.” Press Enter or choose Attach mark.
- Review the marked screenshot in the composer, add your question, and send. Remove the attachment first if you change your mind.
companion.quickAskTools: 'all' if you also want attachment and page-mark controls in the quick-ask bar.
Let visitors mention records
Configurementions.items for a fixed list, or mentions.search for records loaded as the visitor types. Each item needs type, id and title:
@ and pick a record. The selected records travel with the message when page context is enabled. Supply only records the signed-in visitor is allowed to access; mentioning an ID does not grant access to it.