3// Initialize Notion client
4const notion = new Client({
5 auth: Deno.env.get("NOTION_API_KEY"),
6});
7
3// Initialize Notion client
4const notion = new Client({
5 auth: Deno.env.get("NOTION_API_KEY"),
6});
7
1export default async (c, next) => {
2 const method = c.req.method;
3 const secret = c.req.header("x-api-key"); // sent by Notion webhooks via POST
4 const fetchSite = c.req.header("sec-fetch-site");
5
6 // POSTs from Notion are automation webhooks that carry the x-api-key custom header
7 // that header needs to match the X_API_KEY environment variable in this project
8 // or this auth check won't pass
9 // for now we can just let GETs through without any auth shim
10 if (
11 (secret && secret !== Deno.env.get("X_API_KEY") || fetchSite && fetchSite !== "same-origin") && method !== "GET"
12 ) {
13 console.log(fetchSite);
11// Initialize Notion client
12export const notion = new Client({
13 auth: Deno.env.get("NOTION_API_KEY"),
14});
15
3// Initialize Notion client
4const notion = new Client({
5 auth: Deno.env.get("NOTION_API_KEY"),
6});
7
3// Initialize Notion client
4const notion = new Client({
5 auth: Deno.env.get("NOTION_API_KEY"),
6});
7
3// Initialize Notion client
4const notion = new Client({
5 auth: Deno.env.get("NOTION_API_KEY"),
6});
7
13 console.log(page.id);
14 // get the cobrowse value from the payload
15 // warning: properties in Notion are capitalized as a convention (see Cobrowse)
16 const cobrowse = (page.properties.Cobrowse.checkbox) ? false : true;
17 // save new cobrowse boolean to Notion page
3// Initialize Notion client
4const notion = new Client({
5 auth: Deno.env.get("NOTION_API_KEY"),
6});
7
3// Initialize Notion client
4const notion = new Client({
5 auth: Deno.env.get("NOTION_API_KEY"),
6});
7
How to: use Clay as if they have an API
Very incomplete collection of useful GitHub API adapters
Affordable & reliable alternative to Twitter API:
➡️ Access user profiles, tweets, followers & timeline data in real-time
➡️ Monitor profiles with nearly instant alerts for new tweets, follows & profile updates
➡️ Simple integration