@mountnotion/sdk
TypeScript icon, indicating that this package has built-in type declarations

2.0.16 • Public • Published

@mountnotion/sdk

install

# npm
npm i -S @mountnotion/sdk

# yarn
yarn add @mountnotion/sdk

overview

summary
notion api responses are EXTREMELY deeply nested. sdk provides simple flattening of notion responses and simple expansion of properties. beyond that, it exports a wrapper around the notion api for easy configuration.

example usage

import {
  flattenPageResponse,
  expandProperties,
  notion,
} from '@mountnotion/sdk';

const page = await notion.pages.retrieve({
  page_id,
});

const [person, PROPERTIES] = flattenPageResponse<People>(page);

const properties = expandProperties<People>(person, {
  properties: PROPERTIES,
});

const updatedPerson = await notion.pages.update(
  {
    page_id,
    properties,
  },
  { flattenResponse: true }
);

Readme

Keywords

none

Package Sidebar

Install

npm i @mountnotion/sdk

Weekly Downloads

38

Version

2.0.16

License

BSL-1.1

Unpacked Size

277 kB

Total Files

437

Last publish

Collaborators

  • peterbsmyth