GitBook logo
Documentation Platforms

GitBook AI Integration

Bring AI answers to your GitBook knowledge base

What is it?

About GitBook

GitBook is a collaborative documentation platform used by teams to write internal wikis, public knowledge bases, and API references. It publishes content as a hosted website with a clean reading experience.

Integration capabilities

How BeforeQuery works with GitBook

Everything you can do once the GitBook integration is connected.

Space-level crawling

BeforeQuery crawls your entire GitBook space, capturing every page including nested sub-pages and variant branches.

Scheduled re-sync

Configure a sync schedule (daily, weekly, or on-demand) so your BeforeQuery index reflects the latest edits made in GitBook.

Internal and public spaces

Index public GitBook sites directly. For private spaces, use the GitBook API integration to pull content with authentication.

Citation links to exact pages

Answers include direct links to the GitBook page and heading anchor, making it easy for users to read the full context.

Setup

How to connect GitBook

  1. Step 01

    Create a BeforeQuery knowledge base and add your GitBook space URL as a source. For private spaces, provide an API token in the source settings.

  2. Step 02

    Run the first crawl. BeforeQuery normalises GitBook's page structure into clean markdown chunks ready for indexing.

  3. Step 03

    Embed the BeforeQuery widget on your GitBook site using the custom HTML injection in GitBook's settings, or share the portal link with your team.

GitBook — Frequently Asked Questions

Common questions about connecting BeforeQuery to GitBook.

Yes. For private GitBook spaces, provide a GitBook API token in your BeforeQuery source settings. BeforeQuery uses the token to authenticate and pull content, so the space does not need to be publicly accessible.
GitBook supports custom HTML injection in space settings. Paste the BeforeQuery widget script tag there. The widget will appear as a chat launcher on every page of your GitBook space.
Yes. BeforeQuery crawls your GitBook space and captures all pages including nested sub-pages. You can configure which variant or branch to index as the primary source in the BeforeQuery dashboard.
You can configure a scheduled sync (daily or weekly) so BeforeQuery re-indexes your GitBook space regularly. For more immediate updates, trigger a manual sync from the BeforeQuery dashboard after major edits.
Yes. Every AI answer shows the source paragraphs it drew from pointing to the exact GitBook page URL and, where possible, to the specific heading anchor — so readers can verify and read the full context in one click.

Ready to connect GitBook?

Start free. No credit card required. Connect your first integration in under 5 minutes.