What's Changed
New capabilities
-
Webhook signature verification helpers (#722)
- Adds
verifyWebhookSignature()(andsignWebhookPayload()for tests) so you can confirm a webhook actually came from Notion instead of hand-rolling HMAC-SHA256. - If you receive Notion webhooks: switch to this helper. Pass the raw request body (not re-serialized JSON) plus the
X-Notion-Signatureheader. Works out of the box in Node 18+, Bun, Deno, Cloudflare Workers, Vercel Edge, and browsers.
- Adds
-
iterateAllDataSourceRows/collectAllDataSourceRowshelpers (#730, #731)- A single
dataSources.querycaps out at ~10,000 rows and then silently stops — plain pagination misses the rest of a large data source. These helpers page past that cap by partitioning oncreated_time, de-duping rows automatically. - If you query large data sources: use these instead of manual pagination to guarantee you see every row. (#731 also fixes window advancement for wiki data sources that return child data-source rows, not just pages.)
- A single
-
client.asyncTasks.retrieve(#736)- Adds support for the newly documented async task endpoint, so you can poll long-running operations to completion.
-
allow_asynconcreatePageand update-page-markdown (#728, #729)- Lets these endpoints return an async task for large/slow writes instead of blocking the request.
- If you create pages or update markdown at scale: opt in with
allow_async, then poll the returned task viaclient.asyncTasks.retrieve(#736).
Reliability
- Retry on
service_overload(HTTP 529) (#727)- The client now automatically retries 529s (respecting
retry-after) alongside existing 429/500/503 handling — fewer transient failures surface to your code. No action needed; thanks @RyanBillard.
- The client now automatically retries 529s (respecting
Type & bug fixes
-
relevancesearch sort now uses thepropertydiscriminator (#724)- Fixes the type for the
relevancesort variant in search parameters. If you sort search results by relevance and hit a type error, this is the fix — align your call with the corrected shape.
- Fixes the type for the
-
Allow
nullforstart_cursorin pagination types (#723)- Pagination params now accept
null(not juststring/undefined), so you can pass anext_cursorstraight through without a null-check dance.
- Pagination params now accept
-
Bump version to v5.23.0 (#741)
New Contributors
- @RyanBillard made their first contribution in #727
Links
- Full Changelog: v5.22.0...v5.23.0
- NPM Package: https://www.npmjs.com/package/@notionhq/client/v/5.23.0