Skip to main content

providers/notion

Built-in Notion integration.

Functions

default()

Signature

default<P>(options: Omit<Partial<OAuthConfig<P>>, "options" | "type"> & Required<Pick<OAuthConfig<P>, "clientId" | "clientSecret">> & AdditionalConfig): 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("https://example.com")
const response = await Auth(request, {
providers: [Notion({ clientId: "", clientSecret: "", redirectUri: "" })],
})

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

  • P extends NotionProfile<P>

Parameters

NameType
optionsOmit<Partial<OAuthConfig<P>>, "options" | "type"> & Required<Pick<OAuthConfig<P>, "clientId" | "clientSecret">> & AdditionalConfig

Returns

OAuthConfig<P>