gitbook-manifest.yaml reference
The manifest defines the integration's identity, permissions, editor blocks, installer-facing configuration, and secrets. It's generated by gitbook integration new and read by gitbook integration publish.
Required fields: name, title, description, organization, visibility, scopes, script (script is required to publish).
Identity fields
name: acme-changelog # globally unique across ALL GitBook integrations
title: Acme Changelog # display name
description: Post changelog updates into your docs. # short, one line
organization: <org_id> # org id or subdomain that owns the integration
script: ./src/index.tsx # entry file; must default-export createIntegration()summary is an optional longer Markdown description shown on the installation page, limited to 2048 characters.
Visibility
| Value | Meaning |
|---|---|
private |
Default. Only members of the owning organization can install. |
unlisted |
Any org can install, but only via the shared install link. |
public |
Any org can install; required for marketplace submission (separate review process). |
Scopes
Request only what the code uses — installers see the list.
scopes:
# Spaces
- space:content:read # read space content
- space:content:write # write space content
- space:metadata:read
- space:metadata:write
- space:git:sync # manage Git Sync within a space
# Sites
- site:metadata:read
- site:views:read # site analytics
- site:visitor:auth # authenticated-access workflows
- site:adaptive:read # read Adaptive Content claims
- site:adaptive:write # write Adaptive Content claims
# OpenAPI
- openapi:read
- openapi:write
# Conversations
- conversations:ingestsite:script:inject and site:script:cookies appear in GitBook-owned integrations but are internal-only — third-party integrations cannot inject JavaScript into sites. Don't request them and don't design around them.
Events may require matching scopes (e.g. space_content_updated needs space content/metadata read access).
Blocks
Declares custom blocks so they appear in the editor's insert palette (⌘ + /). Each id must match a componentId in the code.
blocks:
- id: example-block
title: Example Block
description: An example block for a GitBook integrationOptional per-block keys:
urlUnfurl— list of URL prefixes this block unfurls when pasted into the editor (pairs with the@link.unfurlaction; seecontentkit.md).markdown— serialize the block as a Markdown code-block instead of an opaque node:blocks: - id: block-name title: My custom block markdown: codeblock: blocksyntax # the code fence language body: content # which prop becomes the fence bodyA block with props
{ "content": "something", "propA": "A" }serializes as:```blocksyntax propA="A" something ```This is how the native Mermaid block works — use it when block content should survive round-trips through Git Sync as readable Markdown.
Marketplace/installation-page presentation
categories: # any of: analytics, collaboration, content, marketing, authenticated-access, other
- content
icon: ./assets/icon.png # local path, shipped with the integration
previewImages: # recommended 1600×800 (2:1)
- ./assets/preview.png
externalLinks:
- label: Documentation
url: https://example.com/docsConfigurations (installer-facing settings form)
configurations.account renders at org-installation level; configurations.site renders per site/space installation. Each takes properties (the form fields) and an optional required list. Values entered by the installer surface at runtime in context.environment (installation configuration object).
Property types:
configurations:
account:
properties:
oauth_credentials: # button — the OAuth entry point
type: button
title: Connection
description: Authorization between my app and GitBook.
button_text: Authorize
callback_url: /oauth # route handled by createOAuthHandler in fetch
api_region: # string with fixed choices
type: string
title: Region
enum: [us, eu]
default_channel: # string with dynamic choices
type: string
title: Default Channel
completion_url: /channels # integration endpoint returning options
required:
- oauth_credentials
site:
properties:
notify_content_update:
type: boolean
title: Notify Content Update
default: true
max_items:
type: number
title: Max items
default: 5string— free text;enumturns it into a fixed dropdown;completion_urlfetches dropdown options from an endpoint on the integration.number,boolean— plain inputs; supportdefault.button— for OAuth or other callback flows;button_text+callback_url.
Installation & configuration flow
installation_setup fires when the integration is first installed and again every time the installer edits a configuration property. The installation's status stays incomplete until the configuration validates against the schema, then becomes active. Check environment.installation.status !== 'active' to detect unfinished setup — don't assume configuration exists in event handlers that can fire before setup completes.
Secrets
Runtime secrets (API keys, OAuth client credentials) are declared with environment indirection — never literal values in the manifest:
secrets:
CLIENT_ID: ${{ env.CLIENT_ID }}
CLIENT_SECRET: ${{ env.CLIENT_SECRET }}Env vars are not loaded into the manifest automatically; wrap the CLI with dotenv-cli so .env is visible at publish time, e.g. in package.json:
{ "scripts": { "publish": "dotenv -- gitbook integration publish" } }At runtime the values appear as context.environment.secrets.CLIENT_ID.
CLI reference
| Command | What it does |
|---|---|
gitbook auth --token <token> |
Authenticate with a personal access token (from https://app.gitbook.com/account/developer); prompts if --token is omitted. Works in CI, SSH and agent sandboxes. Required for publishing/unpublishing integrations. A GITBOOK_TOKEN env var is also honoured. |
gitbook login |
Browser (OAuth) sign-in. Needs a localhost callback, so it doesn't work in CI/SSH/sandboxes, and it can't publish or unpublish integrations. If you used it, run gitbook logout before gitbook auth. |
gitbook integration new [dir] |
Scaffold a new integration; prompts for name, title, organization, scopes. |
gitbook integration check [file] |
Check the integration build. |
gitbook integration publish [file] |
Publish a new version of the integration defined by the manifest (-o/--organization to pick the org); prints the install link. |
gitbook integration dev [file] |
Start the local dev proxy — routes the installed integration's traffic to your machine. Requires the integration to be published and installed somewhere first. |
gitbook integration tail |
Fetch and print the integration's execution logs. |
gitbook integration unpublish [integration] |
Remove the integration from the platform (requires a token login). |
gitbook whoami |
Show the authenticated user. |
gitbook help |
Command help. |
gitbook openapi publish <file-or-url> --spec <name> --organization <org_id> |
Publish/update an OpenAPI spec (adjacent tooling, not integration-specific). |
Requires Node v18+. Install with npm install @gitbook/cli -g. The old top-level gitbook new, publish, dev and unpublish still work as hidden aliases but print a deprecation warning. gitbook integrations (plural) is the raw API group (list, get, installations, events, etc.), not the authoring group. Authenticate with gitbook auth --token <token> (or GITBOOK_TOKEN), not gitbook login; browser sessions can't publish integrations.