Skip to main content

providers/notion

Built-in Notion integration.

default()​

default<P>(options): OAuthConfig< P >

Add Notion login to your page.

Example​

import { Auth } from "@auth/core"
import Notion from "@auth/core/providers/notion"

const request = new Request(origin)
const response = await Auth(request, {
providers: [
Notion({
clientId: NOTION_CLIENT_ID,
clientSecret: NOTION_CLIENT_SECRET,
redirectUri: NOTION_CLIENT_REDIRECT_URI
})
]
})

Resources​


Notes​

You need to select "Public Integration" on the configuration page to get an oauth_id and oauth_secret. Private integrations do not provide these details. You must provide a clientId and clientSecret to use this provider, as-well as a redirect URI (due to this being required by Notion endpoint to fetch tokens).

tip

The Notion provider comes with a default configuration. To override the defaults for your use case, check out customizing a built-in OAuth provider.

Disclaimer

If you think you found a bug in the default configuration, you can open an issue.

Auth.js strictly adheres to the specification and it cannot take responsibility for any deviation from the spec by the provider. You can open an issue, but if the problem is non-compliance with the spec, we might not pursue a resolution. You can ask for more help in Discussions.

Type parameters​

Parameter
P extends NotionProfile< P >

Parameters​

ParameterType
optionsOAuthUserConfig< P > & AdditionalConfig

Returns​

OAuthConfig< P >