Packages

@clerk/backend

3.29.0 · 14 Nov 2026MIT8.4M / weekRepositoryHomepagenpmAtom feed

Your version

3.30.0

17 Nov 2026Where it was published

3.31.4 is the newest release of 3.x.

In short

1 new1 internal

Release note

Minor Changes

  • 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 target resource to 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 from proxyUrl when set), so it does not require a secret key. A proxyUrl must 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 an OAuthTokenExchangeError with code invalid_response.

    The method checks its inputs before making any request: resource must be an absolute URI without a fragment that uses https (or http on localhost, 127.0.0.1 or [::1]), and each scope element must be a single scope token, without spaces, ", \ or non-ASCII characters. Invalid input throws an OAuthTokenExchangeError with code invalid_request and no status. Only a 200 response with a well-formed token response counts as success; any other success status, or a response with missing or mistyped members, throws an OAuthTokenExchangeError with code invalid_response. If the token endpoint rejects the exchange, the error carries the OAuth error code in code (also available as error), errorDescription, and HTTP status. OAuthTokenExchangeError is exported from @clerk/backend/errors. Network failures from fetch are not wrapped.

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.