Skip to main content

Get credentials

1

Create an integration

Go to Notion Integrations and click New integration. Set the type to Public, this is required for OAuth with external users.
2

Configure OAuth settings

In the integration settings, scroll to OAuth Domain & URIs. Add your redirect URI:
Set Redirect URIs and save.
3

Copy credentials

Under Basic Information, copy the OAuth client ID and generate an OAuth client secret.

Configuration

lib/kavach.ts

Endpoints

Scopes

Notion does not use granular OAuth scopes. Permissions are configured at the integration level in the Notion UI. When a user authorizes your integration, they choose which pages and databases to share.

User data returned

Notion returns user identity as part of the token exchange response, there is no separate /me endpoint. KavachOS caches the token payload internally so no extra network call is made.
The email field is only present when a person authorizes the integration. If a workspace bot is the owner (owner.type === "workspace"), the email will be absent. Always check for userInfo.email before using it.

Workspace data

The token response also includes workspace context, available in userInfo.raw:
This is useful for multi-workspace SaaS apps where you want to scope data per Notion workspace.
Last modified on April 29, 2026