Created
August 18, 2022 14:38
-
-
Save bmorrisondev/c7890c0c6e5925c0510fa40837f3cecc to your computer and use it in GitHub Desktop.
Query Notion DB with JS
This file contains hidden or 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
const { Client } = require("@notionhq/client") | |
const notion = new Client({ | |
auth: "<NOTION_SECRET>", | |
notionVersion: "2022-02-22" | |
}) | |
;(async() => { | |
const res = await notion.databases.query({ | |
database_id: "<NOTION_DBID>" | |
}) | |
console.log(JSON.stringify(res)) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note the API version on line 5. Its part of the Options object passed into the constructor when creating a new client.