Website widget
Install the widget on your website
Copy the embed code from the agent's Deploy tab, add your website to Allowed websites, and paste the tag before </body>.
Guide2 min readUpdated 23 October 2026
The widget puts a chat window for one agent on your website. It answers with the same prompt, model, knowledge and tools as the API, streams its replies, and every conversation lands on the agent's Conversations tab. It costs 1 credit per reply, like any other channel.
Before you start
- An agent that answers well in the Playground and is Active. A paused agent's widget tells visitors it is offline.
- Access to your website's HTML, or your site builder's custom code setting.
- Credits on your balance. At zero, visitors see "This assistant is unavailable right now".
Steps
- 1
Open the Deploy tab
Open the agent and go to Deploy, or open Widget in the sidebar and pick the agent. The first time you open it, SentientOne makes the agent's publishable widget key (
pk-so-…). - 2
Choose how it looks
Pick a Widget style (Chat bubble, Side panel or Popup), the Name in the widget (up to 40 characters), the Welcome message (up to 120) and a Colour. The embed code updates as you go.
- 3
Add your website
Under Allowed websites, add your domain, one per line, and click Save websites.
example.comalso coverswww.example.com;*.example.comcovers every subdomain. Changes take effect within a few seconds. See Allowed websites. - 4
Try it in the app
Click Test on this page to load the widget inside the app and send a message. The app's own pages are always allowed, so this works before your site is listed.
- 5
Copy the embed code and paste it
Click Copy embed code and paste the tag just before the closing
</body>tag of every page that should show the widget, or into your site builder's footer code. Always copy the tag from the Deploy tab: it has your key and agent id filled in.Embed code (example) <script src="https://app.sentientone.ai/widget.js" data-widget-key="pk-so-…" data-agent-id="YOUR_AGENT_ID" data-style="bubble" data-color="#2563eb" data-bot-name="Assistant" data-welcome="Hi, how can I help you today?" defer></script>
You're done when
The chat button appears on your live site, a test message gets a streamed answer, and the conversation shows on the agent's Conversations tab.
How it works on the page
- The script adds its own elements and styles to your page; it isn't an iframe. It always renders on a light background, with your accent colour.
- It talks to SentientOne with the publishable key, never your secret key. See Publishable keys.
- The conversation is held in memory, so it starts fresh when the visitor reloads the page.
- Replies render markdown, each has a copy button, and the window shows "Powered by SentientOne.AI".
- There is no JavaScript API to open, close or prefill it; everything is set by the tag's
data-attributes.
If something goes wrong
The button doesn't appear
Open the browser console. A missing data-widget-key or data-agent-id logs a warning and the widget stops; an old data-api-key tag logs an error. Full checklist: Widget not showing.
It says "This chat isn't enabled for this website yet."
Your site's address isn't in Allowed websites, or doesn't match it (for example a different subdomain). Add it, save, and reload after a few seconds.
It says "This assistant is offline right now."
The agent is paused. Turn it back on in the agent's Settings.
Related
Still stuck?
Email us with what you tried and any request id. A person replies.