GitBook has no setting that adds your own script tag to a published site, and Kelu has no GitBook integration. So the widget cannot run on pages GitBook hosts. You can still answer questions about your GitBook content.

Index your GitBook content

Add a website source that points at your GitBook site, such as yourproduct.gitbook.io or your custom domain. GitBook pages index like any other docs site, and every citation links back to the GitBook page.

Answer from somewhere else

Your own site or app

Put the widget on a site you control. It answers from your GitBook content and links back to it.

Slack and Teams

Readers ask in a channel they already use.

MCP server

Cursor, Claude and other AI tools search your docs directly.

Browser extension

A side panel that answers on any page, GitBook’s included.

If you run a proxy in front of GitBook

If your docs domain passes through a proxy you control, such as a Cloudflare Worker, the proxy can add the widget to every HTML page. This does not work for *.gitbook.io addresses. First create a widget and add your docs domain to its Allowed origins. Then add the snippet to each HTML response. On Cloudflare:
worker.js
export default {
  async fetch(request) {
    const response = await fetch(request);
    const type = response.headers.get("content-type") || "";
    if (!type.includes("text/html")) return response;

    return new HTMLRewriter()
      .on("head", {
        element(el) {
          el.append(
            '<script async src="https://widget.kelu.dev/kelu-widget.js" ' +
              'data-widget-id="YOUR_WIDGET_ID" data-client-key="kl_pk_..."></script>',
            { html: true },
          );
        },
      })
      .transform(response);
  },
};
Replace YOUR_WIDGET_ID and kl_pk_... with the values from your widget’s snippet, and deploy the Worker on your docs domain’s route. To check it, open a page and look for the round Ask AI button in the bottom-right corner.