@clerk/backend
3.29.0 · 14 Nov 2026MIT8.4M / weekRepositoryHomepagenpmAtom feed
3.31.4 is the newest release of 3.x.
In short
3 breaking7 new5 fixed1 internal
- Breaking
Remove deprecated verify methods in favor of
verify(). - Breaking
Update engines config to require node@20 or higher
- Breaking
Remove deprecated
samlAccountin favor ofenterpriseAccount
Security
2 advisories affect 3.0.0; 3.2.14 fixes them
- HighClerk has an authorization bypass when combining organization, billing, or reverification checksGHSA-w24r-5266-9c3c · 30 Apr 2026Fixed in 3.2.14
- HighClerk: SSRF in the opt-in clerkFrontendApiProxy feature may leak secret keys to unintended hostGHSA-gjxx-92w9-8v8f · 27 Mar 2026Fixed in 3.2.3
Release note
Major Changes
- Breaking
Remove deprecated verify methods in favor of
verify().apiKeys.verifySecret()removed// Before await clerkClient.apiKeys.verifySecret(secret); // After await clerkClient.apiKeys.verify(secret);
idpOAuthAccessToken.verifyAccessToken()removed// Before await clerkClient.idpOAuthAccessToken.verifyAccessToken(accessToken); // After await clerkClient.idpOAuthAccessToken.verify(accessToken);
m2m.verifyToken()removed// Before await clerkClient.m2m.verifyToken(params); // After await clerkClient.m2m.verify(params);
- Breaking
Update engines config to require node@20 or higher
- Breaking
Remove deprecated
samlAccountin favor ofenterpriseAccount
Minor Changes
Add support for Agent Tasks API endpoint which allows developers to create agent tasks that can be used to act on behalf of users through automated flows.
Add Frontend API proxy support via
frontendApiProxyoption inclerkMiddlewareAdd
satelliteAutoSyncoption to optimize satellite app handshake behaviorSatellite apps currently trigger a handshake redirect on every first page load, even when no cookies exist. This creates unnecessary redirects to the primary domain for apps where most users aren't authenticated.
New option:
satelliteAutoSync(default:false)When
false(default): Skip automatic handshake if no session cookies exist, only trigger after explicit sign-in actionWhen
true: Satellite apps automatically trigger handshake on first load (previous behavior)
New query parameter:
__clerk_sync__clerk_sync=1(NeedsSync): Triggers handshake after returning from primary sign-in__clerk_sync=2(Completed): Prevents re-sync loop after handshake completes
Backwards compatible: Still reads legacy
__clerk_synced=trueparameter.SSR redirect fix: Server-side redirects (e.g.,
redirectToSignIn()from middleware) now correctly add__clerk_sync=1to the return URL for satellite apps. This ensures the handshake is triggered when the user returns from sign-in on the primary domain.CSR redirect fix: Client-side redirects now add
__clerk_sync=1to all redirect URL variants (forceRedirectUrl,fallbackRedirectUrl) for satellite apps, not just the defaultredirectUrl.
Usage
SSR (Next.js Middleware)
```typescript
import { clerkMiddleware } from '@clerk/nextjs/server';
export default clerkMiddleware({
isSatellite: true,
domain: 'satellite.example.com',
signInUrl: 'https://primary.example.com/sign-in',
// Set to true to automatically sync auth state on first load
satelliteAutoSync: true,
});
```SSR (TanStack Start)
```typescript
import { clerkMiddleware } from '@clerk/tanstack-react-start/server';
export default clerkMiddleware({
isSatellite: true,
domain: 'satellite.example.com',
signInUrl: 'https://primary.example.com/sign-in',
// Set to true to automatically sync auth state on first load
satelliteAutoSync: true,
});
```CSR (ClerkProvider)
```tsx
<ClerkProvider
publishableKey='pk_...'
isSatellite={true}
domain='satellite.example.com'
signInUrl='https://primary.example.com/sign-in'
// Set to true to automatically sync auth state on first load
satelliteAutoSync={true}
>
{children}
</ClerkProvider>
```SSR (TanStack Start with callback)
```typescript
import { clerkMiddleware } from '@clerk/tanstack-react-start/server';
// Options callback - receives context object, returns options
export default clerkMiddleware(({ url }) => ({
isSatellite: true,
domain: 'satellite.example.com',
signInUrl: 'https://primary.example.com/sign-in',
satelliteAutoSync: url.pathname.startsWith('/dashboard'),
}));
```Migration Guide
Behavior change: satelliteAutoSync defaults to false
Previously, satellite apps would automatically trigger a handshake redirect on every first page load to sync authentication state with the primary domain—even when no session cookies existed. This caused unnecessary redirects to the primary domain for users who weren't authenticated.
The new default (`satelliteAutoSync: false`) provides a better experience for end users. Performance-wise, the satellite app can be shown immediately without attempting to sync state first, which is the right behavior for most use cases.
**To preserve the previous behavior** where visiting a satellite while already signed in on the primary domain automatically syncs your session, set `satelliteAutoSync: true`:
```typescript
export default clerkMiddleware({
isSatellite: true,
domain: 'satellite.example.com',
signInUrl: 'https://primary.example.com/sign-in',
satelliteAutoSync: true, // Opt-in to automatic sync on first load
});
```TanStack Start: Function props to options callback
The `clerkMiddleware` function no longer accepts individual props as functions. If you were using the function form for props like `domain`, `proxyUrl`, or `isSatellite`, migrate to the options callback pattern.
**Before (prop function form - no longer supported):**
```typescript
import { clerkMiddleware } from '@clerk/tanstack-react-start/server';
export default clerkMiddleware({
isSatellite: true,
// ❌ Function form for individual props no longer works
domain: url => url.hostname,
});
```
**After (options callback form):**
```typescript
import { clerkMiddleware } from '@clerk/tanstack-react-start/server';
// ✅ Wrap entire options in a callback function
export default clerkMiddleware(({ url }) => ({
isSatellite: true,
domain: url.hostname,
}));
```
The callback receives a context object with the `url` property (a `URL` instance) and can return options synchronously or as a Promise for async configuration.Patch Changes
Warn when a cookie-based session token is missing the
azpclaim instead of rejecting the token. This prepares consumers for a future version where theazpclaim will be required.Dropping the
__experimental_prefix fromsetPasswordCompromisedandunsetPasswordCompromisedand marking them as stableAdded date filter parameters to user list endpoint
Fixes an issue with host header parsing that would cause Clerk to throw an exception when receiving malformed host values.
Improve token type validation in authentication requests
Allow
nullforperiod_endinBillingSubscriptionItemWebhookEventJSONUpdate getAuthData to use isMachineToken
Allow usage of machine secret key when listing M2M tokens:
const clerkClient = createClerkClient(); const m2mToken = await clerkClient.m2m.list({ machineSecretKey: 'ak_xxxxx', subject: machineId, });Add missing fields to CommercePlan type.
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.