@clerk/backend
3.29.0 · 14 Nov 2026MIT8.4M / weekRepositoryHomepagenpmAtom feed
Upgrading @clerk/backend From 3.17.2 to 3.31.4
29 releases in betweenevery note read
- 1
- change to make
- 0
- advisories fixed
- 20
- new
- 17
- fixes
Before you upgrade
Tick each one off as you go- Deprecated3.22.0
Release by release
- Fixed
Fix
debug()returning empty values on the auth object you get back when a request's token type doesn't matchacceptsToken. It now returns the same redacted debug data as the original auth object. - Fixed
authenticateRequest()now logs a warning whenacceptsTokenis set to an invalid value. A future major version will throw an error instead. - Fixed
Fix
auth().debug()in route handlers not redacting its data for requests authenticated with an M2M token, OAuth token or API key. Debug data is now redacted the same way as for session tokens.
- Fixed
3.31.1 – 3.31.33 releases, nothing new or fixed in the notes
- New
Add
transactional_email_blockedto theClerkPolicyreasons of theemail.suppressedwebhook event type. Clerk sends this reason when a queued transactional email is suppressed because sending was blocked for the instance. - New
Add an optional
secondFactorVerificationparameter ('fresh' | 'stale') tocreateSignInToken(), which lets a user with a second factor enabled complete the sign-in without being prompted for it.expiresInSecondsis now optional. - Fixed
users.getUserList()no longer waits for the user count when the page it lists already shows the total: a page with fewer users than itslimit, or no users at all. The count can be slow for a search over many users, and before this changegetUserList()failed whenever the count did. Both requests are still sent together, so a page that fills itslimittakes as long as before.
- New
- New
Add an experimental
clerkClient.oauthApplications.__experimental_exchangeToken()method for performing an OAuth 2.0 Token Exchange (RFC 8693) on behalf of an OAuth application. Pass your publishable key, the application's client ID and client secret, a user's OAuth access token, and the targetresourceto receive a new access token for that resource, for example to call a downstream API on a user's behalf. The request goes to your instance's token endpoint, derived from the publishable key (or fromproxyUrlwhen set), so it does not require a secret key. AproxyUrlmust be an absolute HTTPS URL without a query or fragment, including for loopback hosts. Token exchange requests do not follow redirects, so credentials and tokens are never forwarded to another endpoint; a redirect response throws anOAuthTokenExchangeErrorwith codeinvalid_response.
- New
- New
Fetch the Poppy JSON artifact with the Clerk-defined
clerkClient.artifacts.getPoppyJson()method. - New
Add support for Personal Agent Protocol signed-in browser sessions. Enable the Clerk-defined
poppy: trueoption onclerkMiddleware()to publish Poppy and OAuth protected resource discovery on the application domain. - New
Add
sessions.updateSession()to change when a single session expires, andusers.mergeUser()to merge one user into another. Theuser.mergedwebhook event is now part ofUserWebhookEvent, with a payload typed asUserMergedJSON. - New
Add
selfServeSsoEnabledandselfServeDirectorySyncEnabledto the parameters accepted byupdateOrganization().
- New
- New
JWTs without a
catheader are no longer accepted as session tokens:authenticateRequest()returns signed out (token-type-mismatch) andverifyToken()returnstoken-invalid. This includes OIDCid_tokens issued by Clerk. Tests that sign their own session tokens must addcat: 'cl_B7d4PD111AAA'to the header. - New
Add
startingAftertousers.getUserList()so applications can page through user lists with a cursor.
- New
- New
Add
DirectoryGroupWebhookEventandDirectoryGroupMembershipWebhookEventtoWebhookEvent, soverifyWebhook()narrows thedirectoryGroup.created,directoryGroup.updated,directoryGroup.synced,directoryGroup.deleted,directoryGroupMembership.createdanddirectoryGroupMembership.deletedevents that Directory Sync sends. Their payload types are exported asDirectoryGroupWebhookEventJSON,DirectoryGroupMembershipWebhookEventJSONandDeletedDirectoryGroupMembershipWebhookEventJSON.
- New
3.26.6nothing new or fixed in the note
28 internal lines (docs, tests, tooling) left out.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.