providers/notion
NotionProfile
扩展
Record<string,any>
属性
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;拥有者
属性
类型
type: string;用户
user: User;人员
扩展
Record<string,any>
属性
电子邮件
email: string;用户
扩展
Record<string,any>
属性
avatar_url
avatar_url: null | string;id
id: string;名称
name: string;对象
object: "user" | "bot";owner?
optional owner: {
type: "user" | "workspace";
workspace: string;
};类型
type: "user" | "workspace";工作区
workspace: string;人员
person: Person;类型
type: string;workspace_name?
optional workspace_name: null | string;默认值()
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_id 和 oauth_secret。私有集成不提供这些详细信息。您必须提供 clientId 和 clientSecret 来使用此提供商,以及重定向 URI(因为这是 Notion 端点获取令牌所需的)。
💡
Notion 提供商附带了 默认配置。要覆盖您的用例的默认值,请查看 自定义内置 OAuth 提供商.
类型参数
| 类型参数 |
|---|
P extends NotionProfile |
参数
| 参数 | 类型 |
|---|---|
选项 | OAuthUserConfig<P> & AdditionalConfig |
返回值
OAuthConfig<P>