{"_id":"@bullet-so/notion-client","_rev":"5-69a55fe2774e81920516f7479d677657","time":{"created":"2024-04-09T09:04:07.417Z","6.16.1":"2024-04-09T07:53:33.187Z","modified":"2024-04-09T09:12:45.583Z","6.16.3":"2024-04-09T08:34:07.033Z","6.16.5":"2024-04-09T09:04:07.628Z","6.16.6":"2024-04-09T09:09:15.942Z","6.16.7":"2024-04-09T09:12:45.384Z"},"name":"@bullet-so/notion-client","dist-tags":{"latest":"6.16.7"},"versions":{"6.16.5":{"name":"@bullet-so/notion-client","version":"6.16.5","type":"module","description":"Robust TypeScript client for the unofficial Notion 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":{"got":"^11.8.1","notion-types":"^6.16.0","notion-utils":"^6.16.1","p-map":"^7.0.2"},"ava":{"snapshotDir":".snapshots","extensions":{"ts":"module"},"nodeArguments":["--loader=ts-node/esm","--no-warnings","--experimental-specifier-resolution=node"]},"gitHead":"ad03dc30f15f4978f5e5c4b1ede66bf6194581c4","_id":"@bullet-so/notion-client@6.16.5","bugs":{"url":"https://github.com/NotionX/react-notion-x/issues"},"homepage":"https://github.com/NotionX/react-notion-x#readme","_nodeVersion":"21.7.1","_npmVersion":"10.5.0","dist":{"integrity":"sha512-EmtVb67YoyMP0vzHLL/qMLX9PGI6ln+a4hoZzrQTy3GYNxbtaKxm5rBKVuHN+dpf9vyesMxSevN5sDUmQn/ILA==","shasum":"b8c618ac1b9f4a7f62b9da1eee9f2c95ae0a9f8c","tarball":"https://registry.npmjs.org/@bullet-so/notion-client/-/notion-client-6.16.5.tgz","fileCount":13,"unpackedSize":93905,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCa1p8xhFUsI8L+eE4SV+LrMKRs5KBgWLp6TNFBqzlbSQIhAOpRx0fYTzQ7ftuazXi90+dUSkMz+h525SrdLNQrd4RO"}]},"_npmUser":{"name":"amaravindhan","email":"aravindhansundram13@gmail.com"},"directories":{},"maintainers":[{"name":"amaravindhan","email":"aravindhansundram13@gmail.com"},{"name":"aswin-bullet","email":"aswin@bullet.so"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/notion-client_6.16.5_1712653447487_0.5850126091292922"},"_hasShrinkwrap":false},"6.16.6":{"name":"@bullet-so/notion-client","version":"6.16.6","type":"module","description":"Robust TypeScript client for the unofficial Notion API.","repository":{"type":"git","url":"git+https://github.com/bullet-so/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":{"got":"^11.8.1","notion-types":"^6.16.0","notion-utils":"^6.16.1","p-map":"^7.0.2"},"ava":{"snapshotDir":".snapshots","extensions":{"ts":"module"},"nodeArguments":["--loader=ts-node/esm","--no-warnings","--experimental-specifier-resolution=node"]},"gitHead":"7ba93e10fde619ee80eab3fdef817d471e301945","bugs":{"url":"https://github.com/bullet-so/react-notion-x/issues"},"homepage":"https://github.com/bullet-so/react-notion-x#readme","_id":"@bullet-so/notion-client@6.16.6","_nodeVersion":"21.7.1","_npmVersion":"lerna/4.0.0/node@v21.7.1+arm64 (darwin)","dist":{"integrity":"sha512-Hpk5wdFay5mrJrOk6lQhQTFvH9iqpc0W+pnSr+C8mKJJusP+JK9rJjk1aaHpdHNv7v1YDWq+kPSnOXF9SVB/KA==","shasum":"7c71a1d477e231eb6fef6ae175378176303a63cc","tarball":"https://registry.npmjs.org/@bullet-so/notion-client/-/notion-client-6.16.6.tgz","fileCount":14,"unpackedSize":94978,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCsb8nnGqZ46SwGbqXQVXmeoPLw73S4mt04qBImya2YQIhAOOYcS0ZcsPlckKeDxJ/cWsXuEhadiIpxthXKNyPNdbV"}]},"_npmUser":{"name":"amaravindhan","email":"aravindhansundram13@gmail.com"},"directories":{},"maintainers":[{"name":"amaravindhan","email":"aravindhansundram13@gmail.com"},{"name":"aswin-bullet","email":"aswin@bullet.so"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/notion-client_6.16.6_1712653755786_0.12462974358513046"},"_hasShrinkwrap":false},"6.16.7":{"name":"@bullet-so/notion-client","version":"6.16.7","type":"module","description":"Robust TypeScript client for the unofficial Notion API.","repository":{"type":"git","url":"git+https://github.com/bullet-so/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":{"got":"^11.8.1","notion-types":"^6.16.0","notion-utils":"^6.16.0","p-map":"^7.0.2"},"ava":{"snapshotDir":".snapshots","extensions":{"ts":"module"},"nodeArguments":["--loader=ts-node/esm","--no-warnings","--experimental-specifier-resolution=node"]},"gitHead":"e8822bd5ce4fc3167d3cb3b87db38b3af35e0c64","bugs":{"url":"https://github.com/bullet-so/react-notion-x/issues"},"homepage":"https://github.com/bullet-so/react-notion-x#readme","_id":"@bullet-so/notion-client@6.16.7","_nodeVersion":"21.7.1","_npmVersion":"lerna/4.0.0/node@v21.7.1+arm64 (darwin)","dist":{"integrity":"sha512-RekLNjffn8PXW3LglhT+paqxDuBRDGBmcFjqxrEnsCVt7Pfm3NfL6CGyLPcGRj0BucLk+nkmMMYtpD12zoFcpg==","shasum":"358c14076eaf9d0ff488a806e1f2969847143cc8","tarball":"https://registry.npmjs.org/@bullet-so/notion-client/-/notion-client-6.16.7.tgz","fileCount":14,"unpackedSize":94978,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDG8a2a5cUK0D7NAt9K0XVNiC55zP9rSUmSLTXHgRi83AiEAhqRwp3UVbQ/Kl8ZIygIcoM8DA38qxM+g+vbGjztVoAE="}]},"_npmUser":{"name":"amaravindhan","email":"aravindhansundram13@gmail.com"},"directories":{},"maintainers":[{"name":"amaravindhan","email":"aravindhansundram13@gmail.com"},{"name":"aswin-bullet","email":"aswin@bullet.so"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/notion-client_6.16.7_1712653965166_0.9955906970877333"},"_hasShrinkwrap":false}},"maintainers":[{"name":"amaravindhan","email":"aravindhansundram13@gmail.com"},{"name":"aswin-bullet","email":"aswin@bullet.so"}],"description":"Robust TypeScript client for the unofficial Notion API.","homepage":"https://github.com/bullet-so/react-notion-x#readme","repository":{"type":"git","url":"git+https://github.com/bullet-so/react-notion-x.git"},"author":{"name":"Travis Fischer","email":"travis@transitivebullsh.it"},"bugs":{"url":"https://github.com/bullet-so/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-client\n\n> Robust TypeScript client for the unofficial Notion API.\n\n[![NPM](https://img.shields.io/npm/v/notion-client.svg)](https://www.npmjs.com/package/notion-client) [![Build Status](https://github.com/NotionX/react-notion-x/actions/workflows/test.yml/badge.svg)](https://github.com/NotionX/react-notion-x/actions/workflows/test.yml) [![Prettier Code Formatting](https://img.shields.io/badge/code_style-prettier-brightgreen.svg)](https://prettier.io)\n\n## Install\n\n```bash\nnpm install notion-client\n```\n\nThis package is compatible with server-side V8 contexts such as Node.js, Deno, and Cloudflare Workers.\n\n## Usage\n\n```ts\nimport { NotionAPI } from 'notion-client'\n\n// you can optionally pass an authToken to access private notion resources\nconst api = new NotionAPI()\n\n// fetch a page's content, including all async blocks, collection queries, and signed urls\nconst page = await api.getPage('067dd719-a912-471e-a9a3-ac10710e7fdf')\n\n// fetch the data for a specific collection instance\nconst collectionId = '2d8aec23-8281-4a94-9090-caaf823dd21a'\nconst collectionViewId = 'ab639a5a-853e-45e1-9ef7-133b486c0acf'\nconst collectionData = await api.getCollectionData(\n  collectionId,\n  collectionViewId\n)\n```\n\n### Fetch a database's content\n\nYou can pass a database ID to the `getPage` method. The response is an object which contains several important properties:\n\n- `block`\n- `collection`\n- `collection_view`\n\nThe value of the `block` property maps the id of each block object present in the database to its corresponding properties like type, parent id, created time, last edited by, and more. \n\n```\n{\n  block: {\n    'cc368b47-772a-4a1a-a36e-1f52c507d20d': { role: 'reader', value: [Object] },\n    '97dbe6d5-aea3-4e03-b571-91810cf975d4': { role: 'reader', value: [Object] },\n    '08d5ba1e-03d2-4d4a-add7-a414f297ff8a': { role: 'reader', value: [Object] },\n    '7aad4627-c4af-4314-960e-1465e76cc6bd': { role: 'reader', value: [Object] },\n    '7be73360-19b9-4b77-a518-70acd610d492': { role: 'reader', value: [Object] },\n    'af961803-cd0c-470e-bd27-1d025baa2f95': { role: 'reader', value: [Object] },\n    // ...\n  }\n}\n```\n\nThe map of blocks is arranged as followed:\n\n- The first id is of the collection view\n- The second is of the parent page that contains the database in question\n- The next ids are of all the children pages inside the database\n- After that comes all the children blocks of each page.\n\n\nPlease note that a block object can take many types: header, text, list, media, and almost any block supported by Notion. It can also be *a page* or a *collection view*.\n\nExample of a block object of type `text`:\n\n```\n{\n  role: 'reader',\n  value: {\n    id: '0377e1a4-dc3d-4daf-99dd-f54f986d932e',\n    version: 1,\n    type: 'text',\n    properties: { title: [Array] },\n    format: { copied_from_pointer: [Object] },\n    created_time: 1655961814278,\n    last_edited_time: 1655961814278,\n    parent_id: '08d5ba1e-03d2-4d4a-add7-a414f297ff8a',\n    parent_table: 'block',\n    alive: true,\n    copied_from: '526d2008-0d0b-46f8-9de1-7411a85bff7b',\n    created_by_table: 'notion_user',\n    created_by_id: '55b29a2b-a8fe-4a11-9f9d-ada341bd922b',\n    last_edited_by_table: 'notion_user',\n    last_edited_by_id: '55b29a2b-a8fe-4a11-9f9d-ada341bd922b',\n    space_id: '6b70425f-211e-4318-80c6-5d093df8f7eb'\n  }\n}\n```\n\nExample of a block object of type `page`:\n\n```\n{\n  role: 'reader',\n  value: {\n    id: 'af961803-cd0c-470e-bd27-1d025baa2f95',\n    version: 31,\n    type: 'page',\n    properties: { '==~K': [Array], 'BN]P': [Array], title: [Array] },\n    content: [\n      '8cbf7053-da37-4d69-8cde-89343baf3623',\n      '0fc1712e-852c-4307-b72b-094dadaa86ba'\n    ],\n    created_time: 1655962200000,\n    last_edited_time: 1655979420000,\n    parent_id: '175482e5-870d-4da8-980c-ead469427316',\n    parent_table: 'collection',\n    alive: true,\n    created_by_table: 'notion_user',\n    created_by_id: '55b29a2b-a8fe-4a11-9f9d-ada341bd922b',\n    last_edited_by_table: 'notion_user',\n    last_edited_by_id: '55b29a2b-a8fe-4a11-9f9d-ada341bd922b',\n    space_id: '6b70425f-211e-4318-80c6-5d093df8f7eb'\n  }\n}\n```\n\nExample of a block object of type `collection_view`:\n```\n{\n  role: 'reader',\n  value: {\n    id: 'cc368b47-772a-4a1a-a36e-1f52c507d20d',\n    version: 5,\n    type: 'collection_view',\n    view_ids: [\n      '028f6968-2a6c-46da-bf43-cb44e6d91765',\n      '77f32047-52dd-422e-93fa-813438087e57'\n    ],\n    collection_id: '175482e5-870d-4da8-980c-ead469427316',\n    format: { collection_pointer: [Object], copied_from_pointer: [Object] },\n    created_time: 1655961814276,\n    last_edited_time: 1656075900000,\n    parent_id: '97dbe6d5-aea3-4e03-b571-91810cf975d4',\n    parent_table: 'block',\n    alive: true,\n    copied_from: '3e3073e9-7aee-481c-b831-765e112ec7b5',\n    created_by_table: 'notion_user',\n    created_by_id: '55b29a2b-a8fe-4a11-9f9d-ada341bd922b',\n    last_edited_by_table: 'notion_user',\n    last_edited_by_id: '55b29a2b-a8fe-4a11-9f9d-ada341bd922b',\n    space_id: '6b70425f-211e-4318-80c6-5d093df8f7eb'\n  }\n}\n```\n\n## Docs\n\nSee the [full docs](https://github.com/NotionX/react-notion-x).\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"}