Skip to content

Commit d7a6f0e

Browse files
committed
docs(notion): highlight future implementations
1 parent 6b01ab4 commit d7a6f0e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/core/src/oauth/notion.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ export interface NotionProfile {
4040
* @see [Notion - Authentication](https://developers.notion.com/reference/authentication)
4141
* @see [Notion - Retrieve your token's bot user](https://developers.notion.com/reference/get-self)
4242
* @todo: It's required to pass the Notion-Version header to access the user info endpoint.
43+
* headers: { Notion-Version: "2022-06-28" }
44+
* @todo: It's required to add Basic headers for access token request.
45+
* headers: { Authorization: "Basic base64(client_id:client_secret)" }
4346
*/
4447
export const notion: OAuthProviderConfig<NotionProfile> = {
4548
id: "notion",
@@ -49,4 +52,12 @@ export const notion: OAuthProviderConfig<NotionProfile> = {
4952
userInfo: "https://api.notion.com/v1/users/me",
5053
scope: "user:read",
5154
responseType: "code",
55+
profile(profile) {
56+
return {
57+
sub: profile.id,
58+
name: profile.name,
59+
image: profile.avatar_url ?? "",
60+
email: profile?.bot?.owner?.user?.person?.email,
61+
}
62+
},
5263
}

0 commit comments

Comments
 (0)