forked from craigary/nobelium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
64307a3
commit 90c7e5e
Showing
4 changed files
with
11 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { NotionAPI } from 'notion-client' | ||
import api from '@/lib/server/notion-api' | ||
|
||
export async function getPostBlocks (id) { | ||
const authToken = process.env.NOTION_ACCESS_TOKEN || null | ||
const api = new NotionAPI({ authToken }) | ||
const pageBlock = await api.getPage(id) | ||
return pageBlock | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { NotionAPI } from 'notion-client' | ||
|
||
const { NOTION_ACCESS_TOKEN } = process.env | ||
|
||
const client = new NotionAPI({ authToken: NOTION_ACCESS_TOKEN }) | ||
|
||
export default client |