Overview
The Docs Embed consists of multiple tabs that get shown automatically, depending on your site’s configuration:- Assistant: The GitBook Assistant - an AI-powered chat interface to help users find answers
- Docs: A browser for navigating your documentation site
Get started
Prerequisites
Before embedding your docs, ensure:
- Your docs are published and accessible at a URL (e.g.,
https://docs.company.com). - You have retrieved the embed script URL from your site settings (Settings → AI & MCP → Embed).
If you want to use the Assistant tab, GitBook Assistant must be enabled for your docs site (Settings → AI & MCP).
Choose implementation method
Pick the approach that matches your setup:
Script tag
Drop in a
<script> tag for the fastest setup, then customize its appearanceNode.js/NPM
Install via NPM for server-side rendering or build-time control
React component
Use prebuilt React components for seamless integration
If your docs use authenticated access, follow the steps in how to set up the embed with authenticated docs.
Implementation methods
Standalone script tag
Quick setup with a<script> tag for the fastest implementation. This is ideal for static sites or when you want to get up and running quickly.
Node.js/NPM
Install via NPM for server-side rendering or build-time control. This approach gives you more control over the embed lifecycle and is ideal for server-rendered applications.React component
Use prebuilt React components for seamless integration into React applications. This provides the most natural integration for React-based products.Configuration options
Customizing the embed
You can customize various aspects of the embed:- Welcome messages - Customize the initial greeting users see
- Suggested questions - Pre-populate questions to help users get started
- Custom actions - Add buttons that trigger specific workflows in your product
- Styling - Match the embed to your product’s design system
Creating custom tools
Connect Assistant to your product APIs by creating custom tools. This allows the Assistant to:- Fetch real-time data from your application
- Trigger actions in your product
- Provide personalized answers based on user context
Using with authenticated docs
If your docs use authenticated access, you’ll need to configure the embed to pass authentication tokens. This ensures that users see the appropriate content based on their permissions.
API reference
For the complete API reference and source code, see the@gitbook/embed package on GitHub.