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
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.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.
Related
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.