-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnotion.js
45 lines (41 loc) · 1.05 KB
/
notion.js
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
40
41
42
43
44
45
const { Client } = require("@notionhq/client")
require("dotenv").config();
const notion = new Client({ auth: process.env.NOTION_API_KEY })
// async function getDatabase() {
// try {
// const response = await notion.databases.query({
// database_id: databaseId,
// filter: {
// and: [
// {
// property: 'Status',
// select: {
// is_not_empty: true,
// },
// },
// {
// property: 'Status',
// select: {
// does_not_equal: 'Completed',
// },
// },
// ],
// },
// sorts: [
// {
// property: 'Priority',
// direction: 'descending',
// },
// {
// property: 'Status',
// direction: 'descending',
// },
// ],
// });
// console.log(response);
// } catch (error) {
// console.error(error.body)
// }
// }
// getDatabase()
module.exports=notion;