Create a widget in the dashboard, paste one script tag into your site, and ask it a question. Using a docs platform? The platform guides show where the tag goes.

Before you start

  • A knowledge base with at least one synced source. It must be external: an internal knowledge base cannot have public keys, so it cannot power the widget.
  • The owner or admin role in the workspace. Only they can create website widgets.
  • A way to add a <script> tag to every page of your site.

Create a widget

1

Open Website widget

In the dashboard, go to Integrations → Website widget and click New widget.
2

Fill in three fields

  • Name: only you see it, for example Docs site.
  • Knowledge base: where the answers come from.
  • Public key: pick one, or click Create public key.
Click Create. The widget’s page opens.
3

Allow your site

On the Install tab, under Access, add your site to Allowed origins. Write one per line, with the scheme: https://docs.example.com. Add any staging site too, then click Save.An empty list allows every site. https://*.example.com matches any single-level subdomain. localhost always passes this list, so you can test locally. The public key has its own list with no such exception: see Troubleshooting.

Add the script tag

Copy the snippet from Install → Embed snippet. It looks like this:
<script async src="https://widget.kelu.dev/kelu-widget.js"
  data-widget-id="YOUR_WIDGET_ID"
  data-client-key="kl_pk_..."></script>
Paste it into the template that renders every page, in <head> or just before </body>.
  • data-widget-id names your widget. Its colours, text and every other setting load from the dashboard, so you can change them later without touching your site.
  • data-client-key is the widget’s public key. A key belongs to one knowledge base, so if you move the widget to another knowledge base, the key changes too. Copy the new snippet into your site.
Moving from kapa.ai? The widget reads data-website-id as data-widget-id, but the value must be your Kelu widget id. See Moving from kapa.ai.
You can also skip the widget and embed with data-knowledge-base-id instead of data-widget-id, setting every option as a data-* attribute. The knowledge base’s Integrations tab shows that snippet. See Configuration.

Check it works

1

Reload a page

A round Ask AI button appears in the bottom-right corner. Click it, or press Cmd+K (Ctrl+K on Windows and Linux). Esc closes the panel.
2

Ask a question

Ask something your knowledge base covers. The answer streams in, with its pages listed under Sources.
Changes you save in the dashboard show up on the next page load. An attribute on the tag always wins over the dashboard setting.

Troubleshooting

Open your browser’s developer tools and reload the page.
  • No button, and the console says KeluWidget is not defined. The script did not load. Check that the tag is on the page. If your site has a Content Security Policy, allow the widget’s domains: see How do I fix CSP errors?
  • A 403 in the Network tab. The page’s origin is not allowed. Check the widget’s Allowed origins on the Install tab, and the public key’s own allowed origins under the knowledge base’s Integrations tab → Client Keys. A 403 can also mean the widget’s Enabled switch is off. The button still appears, but every question fails with the same 403.
  • The console says [Kelu Widget] configuration refused for widget <id>. The line ends with the status and a code. code=WIDGET_DISABLED: turn the widget’s Enabled switch back on. code=ORIGIN_NOT_ALLOWED: add this page’s origin to the widget’s Allowed origins. status=404: the widget id is wrong, or the widget belongs to a different knowledge base than the key. Until you fix it, every question fails.
  • It works on your site but not on localhost. Your public key has its own allowed origins, and localhost is not added to a key’s list automatically. A key’s list cannot be edited. Click New public key on the widget’s Install tab, save, and paste the new snippet into your site: the key is part of it.
  • Cmd+K opens your site’s search as well. Turn off Open with Cmd/Ctrl+K on the widget’s Behaviour tab.
  • Not sure which version loaded. Run KeluWidget.version in the console.
The widget stores a random anonymous id in the reader’s browser, so repeat visits count as one reader. If your privacy rules need consent first, see User tracking.

Next steps