@clerk/clerk-js
6.44.0 · 17 Nov 2026MIT1.5M / weekRepositoryHomepagenpmAtom feed
6.46.3 is the newest release of 6.x.
In short
17 breaking8 removed16 new2 faster22 fixed4 internal
- BreakingTo check
Align experimental/unstable prefixes to use consistent naming:
- Breaking
Renamed all
__unstable_*methods to__internal_*(for internal APIs) - Breaking
Renamed all
experimental__*andexperimental_*methods to__experimental_*(for beta features) - Breaking
__unstable__environment→__internal_environment - Breaking
__unstable__updateProps→__internal_updateProps - Breaking
__unstable__setEnvironment→__internal_setEnvironment - Breaking
__unstable__onBeforeRequest→__internal_onBeforeRequest - Breaking
__unstable__onAfterResponse→__internal_onAfterResponse
Security
1 advisory affects 6.0.0; 6.7.5 fixes them
- HighClerk has an authorization bypass when combining organization, billing, or reverification checksGHSA-w24r-5266-9c3c · 30 Apr 2026Fixed in 6.7.5
Release note
Major Changes
- Breaking
Align experimental/unstable prefixes to use consistent naming:
Renamed all
__unstable_*methods to__internal_*(for internal APIs)Renamed all
experimental__*andexperimental_*methods to__experimental_*(for beta features)Removed deprecated billing-related props (
__unstable_manageBillingUrl,__unstable_manageBillingLabel,__unstable_manageBillingMembersLimit) andexperimental__forceOauthFirst
- Breaking
Renamed unstable methods to internal:
__unstable__environment→__internal_environment__unstable__updateProps→__internal_updateProps__unstable__setEnvironment→__internal_setEnvironment__unstable__onBeforeRequest→__internal_onBeforeRequest__unstable__onAfterResponse→__internal_onAfterResponse__unstable__onBeforeSetActive→__internal_onBeforeSetActive(window global)__unstable__onAfterSetActive→__internal_onAfterSetActive(window global)
- Breaking
Add proactive session token refresh. Tokens are now automatically refreshed in the background before they expire, reducing latency for API calls near token expiration.
- Breaking
Updated returned values of
Clerk.checkout()anduseCheckout.
Vanilla JS
```ts
// Before
const { getState, subscribe, confirm, start, clear, finalize } = Clerk.checkout({
planId: 'xxx',
planPeriod: 'annual',
});
getState().isStarting;
getState().isConfirming;
getState().error;
getState().checkout;
getState().fetchStatus;
getState().status;
// After
const { checkout, errors, fetchStatus } = Clerk.checkout({ planId: 'xxx', planPeriod: 'annual' });
checkout.plan; // null or defined based on `checkout.status`
checkout.status;
checkout.start;
checkout.confirm;
```React
```ts
// Before
const { id, plan, status, start, confirm, paymentSource } = useCheckout({ planId: 'xxx', planPeriod: 'annual' });
// After
const { checkout, errors, fetchStatus } = usecCheckout({ planId: 'xxx', planPeriod: 'annual' });
checkout.plan; // null or defined based on `checkout.status`
checkout.status;
checkout.start;
checkout.confirm;
```- Removed
Remove deprecated
samlproperty fromUserSettingsin favor ofenterpriseSSO - Removed
Remove deprecated
samlAccountin favor ofenterpriseAccount - Removed
Remove
clerkJSVariantoption and headless bundle. UseprefetchUI={false}instead. - Breaking
Require Node.js 20.9.0 in all packages
- Removed
Remove all previously deprecated UI props across the Next.js, React and clerk-js SDKs. The legacy
afterSign(In|Up)Url/redirectUrlprops,UserButtonsign-out overrides, organizationhideSlugflags,OrganizationSwitcher'safterSwitchOrganizationUrl,Client.activeSessions,setActive({ beforeEmit }), and theClerkMiddlewareAuthObjecttype alias are no longer exported. Components now rely solely on the new redirect options and server-side configuration. - Removed
Remove deprecated
samlstrategy in favor ofenterprise_sso getToken()now throwsClerkOfflineErrorinstead of returningnullwhen the client is offline.This makes it explicit that a token fetch failure was due to network conditions, not authentication state. Previously, returning
nullcould be misinterpreted as "user is signed out," potentially causing the cached token to be cleared.To handle this change, catch
ClerkOfflineErrorfromgetToken()calls:import { ClerkOfflineError } from '@clerk/react/errors'; try { const token = await session.getToken(); } catch (error) { if (ClerkOfflineError.is(error)) { // Handle offline scenario - show offline UI, retry later, etc. } throw error; }
Minor Changes
Add support for email link based verification to SignUpFuture
Surface organization creation defaults with prefilled form fields and advisory warnings
Reuse SignIn and SignUp instances on Client when processing Client response JSON.
addListenernow takes askipInitialEmitoption that can be used to avoid emitting immediately after subscribing.UI components are now provided by the new
@clerk/uipackage, loaded automatically from the Clerk CDN.Don't display impersonation overlay for agents
Hide the "Remove" action from the last available 2nd factor strategy when MFA is required
Renames
mountTaskSetupMfaandunmountTaskSetupMfatomountTaskSetupMFAandunmountTaskSetupMFArespectivelyAdd
unsafe_disableDevelopmentModeConsoleWarningoption to disable the development mode warning that's emitted to the console when Clerk is first loaded.Refactor React SDK hooks to subscribe to auth state via
useSyncExternalStore. This is a mostly internal refactor to unlock future improvements, but includes a few breaking changes and fixes.Breaking changes:
Removes ability to pass in
initialAuthStatetouseAuthThis was added for internal use and is no longer needed
Instead pass in
initialStateto the<ClerkProvider>, ordynamicif using the Next packageSee your specific SDK documentation for more information on Server Rendering
Fixes:
A bug where
useAuthwould sometimes briefly return theinitialStaterather thanundefinedThis could in certain situations incorrectly lead to a brief
user: nullon the first page after signing in, indicating a signed out state
Hydration mismatches in certain rare scenarios where subtrees would suspend and hydrate only after
clerk-jshad loaded fully
Add support for email code MFA to SignInFuture
Introducing
setup_mfasession taskAdd additional verification fields to SignUpFuture.
Add support for resetting a password via phone code.
Disable role selection in
OrganizationProfileduring role set migrationAdd Safari ITP (Intelligent Tracking Prevention) cookie refresh support.
Safari's ITP limits cookies set via JavaScript to 7 days. When a session cookie is close to expiring (within 8 days), Clerk now automatically routes navigations through a
/v1/client/touchendpoint to refresh the cookie via a full-page navigation, bypassing the 7-day cap.For developers using a custom
navigatecallback insetActive(), a newdecorateUrlfunction is passed to the callback. Use it to wrap your destination URL:await clerk.setActive({ session: newSession, navigate: ({ decorateUrl }) => { const url = decorateUrl('/dashboard'); window.location.href = url; }, });The
decorateUrlfunction returns the original URL unchanged when the Safari ITP fix is not needed, so it's safe to always use it.Add
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.- Breaking
Add standalone
getToken()function for retrieving session tokens outside of framework component trees.This function is safe to call from anywhere in the browser, such as API interceptors, data fetching layers (e.g., React Query, SWR), or vanilla JavaScript code. It automatically waits for Clerk to initialize before returning the token.
import { getToken } from '@clerk/nextjs'; // or any framework package
// Example: Axios interceptor
axios.interceptors.request.use(async (config) => {
const token = await getToken();
if (token) {
config.headers.Authorization =Bearer ${token};
}
return config;
}); - Breaking
Revert sign up if missing changes to fix Enterprise SSO captcha
- Breaking
Introduce
useWaitlist()hook
Patch Changes
Add
resetmethod to the sign-in resource.Prevent DOM-based captcha from hanging in React Native environments
Make
expo-auth-sessionandexpo-web-browseroptional via dynamic importsRe-export
RedirectToTasksandShowcontrol components
Add
resetmethod to the new signUp resource.Rename dev browser APIs to remove JWT terminology. The dev browser identifier is now a generic ID, so internal naming has been updated to reflect this. No runtime behavior changes.
clerk-js: Handle missing window.location in React Native navigation
Fix issue where
signUp.verifications.sendPhoneCode()expected to be provided aphoneNumber.Fix infinite request loop caused by
dev_browser_unauthenticatederrors during runtime polling by handling them in the base fetcher with a dev browser reset instead of triggering recursivehandleUnauthenticatedcalls.Fix HashRouter not responding to popup OAuth navigations by adding
pushstate/replacestateto refresh events and suppressing the history observer during external navigation.Fix backwards compatibility for legacy
clerkUICtoroption removed in theuiprop PRRemove ANSI colors from ConsoleTransport.
Support both
clerkUICtorandclerkUiCtoroption names for backwards compatibilityFix
toBeSignedOuttest-helper so it only resolves whenuser === null. It previously resolved for any falsy value, which could give false positives when Clerk had not loaded yet, or during auth-state changes.Preload component chunks in parallel with the common chunk during mount, reducing first-render latency on slow connections.
- Removed
Remove CHIPS build variant and use
partitioned_cookiesenvironment flag from the Clerk API to control partitioned cookie behavior at runtime. Remove regenerator-runtime dependency and imports from clerk-js builds
Update documentation link in Smart CAPTCHA errors
Fix issue where
signUp.password()created a new sign-up when called aftersignUp.create()Allow creating additional memberships on unlimited
environment.organizationSettings.maxAllowedMembershipsFixes issue where captcha was always called during signup.
Fix a crash in the Turnstile CAPTCHA retry logic where captcha.reset() was called after the widget's DOM container had already been removed, causing an unhandled error
Fix issue were
sendPhoneCodemethod was incorrectly requiring a parameter.When password is enabled at the instance level, but not required allow users to add a password in the user profile.
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.