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/theauth.ts

Endpoints

Scopes

Notion does not use granular OAuth scopes, and the provider does not send a PKCE challenge. 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. The provider keeps the last token payload in memory 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. Without an email, the oauth() plugin cannot match or create a user, so the callback returns JSON instead of a session.

Workspace data

The token response also includes workspace context (workspace_id, workspace_name), available in userInfo.raw on the result of createOAuthModule(...).handleCallback. The oauth() plugin does not persist this data, so if you need the workspace per user, drive the flow with the module and store it yourself.

OAuth overview

Generic OAuth 2.0 setup and account linking behavior.

GitLab

Another work and productivity OAuth provider.

Slack

Sign in with Slack using OpenID Connect.

Authentication overview

All sign-in methods available in theAuth.
Last modified on October 7, 2026