Skip to content

TypeScript packages for Notion's unofficial API, data types, and related utilities.

License

Notifications You must be signed in to change notification settings

hirajanwin/notion

 
 

Repository files navigation

Notion + TypeScript

notion

TypeScript packages for Notion's unofficial API, data types, and related utilities.

NPM Build Status Prettier Code Formatting

Usage

import { NotionAPI } from 'notion-client'

const api = new NotionAPI()

// this will fetch all blocks for the given page as well as any collection data
// for collection views contained on the page
const page = await api.getPage('067dd719-a912-471e-a9a3-ac10710e7fdf')

// example of fetching the data for a specific collection instance
const collectionId = '2d8aec23-8281-4a94-9090-caaf823dd21a'
const collectionViewId = 'ab639a5a-853e-45e1-9ef7-133b486c0acf'
const colectionData = await api.getCollectionData(
  collectionId,
  collectionViewId
)

All examples use this public notion workspace which aims to cover 100% of Notion's public functionality.

Docs

Package NPM Docs Description
notion-client NPM docs TypeScript client for the unofficial Notion API.
notion-types NPM docs TypeScript types for core Notion data structures.
notion-utils NPM docs Useful utilities for working with Notion data.

Related

  • notion test suite - Comprehensive suite of public Notion pages to test individual features.
  • react-notion - React renderer for Notion data.
  • notion-api-worker - Notion API proxy exposed as a Cloudflare Worker.
    • Currently doesn't handle collection data very robustly.
  • notion-api-agent - Alternative Notion API client.

License

MIT © Travis Fischer

Support my OSS work by following me on twitter twitter

This project extends MIT-licensed work by Timo Lins, Tobias Lins, Sam Wight, and other contributors.

About

TypeScript packages for Notion's unofficial API, data types, and related utilities.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 98.2%
  • JavaScript 1.8%