Installing the widget

The widget puts your bot on your own website as a chat launcher in the corner of the page. Installing it is one script tag. Nothing else runs in your page.

The snippet

Open Bot → Install in the dashboard. It shows the snippet for your bot with a copy button and a live preview:

<script
  src="https://grounded.buzz/widget.js"
  data-bot="pk_your_bot_key"
  data-position="right"
  async
></script>

Paste it just before the closing </body> tag, on every page the widget should appear on. The install page has tabs with the exact place to put it for plain HTML, Next.js, WordPress and Webflow sites.

  • Next.js — add it to app/layout.tsx with next/script and strategy="afterInteractive", so it loads on every route without joining the critical path.
  • WordPress — Appearance → Theme File Editor → footer.php, before </body>, or the footer slot of any "insert headers and footers" plugin.
  • Webflow — Project Settings → Custom Code → Footer Code, then publish. Webflow only runs custom code on published sites, not in the Designer.

Allowed domains

The widget only answers on domains you have listed. Add them under Bot → Install → Allowed domains. Type the site as you would visit it — acme.com, https://docs.acme.com, localhost:4000 for local testing — and Grounded normalises it to an origin.

Origins are matched exactly. www.acme.com and acme.com are two entries, and so are http:// and https://. Wildcards are not supported: an allowlist that matches subdomains is a list of sites nobody has checked.

A request from any other origin is refused. That is what stops someone from copying your snippet onto their own site and spending your pebbles. Until you add a domain, the widget renders but does not answer, and the preview on the install page tells you so.

Snippet attributes

Only data-bot is required.

Attribute Values Default
data-bot your public key —
data-position right or left right
data-offset pixels from the edge, 0 to 200 20
data-open true to open the chat as soon as the page loads closed
data-lang the page's language, one of the fifteen below the page's <html lang>

The widget opens in the page's language when the bot speaks it (Settings → Languages), else in the bot's main language. From the visitor's first message on, its buttons and every answer follow the language the visitor writes in. Set data-lang only when your page's <html lang> is wrong.

Fifteen languages, by their codes: en English, ru Russian, de German, fr French, es Spanish, it Italian, pt Portuguese, nl Dutch, pl Polish, cs Czech, uk Ukrainian, tr Turkish, sv Swedish, da Danish, ja Japanese. The widget's own words — the buttons, the placeholder, the notes under an answer — exist in each. The twelve beyond English, Russian and German were drafted here and have not yet been read by a native speaker; if a phrase is off, tell us and it is fixed. The welcome message and the starter questions are yours, written once for each language you choose. The dashboard itself stays in English, Russian and German.

A very short message — one or two words — can be ambiguous between close languages ("Precios" could be Portuguese). The widget then follows the language of the message before it, or the bot's main language. A bot with its languages fixed answers only in those.

The public key identifies the bot and nothing more. It is designed to be visible in your page; the allowed domains, the rate limit and your pebbles are what authorise a request.

Appearance

How the widget looks is set on the Appearance tab of the dashboard, so you can change it without touching your site. A change reaches the button on your site within about a minute, and the chat panel the next time it opens. The preview beside the controls is the real widget and follows your changes before you save them.

On every plan: light, dark, or follow the visitor's system, the accent colour and which side the button sits on. On Pro and Business: the panel's colours, the message bubbles, the corner radius, border and shadow, and the launcher button — its icon, size, shape, colours and shadow. On Free you can try all of it in the preview; it is just not saved. Text colours are checked for contrast, and a pair that cannot be read does not save — the editor shows the ratio and offers the nearest colour that can.

Custom panel colours belong to one palette, so they need light or dark (not "follow the visitor"). A bot that has never chosen stays dark, as it always was. If a Pro plan ends, the saved look is kept but not shown; it comes back when the plan does.

Your logo on the button

On Pro and Business, the launcher button can carry your own logo instead of an icon. Upload a PNG, JPEG, WebP or SVG up to 1 MB on the Appearance tab. It is resized to 144 × 144 pixels and stored as a PNG; an SVG becomes a picture, so nothing inside it runs. The logo sits on the button's colour, so a transparent PNG gets a background. It is saved the moment it is uploaded, unlike the rest of the tab, and replacing or removing it deletes the old file.

If your site's Content Security Policy restricts images, allow the address the Appearance tab shows under the logo; without it the button falls back to its icon.

Suggest from my site

On Pro and Business, Suggest from my site on the Appearance tab reads the colours your own site already uses — its stylesheet variables, its main button, its theme colour — and puts them in the draft as a first try. It reads one of the domains the bot is allowed on, takes a few seconds, and writes nothing until you press Save. If your site has an icon, it offers it as the logo, and applies it only when you say so. It sees static CSS: a site that builds its styles with a script, or a framework that sets its colours at runtime, may show nothing, and the button says so instead of guessing.

