{"id":13433062,"url":"https://github.com/makenotion/notion-sdk-js","last_synced_at":"2026-04-21T01:04:01.630Z","repository":{"id":38176626,"uuid":"359022072","full_name":"makenotion/notion-sdk-js","owner":"makenotion","description":"Official Notion JavaScript Client","archived":false,"fork":false,"pushed_at":"2026-03-24T20:32:56.000Z","size":2887,"stargazers_count":5562,"open_issues_count":59,"forks_count":707,"subscribers_count":111,"default_branch":"main","last_synced_at":"2026-03-24T21:42:15.475Z","etag":null,"topics":["api","api-client","javascript","js","notion","typescript"],"latest_commit_sha":null,"homepage":"https://developers.notion.com/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/makenotion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-04-18T01:55:27.000Z","updated_at":"2026-03-24T20:33:00.000Z","dependencies_parsed_at":"2023-10-03T05:04:20.215Z","dependency_job_id":"e0e34a5e-3f17-41db-9f68-b2f418a4f8db","html_url":"https://github.com/makenotion/notion-sdk-js","commit_stats":{"total_commits":253,"total_committers":52,"mean_commits":4.865384615384615,"dds":0.841897233201581,"last_synced_commit":"ab293035afa3e76e264afc118193c6df00bb6933"},"previous_names":[],"tags_count":85,"template":false,"template_full_name":null,"purl":"pkg:github/makenotion/notion-sdk-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makenotion%2Fnotion-sdk-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makenotion%2Fnotion-sdk-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makenotion%2Fnotion-sdk-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makenotion%2Fnotion-sdk-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/makenotion","download_url":"https://codeload.github.com/makenotion/notion-sdk-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makenotion%2Fnotion-sdk-js/sbom","scorecard":{"id":613407,"data":{"date":"2025-08-11","repo":{"name":"github.com/makenotion/notion-sdk-js","commit":"a0adeb357b1d53edaeccc5725fdffe5b60789439"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.9,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":10,"reason":"24 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":10,"reason":"all changesets reviewed","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/makenotion/notion-sdk-js/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/makenotion/notion-sdk-js/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/semgrep.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/makenotion/notion-sdk-js/semgrep.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:27","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/semgrep.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T03:14:18.978Z","repository_id":38176626,"created_at":"2025-08-21T03:14:18.978Z","updated_at":"2025-08-21T03:14:18.978Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31290983,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-client","javascript","js","notion","typescript"],"created_at":"2024-07-31T02:01:20.492Z","updated_at":"2026-04-01T18:57:35.099Z","avatar_url":"https://github.com/makenotion.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","HarmonyOS","APIs"],"sub_categories":["Windows Manager"],"readme":"# Notion SDK for JavaScript\n\n\u003cimg alt=\"Notion Logo\" src=\"https://www.notion.so/images/notion-logo-block-main.svg\" width=\"70\" /\u003e\n\n**A simple and easy to use client for the [Notion API](https://developers.notion.com).**\n\n![Build status](https://github.com/makenotion/notion-sdk-js/actions/workflows/ci.yml/badge.svg)\n[![npm version](https://badge.fury.io/js/%40notionhq%2Fclient.svg)](https://www.npmjs.com/package/@notionhq/client)\n\n## Installation\n\n```bash\nnpm install @notionhq/client\n```\n\n[![Open Val Town Template](https://stevekrouse-badge.web.val.run/?3)](https://www.val.town/v/charmaine/NotionJsSDK)\n\n## Usage\n\n\u003e [!NOTE]\n\u003e Use Notion's [Getting Started Guide](https://developers.notion.com/docs/getting-started) to get set up to use Notion's API.\n\nImport and initialize a client using an **integration token** or an OAuth **access token**.\n\n```js\nconst { Client } = require(\"@notionhq/client\")\n\n// Initializing a client\nconst notion = new Client({\n  auth: process.env.NOTION_TOKEN,\n})\n```\n\nMake a request to any Notion API endpoint.\n\n```js\n;(async () =\u003e {\n  const listUsersResponse = await notion.users.list({})\n})()\n```\n\n\u003e [!NOTE]\n\u003e See the complete list of endpoints in the [API reference](https://developers.notion.com/reference).\n\nEach method returns a `Promise` that resolves the response.\n\n```js\nconsole.log(listUsersResponse)\n```\n\n```ts\n{\n  results: [\n    {\n      object: \"user\",\n      id: \"d40e767c-d7af-4b18-a86d-55c61f1e39a4\",\n      type: \"person\",\n      person: {\n        email: \"avo@example.org\",\n      },\n      name: \"Avocado Lovelace\",\n      avatar_url:\n        \"https://secure.notion-static.com/e6a352a8-8381-44d0-a1dc-9ed80e62b53d.jpg\",\n    },\n    // ...\n  ]\n}\n```\n\nEndpoint parameters are grouped into a single object. You don't need to remember which parameters go in the path, query, or body.\n\n```js\nconst myPage = await notion.dataSources.query({\n  data_source_id: \"897e5a76-ae52-4b48-9fdf-e71f5945d1af\",\n  filter: {\n    property: \"Landmark\",\n    rich_text: {\n      contains: \"Bridge\",\n    },\n  },\n})\n```\n\n### Handling errors\n\nIf the API returns an unsuccessful response, the returned `Promise` rejects with a `APIResponseError`.\n\nThe error contains properties from the response, and the most helpful is `code`. You can compare `code` to the values in the `APIErrorCode` object to avoid misspelling error codes.\n\n```js\nconst { Client, APIErrorCode } = require(\"@notionhq/client\")\n\ntry {\n  const notion = new Client({ auth: process.env.NOTION_TOKEN })\n  const myPage = await notion.dataSources.query({\n    data_source_id: dataSourceId,\n    filter: {\n      property: \"Landmark\",\n      rich_text: {\n        contains: \"Bridge\",\n      },\n    },\n  })\n} catch (error) {\n  if (error.code === APIErrorCode.ObjectNotFound) {\n    //\n    // For example: handle by asking the user to select a different data source\n    //\n  } else {\n    // Other error handling code\n    console.error(error)\n  }\n}\n```\n\n### Logging\n\nThe client emits useful information to a logger. By default, it only emits warnings and errors.\n\nIf you're debugging an application, and would like the client to log response bodies, set the `logLevel` option to `LogLevel.DEBUG`.\n\n```js\nconst { Client, LogLevel } = require(\"@notionhq/client\")\n\nconst notion = new Client({\n  auth: process.env.NOTION_TOKEN,\n  logLevel: LogLevel.DEBUG,\n})\n```\n\nYou may also set a custom `logger` to emit logs to a destination other than `stdout`. A custom logger is a function which is called with 3 parameters: `logLevel`, `message`, and `extraInfo`. The custom logger should not return a value.\n\n### Client options\n\nThe `Client` supports the following options on initialization. These options are all keys in the single constructor parameter.\n\n| Option      | Default value               | Type           | Description                                                                                                                                                  |\n| ----------- | --------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `auth`      | `undefined`                 | `string`       | Bearer token for authentication. If left undefined, the `auth` parameter should be set on each request.                                                      |\n| `logLevel`  | `LogLevel.WARN`             | `LogLevel`     | Verbosity of logs the instance will produce. By default, logs are written to `stdout`.                                                                       |\n| `timeoutMs` | `DEFAULT_TIMEOUT_MS`        | `number`       | Number of milliseconds to wait before emitting a `RequestTimeoutError`                                                                                       |\n| `baseUrl`   | `DEFAULT_BASE_URL`          | `string`       | The root URL for sending API requests. This can be changed to test with a mock server.                                                                       |\n| `logger`    | Log to console              | `Logger`       | A custom logging function. This function is only called when the client emits a log that is equal or greater severity than `logLevel`.                       |\n| `agent`     | Default node agent          | `http.Agent`   | Used to control creation of TCP sockets. A common use is to proxy requests with [`https-proxy-agent`](https://github.com/TooTallNate/node-https-proxy-agent) |\n| `retry`     | See [constants](#constants) | `RetryOptions` | Configuration for automatic retries on rate limits (429) and server errors (500, 503). See [Automatic retries](#automatic-retries) below.                    |\n\n### Automatic retries\n\nThe client automatically retries requests that fail due to rate limiting or transient server errors. By default, it will retry up to 2 times using exponential back-off with jitter.\n\n**Retryable errors:**\n\n- `rate_limited` (HTTP 429) - Too many requests; retried for all HTTP methods\n- `internal_server_error` (HTTP 500) - Server error; retried only for GET and DELETE\n- `service_unavailable` (HTTP 503) - Service temporarily unavailable; retried only for GET and DELETE\n\nServer errors (500, 503) are only retried for idempotent HTTP methods (GET, DELETE) to avoid duplicate side effects. Rate limits (429) are retried for all methods since the server explicitly asks clients to retry.\n\n**Retry behavior:**\n\n- Uses exponential back-off: delays increase with each retry attempt\n- Respects the `Retry-After` header when present (both delta-seconds and HTTP-date formats)\n- Adds random jitter to prevent thundering herd problems\n\n**Configuration:**\n\n```js\nconst notion = new Client({\n  auth: process.env.NOTION_TOKEN,\n  retry: {\n    maxRetries: 5, // Maximum retry attempts (default: 2)\n    initialRetryDelayMs: 500, // Initial delay between retries (default: 1000ms)\n    maxRetryDelayMs: 60000, // Maximum delay between retries (default: 60000ms)\n  },\n})\n```\n\nTo disable automatic retries:\n\n```js\nconst notion = new Client({\n  auth: process.env.NOTION_TOKEN,\n  retry: false,\n})\n```\n\n### Constants\n\nThe SDK exports named constants for all default values used by the client, as well as useful Notion-specific values. You can import them directly:\n\n```js\nconst {\n  DEFAULT_BASE_URL, // \"https://api.notion.com\"\n  DEFAULT_TIMEOUT_MS, // 60_000\n  DEFAULT_MAX_RETRIES, // 2\n  DEFAULT_INITIAL_RETRY_DELAY_MS, // 1_000\n  DEFAULT_MAX_RETRY_DELAY_MS, // 60_000\n  MIN_VIEW_COLUMN_WIDTH, // 32\n} = require(\"@notionhq/client\")\n```\n\n`MIN_VIEW_COLUMN_WIDTH` is the minimum width (in pixels) that a table column can have in the Notion UI. Set a property's `width` to this value when creating or updating a view to make a column appear collapsed -- useful for checkbox or status-as-checkbox columns:\n\n```js\nawait notion.views.create({\n  database_id: databaseId,\n  name: \"My view\",\n  type: \"table\",\n  configuration: {\n    table: {\n      properties: [\n        {\n          property_id: checkboxPropId,\n          visible: true,\n          width: MIN_VIEW_COLUMN_WIDTH,\n        },\n      ],\n    },\n  },\n})\n```\n\n### TypeScript\n\nThis package contains type definitions for all request parameters and responses,\nas well as some useful sub-objects from those entities.\n\nBecause errors in TypeScript start with type `any` or `unknown`, you should use\nthe `isNotionClientError` type guard to handle them in a type-safe way. Each\n`NotionClientError` type is uniquely identified by its `error.code`. Codes in\nthe `APIErrorCode` enum are returned from the server. Codes in the\n`ClientErrorCode` enum are produced on the client.\n\n```ts\ntry {\n  const response = await notion.dataSources.query({\n    /* ... */\n  })\n} catch (error: unknown) {\n  if (isNotionClientError(error)) {\n    // error is now strongly typed to NotionClientError\n    switch (error.code) {\n      case ClientErrorCode.RequestTimeout:\n        // ...\n        break\n      case APIErrorCode.ObjectNotFound:\n        // ...\n        break\n      case APIErrorCode.Unauthorized:\n        // ...\n        break\n      // ...\n      default:\n        // you could even take advantage of exhaustiveness checking\n        assertNever(error.code)\n    }\n  }\n}\n```\n\n#### Type guards\n\nThere are several [type guards](https://www.typescriptlang.org/docs/handbook/advanced-types.html#type-guards-and-differentiating-types)\nprovided to distinguish between full and partial API responses.\n\n| Type guard function      | Purpose                                                                                  |\n| ------------------------ | ---------------------------------------------------------------------------------------- |\n| `isFullPage`             | Determine whether an object is a full `PageObjectResponse`                               |\n| `isFullBlock`            | Determine whether an object is a full `BlockObjectResponse`                              |\n| `isFullDataSource`       | Determine whether an object is a full `DataSourceObjectResponse`                         |\n| `isFullPageOrDataSource` | Determine whether an object is a full `PageObjectResponse` or `DataSourceObjectResponse` |\n| `isFullUser`             | Determine whether an object is a full `UserObjectResponse`                               |\n| `isFullComment`          | Determine whether an object is a full `CommentObjectResponse`                            |\n\nHere is an example of using a type guard:\n\n```typescript\nconst fullOrPartialPages = await notion.dataSources.query({\n  data_source_id: \"897e5a76-ae52-4b48-9fdf-e71f5945d1af\",\n})\nfor (const page of fullOrPartialPages.results) {\n  if (!isFullPageOrDataSource(page)) {\n    continue\n  }\n  // The page variable has been narrowed from\n  //      PageObjectResponse | PartialPageObjectResponse | DataSourceObjectResponse | PartialDataSourceObjectResponse\n  // to\n  //      PageObjectResponse | DataSourceObjectResponse.\n  console.log(\"Created at:\", page.created_time)\n}\n```\n\n### Utility functions\n\nThis package also exports a few utility functions that are helpful for dealing with\nany of our paginated APIs.\n\n#### `iteratePaginatedAPI(listFn, firstPageArgs)`\n\nThis utility turns any paginated API into an async iterator.\n\n**Parameters:**\n\n- `listFn`: Any function on the Notion client that represents a paginated API (i.e. accepts\n  `start_cursor`.) Example: `notion.blocks.children.list`.\n- `firstPageArgs`: Arguments that should be passed to the API on the first and subsequent calls\n  to the API, for example a `block_id`.\n\n**Returns:**\n\nAn [async iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols)\nover results from the API.\n\n**Example:**\n\n```javascript\nfor await (const block of iteratePaginatedAPI(notion.blocks.children.list, {\n  block_id: parentBlockId,\n})) {\n  // Do something with block.\n}\n```\n\n#### `collectPaginatedAPI(listFn, firstPageArgs)`\n\nThis utility accepts the same arguments as `iteratePaginatedAPI`, but collects\nthe results into an in-memory array.\n\nBefore using this utility, check that the data you are dealing with is\nsmall enough to fit in memory.\n\n**Parameters:**\n\n- `listFn`: Any function on the Notion client that represents a paginated API (i.e. accepts\n  `start_cursor`.) Example: `notion.blocks.children.list`.\n- `firstPageArgs`: Arguments that should be passed to the API on the first and subsequent calls\n  to the API, for example a `block_id`.\n\n**Returns:**\n\nAn array with results from the API.\n\n**Example:**\n\n```javascript\nconst blocks = await collectPaginatedAPI(notion.blocks.children.list, {\n  block_id: parentBlockId,\n})\n// Do something with blocks.\n```\n\n### Custom requests\n\nTo make requests directly to a Notion API endpoint instead of using the pre-built families of methods, call the `request()` method. For example:\n\n```ts\n// POST /v1/comments\nconst response = await notion.request({\n  path: \"comments\",\n  method: \"post\",\n  body: {\n    parent: { page_id: \"5c6a28216bb14a7eb6e1c50111515c3d\" },\n    rich_text: [{ text: { content: \"Hello, world!\" } }],\n  },\n  // No `query` params in this example, only `body`.\n})\n\nconsole.log(JSON.stringify(response, null, 2))\n```\n\nThe `notion.request\u003cResponseBody\u003e({...})` method is generic; `ResponseBody` represents the expected type of response object Notion returns for the endpoint you're calling (we don't validate this at runtime; you can pass anything!)\n\n\u003e [!TIP]\n\u003e Usually, making custom requests with `notion.request()` isn't necessary, but can be helpful in some cases, e.g. when upgrading your [Notion API version](https://developers.notion.com/reference/versioning) incrementally before upgrading your SDK version. For example, if there's a new or renamed endpoint in the new API version that isn't yet available to call via a dedicated method on `Client`.\n\u003e\n\u003e In the above example, the simpler approach is to use `await notion.comments.create()`.\n\nAnother customization you can make is to pass your own `fetch` function to the `Client` constructor. This might be helpful for some execution environments where the default, built-in `fetch` isn't suitable.\n\n## Examples\n\nFor sample code and example projects, see [notion-cookbook](https://github.com/makenotion/notion-cookbook/tree/main/examples).\n\n## Requirements and compatibility\n\nThis package supports the following minimum versions:\n\n- Runtime: `node \u003e= 18`\n- Type definitions (optional): `typescript \u003e= 5.9`\n\nEarlier versions may still work, but we encourage people building new applications to upgrade to the current stable.\n\nIn some cases, due to backwards-incompatible changes across [Notion API versions](https://developers.notion.com/reference/versioning), more recent versions of this SDK don't work well with older API versions:\n\n| Version of JS/TS SDK | Minimum recommended API version |\n| -------------------- | ------------------------------- |\n| v4.0.0 and above     | 2022-06-28                      |\n| v5.0.0 and above     | 2025-09-03                      |\n\nThis SDK supports both `2025-09-03` and `2026-03-11` API versions. The default is `2025-09-03`. To use the newer version, pass it when constructing the client:\n\n```js\nconst notion = new Client({\n  auth: process.env.NOTION_TOKEN,\n  notionVersion: \"2026-03-11\",\n})\n```\n\nKey changes in `2026-03-11`:\n\n- **Block positioning**: The `after` parameter on `appendBlockChildren` is replaced by `position`, which supports `after_block`, `start`, and `end`.\n- **Trash status**: The `archived` field is replaced by `in_trash` on pages, blocks, databases, and data sources.\n- **Block type rename**: The `transcription` block type is renamed to `meeting_notes`.\n\nBoth the old and new field names are available in the SDK's TypeScript types for a smooth migration. Fields from the older version are marked `@deprecated`.\n\nIn these cases, we recommend upgrading your Notion API version header using the `Client()` constructor across all of your requests before upgrading to a newer version of the SDK.\n\n## Contributing\n\nWhile we value open-source contributions to this SDK, most of the client code is generated programmatically from the Notion API specification. Additions made directly to `src/api-endpoints.ts` or other generated code would be overwritten upon the next release.\n\nIf you'd like to contribute a feature or fix to the SDK's core functionality, we suggest opening an issue first to discuss it with us. This helps ensure your effort aligns with how the SDK is maintained.\n\nHowever, contributions to documentation (including this README), examples, and bug reports are always welcome and greatly appreciated!\n\n## Getting help\n\nIf you want to submit a feature request for Notion's API, or are experiencing any issues with the API platform, please email us at `developers@makenotion.com`.\n\nTo report issues with the SDK, it is possible to [submit an issue](https://github.com/makenotion/notion-sdk-js/issues) to this repo. However, we don't monitor these issues very closely. We recommend you reach out to us at `developers@makenotion.com` instead.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakenotion%2Fnotion-sdk-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmakenotion%2Fnotion-sdk-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakenotion%2Fnotion-sdk-js/lists"}