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
import process from "node:process";
export async function addItem(interval: Interval) {
const { Client } = await import("https://deno.land/x/notion_sdk/src/mod.ts");
const notion = new Client({ auth: process.env.Notion });
const databaseId = "f9c2a3bda35e421e93d8af42ef0a15f9";
try {
const response = await notion.pages.create({
parent: { database_id: databaseId },
properties: {
title: {
title: [
{
"text": {
"content": `Hi`,
},
},
],
},
},
});
return "Success";
}
catch (e) {
return `An error ocurred: ${e}!`;
}
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 23, 2023