Skip to content

ButterIX v1 is out: versions, multiple languages, Ask AI, and a per-site MCP server, all built in. →

Embed Ask AI

Put an Ask AI button or input bar on your website, in your dashboard, or inside your product, so readers can ask the docs without leaving the page.

The embedded assistant is the same Ask AI as on your docs site: the same model, instructions, custom answers, and content sources. Questions go to the same question log and count toward the same limits.

Get started

Add the allowed origins

Under "Ask AI → Embed" of the site, enter the websites that may embed the site's assistant (requires the admin role), for example https://app.acme.com; https://*.acme.com covers any subdomain. Up to 20, https only except for localhost. Changes apply right away.

You can also set them through the API. Without any origins, the assistant can't be embedded.

Add the script

Copy the embed code on the same page and paste it before </body> on your pages:

<script src="https://docs.acme.com/_biti/embed.js" async></script>

The default entry set in the console appears on the page (a button in the bottom-right corner until you choose otherwise) and opens the panel. To use a button or an input bar on this page regardless, add data-trigger="button" or data-trigger="bar".

Entry styles

data-trigger sets where readers open the panel from:

  • button: a floating button in the bottom-right corner, with an icon and "Ask AI".
  • bar: an input bar at the bottom center of the screen. Readers type their question right there; Enter expands the panel and answers at once. When there's already a conversation, clicking into the bar opens the panel; when there isn't, up to three suggested questions (from ai.suggestions) float up above the bar, ready to ask with one click.
  • none: no entry; you open it from code.
  • A CSS selector (such as #ask-docs): opens it when a matching element on the page is clicked.

Without data-trigger, the default entry style set under the site's "Ask AI → Embed → Appearance" applies (a button until you choose otherwise). When set, the page's choice applies, whatever the console says. For example, to keep the button across your website but use the input bar on your help center:

<script src="https://docs.acme.com/_biti/embed.js" data-trigger="bar" async></script>

The panel opens where the entry is. Readers can:

  • Drag its top edge, its sides, or its top corners to resize it, and double-click an edge to bring back the default size and position.
  • Hold the panel's header to move it.
  • Use the buttons in the panel's top-right corner to switch between light and dark, or to enlarge it to nearly the full height of the screen.
  • Drag the entry anywhere on the screen: hold and drag the button itself, or hold the stars at the left of the input bar. Double-click the button or the stars to put it back where the website places it.

These adjustments stay in the reader's browser for a day and apply whenever they open the panel again in that time. On phones and other narrow screens, the panel slides up from the bottom instead.

Skins

There are two skins:

  • Classic (default): a clean, solid entry and panel.
  • Aurora: the entry and panel are frosted glass, with colored light flowing slowly along the edges. The light brightens when a reader focuses the input bar and flares once when the panel opens.

In both skins, rotating neon light glows inward from the panel's edges while the AI answers, and fades out when the answer is done. The light stands still when the system's "reduce motion" setting is on.

The skin, along with the entry style, color mode, and accent colors below, can be set under "Ask AI → Embed → Appearance" of the site. It applies as soon as you save, with no new deployment and no change to your website's code.

Options

You can also set them on the page with data attributes on the script tag. Attributes you write take priority; the rest follow the appearance set in the console:

<script
  src="https://docs.acme.com/_biti/embed.js"
  data-trigger="bar"
  data-skin="aurora"
  data-theme="light"
  data-color="#7c5cff"
  data-color-dark="#9e8aff"
  data-width="520"
  data-height="680"
  data-left="50"
  data-bottom="32"
  data-breadcrumb="Console / Buckets / Settings"
  async
></script>
data-trigger"button" | "bar" | "none" | string
Entry style: button for a button, bar for an input bar; see Entry styles. When set, it takes priority; when missing, the default entry style from the console applies.
data-skin"classic" | "aurora"
Skin; see Skins. Defaults to classic.
data-theme"dark" | "light" | "auto"Default dark
Color mode. auto follows the visitor's system setting. Once a reader switches it in the panel, their choice applies until the website changes this attribute again.
data-colorstring
Accent color for light mode, in hex, such as #7c5cff. Used for the entry's icon, the send button, and the accents in the panel. Defaults to the docs site's light-mode accent.
data-color-darkstring
Accent color for dark mode, in hex. Without it, it's derived from data-color when that's set (lightened if too dark), or else the docs site's dark-mode accent is used.
data-widthnumberDefault 480
Default width of the open panel in pixels, 360 to 1600.
data-heightnumberDefault 640
Default height of the open panel in pixels, 440 to 1600. Shrinks to fit smaller screens; where even the smallest size doesn't fit, it opens as a sheet from the bottom.
data-leftnumberDefault 100 for the button, 50 for the bar
Where the entry sits from the left of the screen, as a percentage of the screen width from 0 to 100: 0 far left, 50 centered, 100 far right. The entry always stays fully on screen. You can also fill it in under "Ask AI → Embed → Embed code", and the code you copy includes it.
data-bottomnumberDefault 20
How far the entry sits from the bottom of the screen, in pixels, at least 16. Use it to keep clear of a bar fixed to the bottom of your page or another floating button; the suggested questions and the panel move up with the entry. On a screen too short for it, the entry moves down so it always stays fully on screen. You can also fill it in under "Ask AI → Embed → Embed code", and the code you copy includes it.
data-labelstring
Text on the button, or the placeholder in the input bar, up to 40 characters. An empty string shows the button's icon only.
data-langstring
Language of the panel, one of the docs site's languages. Defaults to the language in the page's <html lang>, or the docs site's default language when neither matches.
data-breadcrumbstring
Breadcrumb of the page the reader is on, such as Console / Buckets / Settings, up to 200 characters. Defaults to the page's current title. See The reader's page.

Where the accent is used for icons and outlines, a color that's too pale or too deep is adjusted so it stays visible on the current background.

You can change these attributes at any time, and the change applies right away. For example, to follow your website's own theme switch:

document.querySelector('script[src$="/_biti/embed.js"]').dataset.theme = "dark";
// or
ButterIX.configure({ theme: "dark" });

Open it from code

Once loaded, the script provides window.ButterIX:

ButterIX.open();                                                  // open the panel
ButterIX.open({ question: "How do I verify webhook signatures?" }); // open with a question written in; the reader sends it
ButterIX.close();
ButterIX.toggle();
ButterIX.configure({ theme: "light", color: "#0ea5e9", left: 20 }); // change options; null restores the default

configure takes the same keys as the data attributes, without data- and in camelCase: trigger, skin, theme, color, colorDark, width, height, left, bottom, label, lang, and breadcrumb.

The reader's page

With every question, the panel sends the address and breadcrumb of the page the reader is on at that moment. The AI uses them to understand what "here", "this page" or "this setting" means, and answers with what is relevant to that page first.

The breadcrumb defaults to the page's current title (in a single-page app, a new title after navigation is picked up too). When the title doesn't say where the reader is, pass a clearer path with data-breadcrumb and update it on navigation:

router.afterEach((to) => {
  ButterIX.configure({ breadcrumb: ["Console", ...to.matched.map((r) => r.meta.title)].join(" / ") });
});

In the console's Ask AI question log, the channel shows as "Embed"; hover the page to see the breadcrumb and the full address, and expand a question to see the full question, answer and all details. Parameters in the address that look like keys or tokens are masked.

Content Security Policy

If your website sets a CSP, allow the docs site's address:

script-src https://docs.acme.com;
frame-src https://docs.acme.com;
font-src https://docs.acme.com;

Add these values to the directives you already have.

Limits

  • Password-protected sites can't be embedded.
  • Embedding is unavailable when Ask AI is off (ai.enabled: false).
  • Source links in the panel open in a new tab.