@clerk/nuxt
3.1.24 · 14 Nov 2026MIT36.2k / weekRepositoryHomepagenpmAtom feed
2.6.23 is the newest release of 2.x.
In short
5 breaking1 removed3 new1 fixed6 changed3 internal
- Breaking
Require Node.js 20.9.0 in all packages
- Breaking
Remove
clerkJSUrl,clerkJSVersion,clerkUIUrl, andclerkUIVersionprops from all SDKs. To pin a specific version of@clerk/clerk-js, import theClerkconstructor from@clerk/clerk-jsand pass it toClerkProvidervia theClerkprop. To pin a specific version of@clerk/ui, importuifrom@clerk/uiand pass it via theuiprop. This bundles the modules directly with your application instead of loading them from the CDN. - Breaking
Introduce
<Show when={...}>as the cross-framework authorization control component and remove<Protect>,<SignedIn>, and<SignedOut>in favor of<Show>. - Breaking
Removed deprecated
getAuth()helper. Useevent.context.auth()in your server routes instead. - Breaking
getToken()now throwsClerkOfflineErrorinstead of returningnullwhen the client is offline. - Removed
Remove
clerkJSVariantoption and headless bundle. UseprefetchUI={false}instead.
Security
2 advisories affect 2.0.0; 2.2.5 fixes them
- CriticalOfficial Clerk JavaScript SDKs: Middleware-based route protection bypassGHSA-vqx2-fgx2-5wq9 · 16 Apr 2026Fixed in 2.2.2
- HighClerk has an authorization bypass when combining organization, billing, or reverification checksGHSA-w24r-5266-9c3c · 30 Apr 2026Fixed in 2.2.5
Release note
Major Changes
- Breaking
Require Node.js 20.9.0 in all packages
- Breaking
Remove
clerkJSUrl,clerkJSVersion,clerkUIUrl, andclerkUIVersionprops from all SDKs. To pin a specific version of@clerk/clerk-js, import theClerkconstructor from@clerk/clerk-jsand pass it toClerkProvidervia theClerkprop. To pin a specific version of@clerk/ui, importuifrom@clerk/uiand pass it via theuiprop. This bundles the modules directly with your application instead of loading them from the CDN. - Breaking
Introduce
<Show when={...}>as the cross-framework authorization control component and remove<Protect>,<SignedIn>, and<SignedOut>in favor of<Show>. - Breaking
Removed deprecated
getAuth()helper. Useevent.context.auth()in your server routes instead.export default defineEventHandler(event => { const { userId } = event.context.auth(); return { userId, }; }); - Breaking
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; } - Breaking
Routing strategy for the ff. components now default to
path:<SignIn /><SignUp /><UserProfile /><OrganizationProfile /><CreateOrganization /><OrganizationList />
Minor Changes
- Removed
Remove
clerkJSVariantoption and headless bundle. UseprefetchUI={false}instead. 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;
});Add
/typessubpath export to re-export types from@clerk/shared/typesalong with SDK-specific types. This allows importing Clerk types directly from the SDK package (e.g.,import type { UserResource } from '@clerk/react/types') without needing to install@clerk/typesas a separate dependency.Introduce
<UNSAFE_PortalProvider>component which allows you to specify a custom container for Clerk floating UI elements (popovers, modals, tooltips, etc.) that use portals. Only Clerk components within the provider will be affected, components outside the provider will continue to use the default document.body for portals.This is particularly useful when using Clerk components inside external UI libraries like Radix Dialog or React Aria Components, where portaled elements need to render within the dialog's container to remain interact-able.
'use client'; import { useRef } from 'react'; import * as Dialog from '@radix-ui/react-dialog'; import { UNSAFE_PortalProvider, UserButton } from '@clerk/nextjs'; export function UserDialog() { const containerRef = useRef<HTMLDivElement>(null); return ( <Dialog.Root> <Dialog.Trigger>Open Dialog</Dialog.Trigger> <Dialog.Portal> <Dialog.Overlay /> <Dialog.Content ref={containerRef}> <UNSAFE_PortalProvider getContainer={() => containerRef.current}> <UserButton /> </UNSAFE_PortalProvider> </Dialog.Content> </Dialog.Portal> </Dialog.Root> ); }
Patch Changes
Wire
clerkUIVersionoption through all framework packages
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.