Index the content
Crawling is unaffected — GitBook publishes ordinary HTML. Add a website source pointing at your GitBook domain (yourproduct.gitbook.io or your custom domain). Pages index, chunk, embed and cite exactly as any other docs site, and every answer links back to the GitBook page it came from.
Put the assistant where you do control the markup
Your GitBook content is answerable from any surface that does not need a script on GitBook’s pages:Your app or marketing site
The same widget, embedded where you own the HTML. It answers from the GitBook content and links back to it.
Slack, Discord, Teams
Readers ask in the channel they are already in. No docs-site change at all.
MCP server
Cursor, Claude and other MCP clients search the docs directly.
Browser extension
A side panel that answers on any page, including GitBook’s.
Advanced: inject at the edge
If your GitBook site is served through a custom domain that you proxy — a Cloudflare-proxied CNAME rather than a direct one — you can add the script in transit instead of at the origin. A Cloudflare Worker usingHTMLRewriter appends it to every response:
worker.js
*.gitbook.io addresses, and it is your infrastructure to operate, not GitBook’s. Treat it as a real option only if you already terminate that domain.
Get your keys — your knowledge base ID and public client key (
bq_pk_...) are in the BeforeQuery dashboard under Knowledge Base → Integration. Add whichever domain ends up serving the widget to the key’s origin allowlist.