window.ChatWidget, so your own buttons, links, and flows can open the chat, identify signed-in customers, and send messages.
There is no package to install. The SDK is a single script served by Sagepilot.
Requirements
- A Website Widget channel in Sagepilot. See Website Widget to create one.
- The channel’s widget key, in the format
workspace_id:channel_id. You can copy it from the channel’s install script. - Access to your site’s HTML, theme files, or tag manager.
Quick start
1
Add the script
Paste this before the closing
</body> tag on every page where chat should be available. It loads the widget and stores a promise, window.sagepilotWidgetReady, that resolves when the widget is ready.2
Open chat from your own button
3
Identify signed-in customers
WORKSPACE_ID:CHANNEL_ID with your widget key.
Start here
Install the widget
Add the script to a website, single-page app, tag manager, or Shopify store.
Configure the widget
Set launcher, placement, and layout options when the widget starts.
Open chat from your button
Connect chat to your own buttons, links, and banners.
Identify customers
Link chats to signed-in customers and verify their identity.
Draft and send messages
Prefill or send a message from your page.
API reference
Every
window.ChatWidget method and what it returns.How it works
The script adds a launcher button and a hidden chat frame to your page. The chat itself is hosted by Sagepilot, so appearance, greetings, conversation starters, and the AI agent come from the channel settings in Sagepilot. You can change those settings without editing your site.
On screens 768 px wide or narrower, the open chat fills the screen. On wider screens, it opens as a panel of up to 420 × 700 px on the side set in the channel settings.