mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 15:09:22 +00:00
feat&fix(支持私有页面的数据访问): 使用react-notion-x要求的方式进行NotionAPI的配置
(cherry picked from commit d5ae329e2c3a1e18b5fd5fc3507791be9da9b4ed)
This commit is contained in:
10
lib/notion/getNotionAPI.js
Normal file
10
lib/notion/getNotionAPI.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import { NotionAPI } from 'notion-client'
|
||||
import BLOG from '@/blog.config'
|
||||
|
||||
export default function getNotionAPI() {
|
||||
return new NotionAPI({
|
||||
activeUser: BLOG.NOTION_ACTIVE_USER || null,
|
||||
authToken: BLOG.NOTION_TOKEN_V2 || null,
|
||||
userTimeZone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user