window.centillion.
Use it to connect your own buttons to the chat or change its presentation for
the current page. Use the snippet from Channels → Install → Website widget,
with embed.js?v=10 or newer.
Open, close and reset
close() preserves the conversation and unsent text. resetChat() clears the
conversation, draft and attachments, ends any active voice call, and starts a
new session. It preserves the visitor’s identity and runtime overrides,
including custom initial messages. It does not delete stored conversation
records or tickets.
A published conversation stays on the release where it started. Resetting it
reloads the chat iframe and starts a conversation using the current
release traffic allocation, including that
release’s saved greeting and appearance. The embed script reapplies runtime
overrides after the iframe reloads.
If A/B testing excludes the visitor, open(),
auto-open and runtime options leave the widget hidden. Resetting the chat does
not change the visitor’s assignment. Use 100% or disable testing in
Display → A/B testing to include every visitor while checking your controls.
Open with a message
error event. hideMessage has
no effect without message.
Runtime options
Invalid fields log a
console.error and leave their previous values intact.
Valid fields in the same call still apply. setOptions() rejects oversized
values instead of truncating them.
Reset overrides
Individual setters
setOptions() for that field, with one exception.
setInitialMessages() truncates the array’s text to 1,000 characters in order.
setOptions({ initialMessages }) rejects an oversized array. Both methods write
the same override, so the last valid call wins.
Dictation and voice calls
Dictation uses the browser’s speech recognition, separate from a live voice call with the agent. Enable Voice to text (Dictation) under Display. Visitors start recording themselves and grant microphone permission. In the normal composer, the transcript goes into the message box for review. WithdictationOnly: true, stopping dictation sends it as a chat message.
Browser speech recognition support varies. Unsupported browsers show
“Dictation is unavailable in this browser.” They can still use the normal text
composer unless you hide it with dictationOnly. Microphone permission errors
appear beside the dictation button. Inline frames need allow="microphone".
A reset discards unfinished dictation and releases the microphone.
Events
{ type, data }. Register listeners before the
operation you want to observe. Reapplying an unchanged value emits no change.
Updates React renders together produce one optionsChanged event with the
resulting overrides.
Hidden prompts are visible to your event listeners. Avoid writing sensitive
message content to analytics or console logs.
Reset after inactivity
tool-result, check event.data.name
and event.data.result, then schedule the reset.
Custom buttons and navigation
Calls before the script loads
The API queues controls while its settings and iframe load. If your application runs before the embed script itself, install this queue first:centillion("open", options) and
centillion.open(options) work. Existing centillion("registerTools", tools)
and the separate Centillion("identify", identity) API keep working.
Use one agent’s embed script per page.
Plain iframe controls
Without the embed script,window.centillion does not exist. Wait for the
iframe’s iframeReady event, then post controls to its origin. Verify both the
sender window and origin before handling responses.
type, and the method argument for params.
For example, post { type: "resetChat" } to reset, or
{ type: "open", params: { message: "Help me choose a plan" } } to send a message.
close hides the chat content, and open shows it again. The parent page owns
the inline iframe’s size and placement, including the space left when hidden.
Register the message listener before assigning the iframe’s src or inserting
it into the page so you do not miss readiness. Messages sent before readiness
are not queued by a plain iframe.
A published chat reset reloads the iframe. Keep handling each iframeReady
event and resend your options after every reload. The listener above stays on
the host page and reapplies dictationOnly to the new conversation.