Notion プロバイダー
リソース
セットアップ
コールバック URL
https://example.com/api/auth/callback/notion
環境変数
AUTH_NOTION_ID
AUTH_NOTION_SECRET
AUTH_NOTION_REDIRECT_URI
構成
/auth.ts
import NextAuth from "next-auth"
import Notion from "next-auth/providers/notion"
export const { handlers, auth, signIn, signOut } = NextAuth({
providers: [
Notion({
clientId: process.env.AUTH_NOTION_ID,
clientSecret: process.env.AUTH_NOTION_SECRET,
redirectUri: process.env.AUTH_NOTION_REDIRECT_URI,
}),
],
})
注記
oauth_id
およびoauth_secret
を取得するには、構成ページで「パブリック統合」を選択する必要があります。プライベート統合ではこれらの詳細は提供されません。- このプロバイダーを使用するには、
clientId
およびclientSecret
と、リダイレクト URI (トークンをフェッチするために Notion エンドポイントで必要となるため) を提供する必要があります。