npm @notionhq/client 5.34.0
v5.34.0

one hour ago

What’s changed

This release adds oauth.exchangeToken, so a scheduled job can replace an internal connection’s API token before it expires. Read Rotate an internal connection’s API token to set it up.

New capabilities

  • oauth.exchangeToken (#853)
    • Trades the connection’s current token (subject_token) for a new one with the token exchange grant. The SDK signs the client assertion with your private_key, so you don’t build a JWT yourself.
    • private_key is a PKCS #8 PEM string. EC keys must use P-256 and sign with ES256; RSA keys sign with RS256. Pass key_id to pick a signing key, or leave it out and Notion tries each of the connection’s keys.
    • Signing uses the Web Crypto API built into Node.js 22 and later. It adds no dependencies.
    • New types: OauthExchangeTokenParameters and OauthExchangeTokenResponse.
  • missing_properties on pages.move (#850)
    • pages.move types the optional missing_properties body field ("add" or "omit"). With "omit", moving a page into a data source doesn’t add the source’s unmatched properties to its schema.

Compatibility

  • oauth.token, OauthTokenParameters, and OauthTokenResponse are unchanged. The token exchange grant has its own method because oauth.token sends Basic auth, which Notion refuses on that grant.

Links

Don't miss a new client release

NewReleases is sending notifications on new releases.