Docusaurus logo
Documentation Platforms

Docusaurus AI Integration

AI answers on top of your Docusaurus site

What is it?

About Docusaurus

Docusaurus is Meta's open-source documentation framework built on React. It is widely used by large open-source projects to publish versioned, searchable documentation sites from Markdown and MDX files.

Integration capabilities

How BeforeQuery works with Docusaurus

Everything you can do once the Docusaurus integration is connected.

Multi-version doc support

BeforeQuery crawls each versioned path separately. Tag sources as v1, v2, or latest so users always get answers from the correct version of your Docusaurus docs.

Robots.txt and sitemap compliance

The crawler respects your Docusaurus robots.txt and uses the sitemap to discover all pages — including blog posts, API references, and custom pages.

Docusaurus plugin (coming soon)

Install the @beforequery/docusaurus plugin to auto-inject the chat widget into your Docusaurus layout with zero custom code.

Hybrid search across all versions

Users can ask questions about any version of your docs. BeforeQuery uses vector + full-text hybrid search and RRF fusion to surface the most relevant answer.

Setup

How to connect Docusaurus

  1. Step 01

    Add your Docusaurus site URL to a BeforeQuery knowledge base. The crawler will discover pages via sitemap.xml and start the first index.

  2. Step 02

    Paste the BeforeQuery widget script tag into your Docusaurus swizzled Layout component to surface AI chat to all visitors.

  3. Step 03

    Configure version labels in the BeforeQuery dashboard so users can filter answers by documentation version.

Docusaurus — Frequently Asked Questions

Common questions about connecting BeforeQuery to Docusaurus.

Yes. BeforeQuery can crawl each versioned path of your Docusaurus site separately and tag them (v1, v2, latest). Users get answers from the correct version, and you can configure which versions are indexed in the dashboard.
Swizzle your Docusaurus Layout component and add the BeforeQuery script tag in the head or body. Alternatively, use the @beforequery/react package inside your swizzled layout for a React-native integration.
Yes. BeforeQuery uses your Docusaurus sitemap.xml to discover all pages — including blog posts, API reference pages, and any custom pages. You can exclude specific URL patterns in the source settings if you prefer to limit indexing to the /docs path only.
You can configure a sync schedule (daily, weekly, or on-demand) or trigger a re-index automatically from your CI/CD pipeline after each Docusaurus build and deploy. An incremental sync only re-processes pages that have changed.
A native @beforequery/docusaurus plugin that auto-injects the widget without swizzling is in development. Until then, the script tag or @beforequery/react approach requires only a few lines of code in your swizzled layout.

Ready to connect Docusaurus?

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