Readme

Get all the pages in a notion database

Usage

  1. Find your databaseId: https://developers.notion.com/reference/retrieve-a-database
  2. Get auth by setting up an internal integration: https://developers.notion.com/docs/authorization#internal-integration-auth-flow-set-up

Example usage: @stevekrouse.dateMeNotionDatabase

deno-notion-sdk docs: https://github.com/cloudydeno/deno-notion_sdk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
export const notionGetDatabase = async ({ databaseId, auth, filter }: {
databaseId: string;
auth: string;
filter?: any;
}) => {
const { Client, collectPaginatedAPI } = await import(
"https://deno.land/x/notion_sdk/src/mod.ts"
);
const notion = new Client({ auth });
return collectPaginatedAPI(notion.databases.query, {
database_id: databaseId,
filter,
});
};
👆 This is a val. Vals are TypeScript snippets of code, written in the browser and run on our servers. Create scheduled functions, email yourself, and persist small pieces of data — all from the browser.