### Install Go SDK Source: https://github.com/gitbookio/public-docs/blob/main/skills/gitbook/references/example-site/developers/v2/getting-started/quickstart.md Install the Evolve Go SDK using go get. ```bash go get github.com/evolve-pay/evolve-go ``` -------------------------------- ### Custom Instructions Example for GitBook Agent Source: https://github.com/gitbookio/public-docs/blob/main/gitbook-agent/what-is-gitbook-agent.md This example shows how to configure GitBook Agent with site-specific instructions for technical writing, focusing on clarity, accuracy, and structure for guides and quickstarts. ```text You are a technical writer at Stripe. Use clear, direct language and prioritize accuracy over flourish. For guides, always introduce the concept with a one-sentence summary and break content into well-structured sections. For quickstarts, always use a stepper and keep every step action-first and concise. ``` -------------------------------- ### API Authentication Guide Example Source: https://github.com/gitbookio/public-docs/blob/main/skills/gitbook/references/write-gitbook-syntax.md An example page demonstrating GitBook features like info hints, tabs, and steppers for API authentication documentation. It shows how to present API key and OAuth 2.0 methods. ```markdown # API Authentication Guide Learn how to authenticate with our API using API keys or OAuth 2.0. {% hint style="info" %} All API requests require authentication. Choose the method that best fits your use case. {% endhint %} ## Authentication Methods {% tabs %} {% tab title="API Key" %} The simplest authentication method. Include your API key in the request header: ```bash curl -H "X-API-Key: your-api-key" https://api.example.com/v1/users ``` {% hint style="warning" %} Never commit API keys to version control. Use environment variables instead. {% endhint %} {% endtab %} {% tab title="OAuth 2.0" %} More secure for user-facing applications: {% stepper %} {% step %} ``` -------------------------------- ### Install Python SDK Source: https://github.com/gitbookio/public-docs/blob/main/skills/gitbook/references/example-site/guides/tutorials/payment-flows/accept-one-time-payment.md Install the necessary Evolve and Flask packages for Python. ```bash pip install evolve flask ``` -------------------------------- ### Install Node.js SDK Source: https://github.com/gitbookio/public-docs/blob/main/skills/gitbook/references/example-site/guides/tutorials/payment-flows/accept-one-time-payment.md Install the necessary Evolve and Express packages for Node.js. ```bash npm install @evolve/node express ``` -------------------------------- ### Install Node.js SDK Source: https://github.com/gitbookio/public-docs/blob/main/skills/gitbook/references/example-site/developers/v2/getting-started/quickstart.md Install the Evolve Node.js SDK using npm. ```bash npm install @evolve/node ``` -------------------------------- ### Install Ruby SDK Source: https://github.com/gitbookio/public-docs/blob/main/skills/gitbook/references/example-site/developers/v2/getting-started/quickstart.md Install the Evolve Ruby SDK using gem. ```bash gem install evolve ``` -------------------------------- ### Install Python SDK Source: https://github.com/gitbookio/public-docs/blob/main/skills/gitbook/references/example-site/developers/v2/getting-started/sdks.md Install the Python SDK using pip or poetry. Requires Python 3.9+. Both synchronous and asynchronous clients are available. ```bash pip install evolve # or poetry add evolve ``` -------------------------------- ### Install Python SDK Source: https://github.com/gitbookio/public-docs/blob/main/skills/gitbook/references/example-site/developers/v2/getting-started/quickstart.md Install the Evolve Python SDK using pip. ```bash pip install evolve ``` -------------------------------- ### Install Node SDK Source: https://github.com/gitbookio/public-docs/blob/main/skills/gitbook/references/example-site/developers/v2/getting-started/sdks.md Install the Node.js SDK using npm, yarn, or pnpm. Requires Node 18+. ```bash npm install @evolve/node # or yarn add @evolve/node # or pnpm add @evolve/node ``` -------------------------------- ### Install GitBook Adaptive Content Helper Source: https://github.com/gitbookio/public-docs/blob/main/site-access/adaptive-content/enabling-adaptive-content/feature-flags.md Install the GitBook adaptive content helper package using npm. This is a prerequisite for integrating feature flags into your application. ```bash npm install @gitbook/adaptive ``` -------------------------------- ### Basic Tab Block Example Source: https://github.com/gitbookio/public-docs/blob/main/creating-content/blocks/tabs.md This example demonstrates how to create a tab block with multiple tabs, each containing specific instructions for different operating systems. Use this to present platform-specific information clearly. ```Liquid {% tabs %} {% tab title="Windows" icon="windows" %} Here are the instructions for Windows {% endtab %} {% tab title="macOS" icon="apple" %} Here are the instructions for macOS {% endtab %} {% tab title="Linux" icon="linux" %} Here are the instructions for Linux {% endtab %} {% endtabs %} ``` -------------------------------- ### Example SUMMARY.md Structure Source: https://github.com/gitbookio/public-docs/blob/main/getting-started/git-sync/content-configuration.md This is an example of how to structure your SUMMARY.md file to define page groups and individual pages. ```markdown # Summary​ ## Use headings to create page groups like this one​ * [First page’s title](page1/README.md) * [Some child page](page1/page1-1.md) * [Some other child page](part1/page1-2.md) * [Second page’s title](page2/README.md) * [Some child page](page2/page2-1.md) * [Some other child page](part2/page2-2.md) ## A second-page group​ * [Another page](another-page.md) ``` -------------------------------- ### Repo-level README.md Example Source: https://github.com/gitbookio/public-docs/blob/main/skills/gitbook/references/repo-scaffolding.md Example content for the top-level README.md file in a GitBook repository, explaining the repository's purpose and relation to the published site. ```markdown # my-docs Source for the [My Product docs site](https://docs.example.com). Each top-level folder is a separate GitBook space; edits flow in both directions via Git Sync once configured. ``` -------------------------------- ### Complete Frontmatter Example Source: https://github.com/gitbookio/public-docs/blob/main/gitbook/SKILL.md An example of a complete frontmatter block including description, icon, variables, and detailed layout configurations, followed by page content. ```markdown --- description: Create reusable variables that can be referenced in pages and spaces icon: icons vars: latest_version: v3.0.4 support_email: help@example.com layout: width: wide title: visible: true description: visible: true tableOfContents: visible: true outline: visible: true pagination: visible: true --- # Your Page Title Page content starts here... ``` -------------------------------- ### Complete Page Frontmatter Example Source: https://github.com/gitbookio/public-docs/blob/main/skills/gitbook/references/page-frontmatter.md This example demonstrates all available fields for page configuration in GitBook frontmatter, including description, icon, hidden status, cover image, variables, and layout options. ```markdown --- description: Page description used for SEO and page previews icon: book-open hidden: true cover: .gitbook/assets/hero.png coverY: 0 vars: page_variable: value another_var: another value if: visitor.claims.unsigned.isPremium layout: width: default # or 'wide' cover: visible: true size: full # or 'hero' title: visible: true description: visible: true tableOfContents: visible: true outline: visible: true pagination: visible: true metadata: visible: true --- ``` -------------------------------- ### Example Prompt Block Source: https://github.com/gitbookio/public-docs/blob/main/creating-content/blocks/prompt.md This is an example of a prompt block containing instructions for an AI. It specifies the task, output format, and constraints. ```markdown Summarize the key changes in this release note. Group the response into: new features, breaking changes, and recommended next steps. Keep the answer under 150 words. ``` -------------------------------- ### Code Block Example Source: https://github.com/gitbookio/public-docs/blob/main/gitbook/SKILL.md Shows how to render a standard code block with syntax highlighting. ```markdown ```javascript const foo = 'bar'; console.log(foo); ``` ``` -------------------------------- ### GitBook File Structure Example Source: https://github.com/gitbookio/public-docs/blob/main/gitbook/SKILL.md Illustrates the typical directory and file organization for a GitBook project. ```tree / .gitbook/ assets/ # GitBook-managed images and files includes/ # Reusable content blocks vars.yaml # Space-level variables .gitbook.yaml # Configuration README.md # Homepage SUMMARY.md # Table of contents getting-started/ # Section folder installation.md quickstart.md api-reference/ authentication.md endpoints.md ``` -------------------------------- ### Conditional Content Block Example Source: https://github.com/gitbookio/public-docs/blob/main/creating-content/blocks/conditional-content.md This example demonstrates how to use Jinja-like syntax to conditionally display content based on the presence or absence of a specific user claim (example_attribute_A). It includes links to toggle the attribute for testing. ```GitBook Jinja {% if visitor.claims.unsigned.example_attribute_A %} This block is only visible to users **with** attribute A. View without attribute A {% endif %} {% if !visitor.claims.unsigned.example_attribute_A %} This block is only visible to users **without** attribute A. View with attribute A {% endif %} ``` -------------------------------- ### GitBook External Link Example Source: https://github.com/gitbookio/public-docs/blob/main/gitbook/SKILL.md Shows the standard markdown syntax for creating external links. ```markdown [text](https://example.com) ``` -------------------------------- ### Create a Connected Account (Python) Source: https://github.com/gitbookio/public-docs/blob/main/skills/gitbook/references/example-site/guides/tutorials/marketplace/onboard-sellers.md Create a new connected account for a seller and retrieve the onboarding URL. Store the account ID and set the initial onboarding status in your database. ```python account = evolve.ConnectedAccount.create( type="individual", country="US", email=request.json["seller_email"], metadata={"internal_seller_id": seller.id}, ) db.sellers.update( seller.id, evolve_account_id=account.id, onboarding_status="pending", ) return jsonify(onboardingUrl=account.onboarding_url) ``` -------------------------------- ### GitBook Stepper Custom Block Source: https://github.com/gitbookio/public-docs/blob/main/gitbook/SKILL.md The `{% stepper %}` block is used for sequential, multi-step processes where the order of operations is important, such as in tutorials or installation guides. ```markdown {% stepper %} {% step %} ## First step Complete the initial setup by installing the required dependencies. {% endstep %} {% step %} ## Second step Configure your environment variables in the `.env` file. {% endstep %} {% step %} ## Third step Run the application with `npm start`. {% endstep %} {% endstepper %} ``` -------------------------------- ### Get Git Sync State of a Space Source: https://github.com/gitbookio/public-docs/blob/main/skills/gitbook/references/api-cheatsheet.md Check the current Git Sync status for a given space. This is useful to verify if the Git Sync setup was completed successfully through the UI. ```bash curl -s -H "Authorization: Bearer $GITBOOK_TOKEN" \ https://api.gitbook.com/v1/spaces/$SPACE_ID/git/info ``` -------------------------------- ### Get and Update a GitBook Site Source: https://github.com/gitbookio/public-docs/blob/main/skills/gitbook/references/api-cheatsheet.md Fetches details for a specific GitBook site using its organization and site IDs. Also includes an example for updating a site's title using a PATCH request. ```bash # Get curl -s -H "Authorization: Bearer $GITBOOK_TOKEN" \ https://api.gitbook.com/v1/orgs/$ORG_ID/sites/$SITE_ID ``` ```bash # Update (PATCH) curl -s -X PATCH -H "Authorization: Bearer $GITBOOK_TOKEN" \ -H "Content-Type: application/json" \ -d '{"title": "New Title"}' \ https://api.gitbook.com/v1/orgs/$ORG_ID/sites/$SITE_ID ``` -------------------------------- ### Guides Space Page Tree Structure Source: https://github.com/gitbookio/public-docs/blob/main/skills/gitbook/references/site-structure-design.md A common and effective structure for a guides space, organizing content from overviews to specific how-to guides and references. ```markdown README.md (overview, value prop, "what you can do here") getting-started/ installation.md quickstart.md first-project.md core-concepts/ how-to/ reference/ cli.md configuration.md troubleshooting.md ``` -------------------------------- ### Payload Version Example Source: https://github.com/gitbookio/public-docs/blob/main/skills/gitbook/references/example-site/developers/v2/webhooks/event-catalog.md Example of the payload structure including the api_version. ```APIDOC ```json { "id": "evt_...", "type": "charge.succeeded", "api_version": "2026-01-15", ... } ``` ``` -------------------------------- ### Create GitBook Client Instance Source: https://github.com/gitbookio/public-docs/blob/main/docs-site/embedding/configuration/reference.md Use this to create a GitBook client instance. Requires your GitBook docs site URL. ```javascript import { createGitBook } from '@gitbook/embed'; const gitbook = createGitBook({ siteURL: 'https://docs.company.com' }); ``` -------------------------------- ### Create a Connected Account (Node.js) Source: https://github.com/gitbookio/public-docs/blob/main/skills/gitbook/references/example-site/guides/tutorials/marketplace/onboard-sellers.md Create a new connected account for a seller and retrieve the onboarding URL. Store the account ID and set the initial onboarding status in your database. ```javascript const account = await evolve.connect.connectedAccounts.create({ type: "individual", country: "US", email: req.body.sellerEmail, metadata: { internal_seller_id: seller.id, }, }); await db.sellers.update(seller.id, { evolve_account_id: account.id, onboarding_status: "pending", }); res.json({ onboardingUrl: account.onboarding_url }); ``` -------------------------------- ### Configure Application with LaunchDarkly and GitBook Helper Source: https://github.com/gitbookio/public-docs/blob/main/site-access/adaptive-content/enabling-adaptive-content/feature-flags.md Integrate the LaunchDarkly React SDK with GitBook's `withLaunchDarkly` helper to pass feature flags as context to your GitBook site. Ensure the LaunchDarkly client is available before calling the helper. ```javascript import { render } from 'react-dom'; import { withLaunchDarkly } from '@gitbook/adaptive'; import { asyncWithLDProvider, useLDClient } from 'launchdarkly-react-client-sdk'; import MyApplication from './MyApplication'; function PassFeatureFlagsToGitBookSite() { const ldClient = useLDClient(); React.useEffect(() => { if (!ldClient) { return; } return withLaunchDarkly(ldClient); }, [ldClient]); return null; } (async () => { const LDProvider = await asyncWithLDProvider({ clientSideID: 'client-side-id-123abc', context: { kind: 'user', key: 'user-key-123abc', name: 'Sandy Smith', email: 'sandy@example.com' }, options: { /* ... */ } }); render( , document.getElementById('reactDiv'), ); })(); ``` -------------------------------- ### Initialize Docs Embed (NPM Package) Source: https://github.com/gitbookio/public-docs/blob/main/docs-site/embedding/configuration/reference.md Create a Docs Embed client instance using the NPM package. ```javascript createGitBook(options) ``` -------------------------------- ### cURL Example Source: https://github.com/gitbookio/public-docs/blob/main/skills/gitbook/references/example-site/developers/v2/getting-started/authentication.md Example of how to authenticate a cURL request to the Evolve API using the Authorization header. ```APIDOC ## cURL Authentication Example ### Description This example demonstrates how to authenticate a cURL request to the Evolve API by including the `Authorization` header with a bearer token. ### Method GET ### Endpoint /v2/charges ### Headers - **Authorization** (string) - Required - The authentication token in the format `Bearer $EVOLVE_SECRET_KEY`. ### Request Example ```bash curl https://api.evolve.com/v2/charges \ -H "Authorization: Bearer $EVOLVE_SECRET_KEY" ``` ``` -------------------------------- ### Example Site Structure Configuration Source: https://github.com/gitbookio/public-docs/blob/main/skills/gitbook/references/inputs-checklist.md This JSON defines the structure of a GitBook site, including titles, icons, and descriptions for different sections. Use this to plan navigation and content organization. ```json [ {"title": "Guides", "icon": "book-open", "description": "Concepts and tutorials"}, {"title": "API Reference", "icon": "code", "description": "REST API and SDKs"}, {"title": "Changelog", "icon": "clock-rotate-left", "description": "Updates and release notes"} ] ``` -------------------------------- ### Initialize GitBook Instance Source: https://github.com/gitbookio/public-docs/blob/main/docs-site/embedding/implementation/nodejs.md Create a GitBook instance by providing the URL of your docs site. This instance is used to generate embed URLs. ```javascript const gitbook = createGitBook({ siteURL: "https://docs.company.com", }); ``` -------------------------------- ### Markdown Quote Example Source: https://github.com/gitbookio/public-docs/blob/main/creating-content/blocks/quote.md This is an example of how to format a quote using Markdown. It includes the quote text and attribution. ```markdown > "No human ever steps in the same river twice, for it’s not the same river and they are not the same human." — _Heraclitus_ ``` -------------------------------- ### Webhook Payload Example Source: https://github.com/gitbookio/public-docs/blob/main/skills/gitbook/references/example-site/developers/v2/webhooks/event-catalog.md An example of a webhook payload, showing the event ID, type, and API version it was generated against. ```json { "id": "evt_...", "type": "charge.succeeded", "api_version": "2026-01-15", ... } ``` -------------------------------- ### Basic .gitbook.yaml Configuration Source: https://github.com/gitbookio/public-docs/blob/main/getting-started/git-sync/content-configuration.md Use this configuration to set the root directory, README, SUMMARY files, and define redirects. ```yaml root: ./ ​structure: readme: README.md summary: SUMMARY.md​ redirects: previous/page: new-folder/page.md ``` -------------------------------- ### Get Frame URL (React Components) Source: https://github.com/gitbookio/public-docs/blob/main/docs-site/embedding/configuration/reference.md Use the useGitBook hook to get the frame URL, optionally with specific options. ```jsx useGitBook().getFrameURL(options) ``` -------------------------------- ### Initialize GitBook Embed with Visitor Token (NPM Package) Source: https://github.com/gitbookio/public-docs/blob/main/docs-site/embedding/using-with-authenticated-docs.md When using the NPM package, create a GitBook instance and then generate the iframe source URL, including the visitor token and any optional unsigned claims. ```javascript import { createGitBook } from "@gitbook/embed"; const gitbook = createGitBook({ siteURL: "https://docs.company.com", }); const iframe = document.createElement("iframe"); iframe.src = gitbook.getFrameURL({ visitor: { token: "your-jwt-token", unsignedClaims: { userId: "123", plan: "premium" }, }, }); ``` -------------------------------- ### Install GitBook Embed NPM Package Source: https://github.com/gitbookio/public-docs/blob/main/docs-site/embedding/implementation/nodejs.md Install the @gitbook/embed package using npm. This is the first step for server-side rendering or build-time integration. ```bash npm install @gitbook/embed ``` -------------------------------- ### Initialization Source: https://github.com/gitbookio/public-docs/blob/main/docs-site/embedding/implementation/script.md Initializes the GitBook widget with the site URL and optional frame customization options. ```APIDOC ## GitBook('init', options: { siteURL: string }, frameOptions?: { visitor?: {...}, colorScheme?: 'light' | 'dark' }) ### Description Initializes the widget with the site URL and optional frame options. ### Method JavaScript Function Call ### Parameters #### Arguments - **options** (object) - Required - An object containing the siteURL. - **siteURL** (string) - Required - The URL of the GitBook site. - **frameOptions** (object) - Optional - Options for customizing the widget frame. - **visitor** (object) - Optional - Visitor-specific configurations. - **colorScheme** ('light' | 'dark') - Optional - Sets the color scheme of the widget. ``` -------------------------------- ### OpenAPI Block Example Source: https://github.com/gitbookio/public-docs/blob/main/api-references/openapi/README.md This example demonstrates how to embed an OpenAPI specification into a GitBook page. Users can interact with the API endpoints defined in the spec directly from the documentation. ```APIDOC ## OpenAPI Block ### Description Embeds an OpenAPI specification to create interactive API documentation. ### Method POST (implicitly, for the example endpoint) ### Endpoint /pet (from the example spec) ### Parameters #### Path Parameters None explicitly shown in this block example. #### Query Parameters None explicitly shown in this block example. #### Request Body This block allows for interactive request body input based on the OpenAPI spec. ### Request Example ```json { "example": "Request body will be defined by the OpenAPI spec" } ``` ### Response #### Success Response (200) Response structure is defined by the OpenAPI spec. #### Response Example ```json { "example": "Response body will be defined by the OpenAPI spec" } ``` ### Usage ```markdown {% openapi src="https://petstore3.swagger.io/api/v3/openapi.json" path="/pet" method="post" %} [https://petstore3.swagger.io/api/v3/openapi.json](https://petstore3.swagger.io/api/v3/openapi.json) {% endopenapi %} ``` ``` -------------------------------- ### Monorepo Asset Handling Example Source: https://github.com/gitbookio/public-docs/blob/main/getting-started/git-sync/monorepos.md Demonstrates how assets are scoped to individual spaces in a monorepo. Assets in one space's directory are not automatically available to another space synced from a different directory. ```text / packages/ docs-en/ .gitbook.yaml README.md SUMMARY.md .gitbook/ assets/ logo.png docs-fr/ .gitbook.yaml README.md SUMMARY.md .gitbook/ assets/ logo.png ``` -------------------------------- ### Visitor Schema with Boolean Claim (Tabbed Example) Source: https://github.com/gitbookio/public-docs/blob/main/site-access/adaptive-content/enabling-adaptive-content/README.md A basic visitor schema example demonstrating how to include a boolean claim. This is presented within a tabbed interface for different data types. ```json { "type": "object", "properties": { "isBetaUser": { "type": "boolean", "description": "Whether the visitor is a Beta user." }, }, "additionalProperties": false } ``` -------------------------------- ### Initialize Docs Embed (React Components) Source: https://github.com/gitbookio/public-docs/blob/main/docs-site/embedding/configuration/reference.md Provide the site URL to the GitBookProvider for initializing Docs Embed in a React application. ```jsx ``` -------------------------------- ### Get a space / list a space's tree Source: https://github.com/gitbookio/public-docs/blob/main/skills/gitbook/references/api-cheatsheet.md Retrieves details of a specific space or its content tree. Use the content endpoint to get the structure of pages and groups within a space. ```APIDOC ## GET /v1/spaces/$SPACE_ID ### Description Retrieves details of a specific GitBook space. ### Method GET ### Endpoint https://api.gitbook.com/v1/spaces/$SPACE_ID ### Response #### Success Response (200) Details of the space. ``` ```APIDOC ## GET /v1/spaces/$SPACE_ID/content ### Description Retrieves the content tree (pages and groups) of a specific GitBook space. ### Method GET ### Endpoint https://api.gitbook.com/v1/spaces/$SPACE_ID/content ### Response #### Success Response (200) The content tree structure of the space. ``` -------------------------------- ### Markdown Task List Example Source: https://github.com/gitbookio/public-docs/blob/main/creating-content/blocks/task-list.md Demonstrates how to create a task list with nested items and different completion states using markdown syntax. Indentation is achieved with tabs. ```markdown * [ ] Here’s a task that hasn’t been done * [x] Here’s a subtask that has been done, indented using `Tab`. * [ ] Here’s a subtask that hasn’t been done. * [ ] Finally, an item, unindented using `shift` + `tab`. ``` -------------------------------- ### Monorepo Directory Structure Example Source: https://github.com/gitbookio/public-docs/blob/main/getting-started/git-sync/monorepos.md Illustrates a typical monorepo structure with multiple packages, each potentially containing a .gitbook.yaml file for separate GitBook space synchronization. ```text / package.json packages/ styleguide/ .gitbook.yaml README.md SUMMARY.md app/ README.md SUMMARY.md api/ .gitbook.yaml README.md SUMMARY.md ``` -------------------------------- ### Example Webhook Event Payload Source: https://github.com/gitbookio/public-docs/blob/main/skills/gitbook/references/example-site/developers/v2/webhooks/README.md This is an example of the JSON payload structure for a webhook event. It includes event ID, type, creation timestamp, API version, event data, and request details. ```json { "id": "evt_3KsM12pL9qXa7", "object": "event", "type": "charge.succeeded", "created": 1714477200, "api_version": "2026-01-15", "data": { "object": { "id": "ch_3KsM12pL9qXa7", "object": "charge", "amount": 4200, "currency": "usd", "status": "succeeded" } }, "request": { "id": "req_8h2nF6m4Lp", "idempotency_key": "7b8f2c4a-91d2-4fe1-9b6a-2c8e5f1a9b0c" } } ```