# Notion

Shoko reads Notion through an internal integration that you create. It can read only the pages you share with it.

## Get an integration secret

1. Open the Notion developer portal. You must be a workspace owner to create an integration.
2. Create a new integration for your workspace. Read access is all Shoko needs.
3. Open its **Configuration** tab and reveal the token. Copy it and paste it into Shoko.

## Share pages with the integration

The integration cannot see a page until you share it:

1. Open the page in Notion.
2. Open the **•••** menu at the top right.
3. Choose **Add connections** and select your integration.

Do this for each top-level page or database you want indexed. Pages nested under a shared page are included. Pages you forget to share are not indexed, and Shoko will not warn you that they exist.

## What gets indexed

Every page the integration can reach, including database rows, converted to markdown. Each page starts with a header of its properties. The path follows the page hierarchy and ends with the last 12 characters of the page id, so two pages with the same title stay apart: `Engineering/Runbooks/Deploys 1a2b3c4d5e6f.md`.

## What is skipped

Pages that are not shared with the integration. Archived and deleted pages. Files, images and embeds, which are not text. For a very long page Notion returns only the first part; the text then ends with a note saying so.

## How syncing works

Once a day Shoko reads every page the integration can reach. Hourly and every-5-minutes libraries also ask Notion in between for pages edited since the last sync, and for pages moved to the trash. Notion's search takes a few minutes to catch up with edits; Shoko allows for that. Pages you stop sharing with the integration, pages deleted for good, and the new paths of pages under a renamed or moved page are updated at the next daily full sync, within a day. See [Sync and limits](/docs/sync-and-limits).

## Permissions

Anyone you grant this library to can search every page you shared with the integration. Shoko does not look at who can open a page in Notion. See [Teams and access](/docs/teams-and-access).
