コンテンツへスキップ
NextAuth.js v4からの移行?こちらを ご確認ください。.

providers/notion

組み込みのNotion統合。

NotionProfile

拡張

プロパティ

access_token

access_token: string;

bot_id

bot_id: string;

duplicated_template_id

duplicated_template_id: string;

owner?

optional owner: Owner;

workspace_icon

workspace_icon: string;

workspace_id

workspace_id: number;

workspace_name

workspace_name: string;

Owner

プロパティ

type

type: string;

user

user: User;

Person

拡張

プロパティ

email

email: string;

User

拡張

プロパティ

avatar_url

avatar_url: null | string;

id

id: string;

name

name: string;

object

object: "user" | "bot";

owner?

optional owner: {
  type: "user" | "workspace";
  workspace: string;
};
type
type: "user" | "workspace";
workspace
workspace: string;

person

person: Person;

type

type: string;

workspace_name?

optional workspace_name: null | string;

default()

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

Notion ログインをページに追加します。

設定

コールバックURL

https://example.com/api/auth/callback/notion

設定

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,
    }),
  ],
})

リソース

備考

oauth_idoauth_secret を取得するには、設定ページで「公開統合」を選択する必要があります。プライベート統合ではこれらの情報は提供されません。このプロバイダーを使用するには、clientIdclientSecret、およびリダイレクトURI(Notion のエンドポイントでトークンを取得するために必要)を指定する必要があります。

💡

Notion プロバイダーにはデフォルトの設定があります。ユースケースに合わせてデフォルト値をオーバーライドする場合は、組み込み OAuth プロバイダーのカスタマイズをご覧ください。

**免責事項** デフォルト設定のバグを見つけたと思われる場合は、issue を作成できます。

Auth.js は厳密に仕様に準拠しており、プロバイダーによる仕様からのずれについて責任を負うことはできません。issue を作成できますが、問題が仕様への非準拠である場合、解決策を追求しない場合があります。ディスカッションでさらにサポートを依頼できます。

型パラメーター

型パラメーター
P extends NotionProfile

パラメーター

パラメーター
optionsOAuthUserConfig<P> & AdditionalConfig

戻り値

OAuthConfig<P>

Auth.js © Balázs Orbán and Team -2024