tools for mounting notion
``bashnpm
npm i -S @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.
$3
`typescript
import {
flattenPageResponse,
expandProperties,
notion,
} from '@mountnotion/sdk';const page = await notion.pages.retrieve({
page_id,
});
const [person, PROPERTIES] = flattenPageResponse(page);
const properties = expandProperties(person, {
properties: PROPERTIES,
});
const updatedPerson = await notion.pages.update(
{
page_id,
properties,
},
{ flattenResponse: true }
);
``