Skip to content

Website widget

Widget options: every data- attribute

The script tag's attributes: widget key, agent id, style, colour, bot name and welcome message, with defaults and limits.

Reference1 min readUpdated 23 October 2026

The widget (widget.js v1.8) is configured entirely by attributes on its script tag. Change an attribute on your site and the next page load uses it; nothing is stored on SentientOne's side except the key's allowed websites.

Attributes

AttributeWhat it setsIn the Deploy tab's codeIf left out
data-widget-keyThe agent's publishable key, pk-so- plus 40 hex characters. RequiredThe agent's keyConsole warning, widget doesn't load
data-agent-idThe agent's id. Required, and must be the key's own agentThe agent idConsole warning, widget doesn't load
data-stylebubble (Chat bubble: a small window above a floating button), panel (Side panel: slides in from the right edge) or popup (a centred window over the page)bubblebubble
data-colorThe accent colour, any hex value#2563eb#7c3aed
data-bot-nameThe name in the window's header. The Deploy tab allows up to 40 charactersThe agent's name, or AssistantAI Assistant
data-welcomeThe first message visitors see. The Deploy tab allows up to 120 charactersHi, how can I help you today?Hi! How can I help you today?
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>

Keep defer (or load the script after your content) so it never holds up your page. The Deploy tab offers six colour presets (blue #2563eb, violet #7c3aed, emerald #059669, orange #ea580c, rose #e11d48, slate #475569) and a custom colour.

What you can't change

  • The window is always light; only the accent colour changes.
  • Launcher position and size are fixed by the style you pick.
  • "Powered by SentientOne.AI" is always shown.
  • There's no JavaScript API (no window.SentientOne) and no per-visitor settings.

data-api-key is refused

Tags that carry data-api-key (a secret key) don't load at all. See Update an old embed.