-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
40 lines (33 loc) · 931 Bytes
/
index.js
File metadata and controls
40 lines (33 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { Client } from "@notionhq/client"
const notion = new Client({ auth: process.env.NOTION_KEY });
const databaseId = process.env.NOTION_DATABASE_ID;
console.log(notion);
console.log(databaseId);
// async function addItem(text) {
// try {
// const response = await notion.pages.create({
// parent: { database_id: databaseId },
// properties: {
// title: {
// title:[
// {
// "text": {
// "content": text
// }
// }
// ]
// }
// },
// })
// console.log(response)
// console.log("Success! Entry added.")
// } catch (error) {
// console.error(error.body)
// }
// }
// addItem("Yurts in Big Sur, California")
(async () => {
const pageId = 'a67e10931b53490782a1ab32750f8c7c';
const response = await notion.pages.retrieve({ page_id: pageId });
console.log(response);
})();