Tutorial to write a complete Segment integration from scratch.
The GitBook Integration Platform is currently in alpha. It's not opened to developers just yet.
This tutorial will guide you in creating an integration tracking specific events happening in GitBook into a destination.
For a complete code reference, you can check out the official integration:

Step 1: Create the integration

After following the Quickstart guide to install and configure the GitBook CLI, you can create a new integration:
gitbook new ./my-segment
The CLI will prompt you to enter a title and to select scopes, choose the scopes space:views to ensure the integration can listen to the space:view event.

Step 2: Define the configuration

Step 3: Track events from GitBook