{"_id":"@billq/notion-compat","name":"@billq/notion-compat","dist-tags":{"latest":"6.16.1"},"versions":{"6.16.1":{"name":"@billq/notion-compat","version":"6.16.1","type":"module","description":"Compatibility layer between the official Notion API and unofficial private API.","repository":{"type":"git","url":"git+https://github.com/NotionX/react-notion-x.git"},"author":{"name":"Travis Fischer","email":"travis@transitivebullsh.it"},"license":"MIT","main":"./build/index.js","module":"./build/index.js","types":"./build/index.d.ts","sideEffects":false,"engines":{"node":">=12"},"scripts":{"build":"tsup","watch":"tsup --watch --silent --onSuccess 'echo build successful'","test":"ava"},"dependencies":{"notion-types":"^6.16.0","notion-utils":"^6.16.0","p-queue":"^7.2.0"},"devDependencies":{"@notionhq/client":"^1.0.4","notion-client":"^6.16.0"},"peerDependencies":{"@notionhq/client":"^1.0.4"},"ava":{"snapshotDir":".snapshots","extensions":{"ts":"module"},"nodeArguments":["--loader=ts-node/esm","--no-warnings","--experimental-specifier-resolution=node"]},"gitHead":"c07044efbe3fcbdd9ac08815761cf05f4facbcf5","bugs":{"url":"https://github.com/NotionX/react-notion-x/issues"},"homepage":"https://github.com/NotionX/react-notion-x#readme","_id":"@billq/notion-compat@6.16.1","_nodeVersion":"18.14.2","_npmVersion":"9.5.0","dist":{"integrity":"sha512-2LgxZaLhrUmLGMoK7vzCSVecAMJt1Krd9avvhaGUGOf5aa0YRnx7KltDYsUmww5AiaZcR8AXUkULDh4Ia5AIHQ==","shasum":"e1d0dde3be0e158ac1e8dbd66fa987c37d7f7d1a","tarball":"https://registry.npmjs.org/@billq/notion-compat/-/notion-compat-6.16.1.tgz","fileCount":4,"unpackedSize":64386,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYFibJyfWDdECneecF146Wq7NtBX00KwpkuqDeALuhDwIhAKqLiV27IbiHsftPEceOZvKWn4EhwCzGYFIgL550iKOE"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkGGa+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrQBw//eN9fF20FKLTW9mefzc0tF0K4R3iL3TrTEG5PX/ROYvu2B0kd\r\nhZTWWGcTcbwOFh7u4J7gcYk9n0os0VV70hNZHwGmLxJGmHwHSDCOSU41triC\r\ng9dyJtj4FDqr2gTwQz39Aq/rXhvqPDFSP6yF8tqv6tWqkLiFeSTblYyru+sI\r\nlKkmo2wae4JFxkAac8vd9UEDa/dcYITWKGaPBBPGR5eSdyX705Bj+8LCec6+\r\nvWR0+Xta3o1Pl5TFlZKMlDoap+cpD0qkyKVgoDNpqt9JuqdePcESu49W576X\r\n82oY2lVz/MjtyUzDMK0a02FTdtSI9xWLSLeXqsN5MeWARiQ5XrdJ4eNW1A6s\r\nPTb+71gbB6FRxVjTJOB0IGTbR9Ms2nCKvMUvAbCBwAH6litDCP3JaMwYd5C7\r\nYi77ruju3q0OabyM4LySnMrTORWRWzEz04rbwrWeSVLffjF0y6VM8IdrAZrc\r\nvKpn6Pqj68a7/uULOzGRZH173RbR+q0oGXFHa8LaaIq4N4fvoTP/DvaRFCi9\r\nGY/YGTcWYY6YLi5kiyg/cp7r0Tf2foLu8QTG1k+Zw+U7Iy7xCQx4IGRSfC42\r\nmQzKKg+Vmjx10mb4FMFuOcDf+RUKr86SkZ9J7Bq4paocxU4Z6Vi5A/zgpEHU\r\nr2IOwVAwUmV5De59/0cDqXEM7dZbV2aKrhA=\r\n=Wqxv\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"bill_q","email":"fanglaiq@gmail.com"},"directories":{},"maintainers":[{"name":"bill_q","email":"fanglaiq@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/notion-compat_6.16.1_1679320765881_0.9960055670750092"},"_hasShrinkwrap":false}},"time":{"created":"2023-03-20T13:59:25.756Z","6.16.1":"2023-03-20T13:59:26.068Z","modified":"2023-03-20T13:59:26.327Z"},"maintainers":[{"name":"bill_q","email":"fanglaiq@gmail.com"}],"description":"Compatibility layer between the official Notion API and unofficial private API.","homepage":"https://github.com/NotionX/react-notion-x#readme","repository":{"type":"git","url":"git+https://github.com/NotionX/react-notion-x.git"},"author":{"name":"Travis Fischer","email":"travis@transitivebullsh.it"},"bugs":{"url":"https://github.com/NotionX/react-notion-x/issues"},"license":"MIT","readme":"<p align=\"center\">\n  <img alt=\"React Notion X\" src=\"https://raw.githubusercontent.com/NotionX/react-notion-x/master/media/notion-ts.png\" width=\"689\">\n</p>\n\n# notion-compat\n\n> A compatibility layer between the official Notion API and the unofficial Notion API\n\n## Features\n\n- fully compatible with `react-notion-x`\n- backwards compatible with `notion-client` and the unofficial notion API\n\n## Usage\n\n```ts\nimport { Client } from '@notionhq/client'\nimport { NotionCompatAPI } from 'notion-compat'\n\nconst notion = new NotionCompatAPI(\n  new Client({ auth: process.env.NOTION_TOKEN })\n)\n\nconst recordMap = await notion.getPage(pageId)\n```\n\nThe resulting `recordMap` is compatible with notion's unofficial API and react-notion-x.\n\n## Demo\n\nYou can preview `react-notion-x` using the official client and compatibility layer here: https://react-notion-x-official-api-demo.transitivebullsh.it/\n\n## Status\n\nCurrently, ~20 blocks have full compatibility and 8 have partial compatibility (sometimes in subtle ways) due Notion's official API not returning enough info for us to faithfully render them in all cases. See the block-by-block compatibility notes below for more info.\n\nI recommend checking out [the notion-compat demo](https://react-notion-x-official-api-demo.transitivebullsh.it/) side-by-side with the [normal react-notion-x demo](https://react-notion-x-demo.transitivebullsh.it/) (which uses the unofficial Notion API via `notion-client`) and the [equivalent public notion page](https://transitive-bs.notion.site/Notion-Kit-Test-Suite-067dd719a912471ea9a3ac10710e7fdf).\n\nNote that using the official API with `notion-compat` is **significantly slower** than using the unofficial API via `notion-client` because of [reasons](https://github.com/NotionX/react-notion-x/issues/269#issuecomment-1100648873).\n\nThe main feature missing from `notion-compat` right now is collection (database) support. PRs welcome 😃\n\n## Block Compatibility\n\n### Summary of Known Issues 🔴\n\n- image, video, and embed blocks are missing `format` for proper sizing and layout\n  - 3492bd6dbaf44fe7a5cac62c5d402f06\n  - 5d4e290ca4604d8fb809af806a6c1749\n- image, video, and embed blocks are missing `caption`\n  - 912379b0c54440a286619f76446cd753\n- embed blocks don't contain enough info for proper embedding\n  - have to write custom embedding logic for iframe urls\n  - same with some video blocks\n  - 5d4e290ca4604d8fb809af806a6c1749\n- `alias` blocks fail for links pointing to other workspaces\n  - this happens even if the linked page is publicly readable\n  - 034119d20132420abe8e9863bbe91e9d\n- rich text mentions fail for links to pages and databases in other workspaces\n  - if API integration doesn't have access to the workspace\n  - this happens even if the linked page is publicly readable\n  - 52353862df0f48ba85648db7d0acd1dd\n- format `toggleable` is missing\n  - no toggle headers\n  - 5995506f2c564d81956aa38711e12337\n\n### Blocks with Full Compatibility 🟢\n\n- paragraph (`text` block)\n- heading_1 (`header` block)\n- heading_2 (`sub_header` block)\n- heading_3 (`sub_sub_header` block)\n- bulleted_list_item (`bulleted_list` block)\n- numbered_list_item (`numbered_list` block)\n- quote\n- to_do\n- toggle\n- code\n- callout\n- file\n- divider\n- table_of_contents\n- column_list\n- column\n- equation (block and inline)\n- synced_block (`transclusion_container` and `transclusion_reference`)\n- audio\n- tweet\n\n### Blocks with Partial Compatibility 🟡\n\n- bookmark\n  - images and content are missing\n  - 0be6efce9daf42688f65c76b89f8eb27\n- image\n  - missing caption\n  - missing format so sizing and layout aren't always handled properly\n  - 912379b0c54440a286619f76446cd753\n- video\n  - missing caption\n  - missing format so sizing and layout aren't always handled properly\n  - missing embedding logic in some cases (original URL must be transformed for embedding in many cases)\n  - 5d4e290ca4604d8fb809af806a6c1749\n- embed\n  - missing caption\n  - missing format so sizing and layout aren't always handled properly\n  - missing embedding logic\n    - original URL must be transformed for embedding in many cases\n    - missing embeding display size hints from embedly\n  - 5d4e290ca4604d8fb809af806a6c1749\n  - this goes for custom embed blocks as well\n    - maps\n    - figma\n    - typeform\n    - codepen\n    - excalidraw\n    - gist\n    - loom\n    - drive\n    - ...\n- child_page (`page` block)\n  - page format missing entirely\n  - no full width, fonts, font size, etc\n    - 72c5d33ca46642feaee06852cc57c588\n    - 3702a5d6403d4d58b8a944a77ca26c70\n  - page cover missing `page_cover_position`\n    - 067dd719a912471ea9a3ac10710e7fdf\n- link_to_page (`alias` block)\n  - missing for links pointing to other workspaces, even if they're publicly readable\n  - 034119d20132420abe8e9863bbe91e9d\n- pdf\n  - missing format so sizing and layout aren't handled properly\n- table and table_row (simple table blocks)\n  - missing some formatting info\n\n### Blocks that are WIP 🚧\n\n- child_database (`collection_view` and `collection_view_page` blocks)\n\n### Blocks that are Not Supported 🔴\n\n- external_object_instance\n\n### Blocks that I'm not sure how to handle\n\n- breadcrumb\n- template\n- unsupported\n\n## License\n\nMIT © [Travis Fischer](https://transitivebullsh.it)\n\nSupport my OSS work by <a href=\"https://twitter.com/transitive_bs\">following me on twitter <img src=\"https://storage.googleapis.com/saasify-assets/twitter-logo.svg\" alt=\"twitter\" height=\"24px\" align=\"center\"></a>\n","readmeFilename":"readme.md"}