> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-opensw-1772748614-696205f.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Gitbook integration

> Integrate with the Gitbook document loader using LangChain JavaScript.

This example goes over how to load data from any GitBook, using Cheerio. One document will be created for each page.

## Setup

```bash npm theme={null}
npm install @langchain/community @langchain/core cheerio
```

## Load from single GitBook page

```typescript theme={null}
import { GitbookLoader } from "@langchain/community/document_loaders/web/gitbook";

const loader = new GitbookLoader(
  "https://docs.gitbook.com/product-tour/navigation"
);

const docs = await loader.load();
```

## Load from all paths in a given GitBook

For this to work, the GitbookLoader needs to be initialized with the root path ([https://docs.gitbook.com](https://docs.gitbook.com) in this example) and have `shouldLoadAllPaths` set to `true`.

```typescript theme={null}
import { GitbookLoader } from "@langchain/community/document_loaders/web/gitbook";

const loader = new GitbookLoader("https://docs.gitbook.com", {
  shouldLoadAllPaths: true,
});

const docs = await loader.load();
```

***

<div className="source-links">
  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/oss/javascript/integrations/document_loaders/web_loaders/gitbook.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>

  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>
</div>
