build-integration

Installation
SKILL.md

Build a GitBook Integration

A skill for building integrations on GitBook's developer platform: apps that run inside GitBook itself. An integration can render custom blocks in the editor, show configuration UI, listen to events (content updated, Git sync completed, space viewed), authenticate against external services with OAuth, and talk to anything over HTTP.

This skill covers the integration lifecycle — scaffold, code, develop, publish. For creating or restructuring the docs site an integration might be installed into, defer to configure-site; for authoring page content, defer to write-docs.

What an integration is (mental model)

An integration is a small TypeScript app executed by GitBook's runtime — not a script injected into pages, and not code running on the user's server. Three consequences shape everything else:

  1. Rendering happens on GitBook's backend. Your component's render function runs server-side on every interaction and returns ContentKit markup (a JSX-like UI description). There is no client-side React tree you control, no DOM access, and UI updates flow through the action → new state → re-render loop.
  2. You cannot inject JavaScript into a site. The site:script:inject and site:script:cookies scopes you'll see in GitBook-owned integrations are internal-only. If the user's plan amounts to "add a script tag to their docs", stop and say so early — the supported paths are custom blocks, webframes, and events.
  3. Local development is a proxy, not a server you visit. gitbook dev routes the installed integration's traffic to your machine. You never open the dev server's port in a browser; you interact with the integration inside app.gitbook.com.

The project

gitbook new scaffolds this shape:

Installs
282
GitHub Stars
12
First Seen
Jul 15, 2026
build-integration — gitbookio/gitbook-skills