Templates

On Pro and Business, the look can be moved as a file. Export JSON saves the colours, shape and launcher of the draft; Import JSON loads such a file into the draft, where you can see it, fix it and save it, or discard it. Four presets (Light, Dark, Minimal, Brand-bold) are there to start from.

{
  "$schema": "https://grounded.buzz/schemas/widget-theme.v1.json",
  "version": 1,
  "mode": "light",
  "colors": { "accent": "#2563eb", "background": "#ffffff", "foreground": "#111111" },
  "shape": { "radius": 12, "borderWidth": 1, "shadow": "soft" },
  "launcher": {
    "icon": "sparkles",
    "size": 60,
    "shape": "rounded",
    "background": "#2563eb",
    "iconColor": "#ffffff"
  }
}

A template is only appearance, so it carries no logo, no position and no badge, and importing one leaves those as they are. Anything the file does not name goes back to its default. A key the format does not know is an error that names the field, and the nearest real key when there is one; a file from a newer version is refused. Text colours that cannot be read are still caught: the template loads, and the editor shows what to change before it can be saved. The $schema line gives an editor like VS Code completion for every key.

  • Accent colour — a hex colour applied to the send button and the visitor's messages. Text on it switches between black and white automatically so it stays readable.
  • Welcome message — the first thing a visitor reads. If you leave it empty, the bot introduces itself by name and explains that it answers from the documentation.
  • Starter questions — the questions under the welcome message. Automatic makes them from your document titles, My own shows up to three you write, exactly as written, and Off shows none. What you wrote is kept when you switch back and forth.
  • Show sources to visitors — on by default. Turn it off to hide the source chips under answers. The bot still answers only from your documents and every citation is still saved, so you can read them in Conversations.
  • The dot beside the name — green and pulsing while the bot will answer, grey and still when it will not (for example, when the pebbles for the month are used up). It reads the state when the chat opens.
  • "Powered by Grounded" — shown under the composer on the Free plan. Pro and Business can turn it off.

Controlling the widget from your own code

Once the script has loaded, window.Grounded is available:

window.Grounded.open()
window.Grounded.close()
window.Grounded.toggle()
window.Grounded.ask('How do I reset my API key?') // opens the chat with the question typed in

The widget also dispatches events on window, which you can use for analytics or to wire a "Help" link to the chat:

Event When
grounded:ready the chat has loaded and can take a question
grounded:opened the panel opened
grounded:closed the panel closed
grounded:answered an answer finished

While the panel is closed, finished answers are counted on a badge on the launcher.

How it behaves on your page

The launcher is drawn inside a closed shadow root with its own styles, so your site's CSS cannot restyle it and it cannot restyle your site. The chat itself is an iframe served from Grounded's own origin: none of Grounded's JavaScript, CSS or dependencies run in your page.

The script is under 5 KB compressed. On load it asks Grounded for one small file, the look of the button; the chat itself is fetched only when the visitor clicks the launcher. On screens narrower than 480 px the chat opens full screen.

If you paste the snippet twice, the second copy does nothing.

Rate limits and pebbles

Each visitor can send 20 messages per minute to a bot. Above that the widget asks them to wait a moment. Every answer uses pebbles from your plan; when too few are left for an answer, the widget replies politely that the bot is unavailable for now, and the dashboard shows a button to buy more pebbles, or to upgrade on Free. There is never an error page.

Pausing a bot

Turn off Active in the bot's settings to pause it. The launcher still appears on your site, and the chat says the bot is paused and to try again later. Turn it back on and it answers again immediately.

Accessibility and the AI notice

The widget tells every visitor, on every plan, that they are talking to an AI assistant: a line under the chat's name and the first note of the conversation, in the language of the chat. It cannot be removed — removing "Powered by Grounded" does not touch it, and no setting hides it. Under the EU AI Act (Art. 50(1)) it is the provider's duty to say so, and it is ours.

The chat is a labelled dialog that works from the keyboard alone: Enter on the launcher opens it, Tab stays inside, Escape closes it and focus returns to the launcher. A new answer is announced once, whole, by a screen reader. The launcher is at least 44 × 44 px with a focus ring that shows on light and dark pages, and animation stops when the visitor has asked for reduced motion. In Appearance, a theme whose text is below 4.5 : 1 or whose accent is below 3 : 1 against the panel cannot be saved, and "Suggest from my site" moves a colour that is too faint to the nearest one that is not.

If your own site must publish an accessibility statement (in Germany the BFSG asks for one), you may link to ours — /accessibility on the Grounded site, in German /de/barrierefreiheit — for the widget's part. It says what is met, what is not, and the date of the last check. The page around the widget, and the launcher's colours on your page, remain yours to check.