Embed script

The script tag that installs the widget, and every attribute it accepts.

The widget loads from one script. It reads its attributes, mounts the widget in an iframe, and does nothing else. All of the agent's configuration (theme, greeting, capabilities) lives server-side against the agent ID, so the tag never changes when you edit the agent.

The script

<script
  src="https://www.hey.support/api/chat/embed.js"
  data-chatbot-id="YOUR_ID"
  defer
></script>

Paste it before the closing </body> tag on every page where the agent should appear. Your ID is on the Deploy page.

Attributes

AttributeRequiredWhat it does
data-chatbot-idYesYour agent's ID, from the Deploy page.
data-displayNobubble or center. Overrides the agent's own display setting on this page. See Center stage.
data-auto-openNotrue opens the panel on page load. Use it sparingly; it interrupts.
data-contextNoPage or visitor context as URL-encoded JSON. See Host page context.

Add the script once. If your site has a shared layout or footer template, that is the place; a page that includes it twice gets one widget, but it is wasted work.

Where it runs

The widget renders inside its own iframe on our origin, so your page's CSS and scripts never touch it, and it never touches yours. It is sized and positioned by the script; your site's theme rules cannot clamp it.

If you have restricted the agent to specific domains on the Deploy page, the script paints nothing on any other domain and logs why in the browser console.

Next steps