@clerk/nextjs
7.10.2 · 17 Nov 2026MIT4.2M / weekRepositoryHomepagenpmAtom feed
6.39.9 is the newest release of 6.x.
In short
4 breaking2 new4 internal
- Breaking
Stop
<ClerkProvider>from opting applications into dynamic rendering. A new prop,<ClerkProvider dynamic>can be used to opt-in to dynamic rendering and make auth data available during server-side rendering. The RSCauth()helper should be preferred for accessing auth data during dynamic rendering. - Breaking
@clerk/nextjs: Converting auth() and clerkClient() interfaces to be async
- Breaking
Support
unstable_rethrowinsideclerkMiddleware. - Breaking
Removes deprecated APIs:
authMiddleware(),redirectToSignIn(), andredirectToSignUp(). See the migration guide to learn how to update your usage.
Security
2 advisories affect 6.0.0; 6.39.3 fixes them
- CriticalOfficial Clerk JavaScript SDKs: Middleware-based route protection bypassGHSA-vqx2-fgx2-5wq9 · 16 Apr 2026Fixed in 6.39.2
- HighClerk has an authorization bypass when combining organization, billing, or reverification checksGHSA-w24r-5266-9c3c · 30 Apr 2026Fixed in 6.39.3
Release note
Major Changes
- Breaking
Stop
<ClerkProvider>from opting applications into dynamic rendering. A new prop,<ClerkProvider dynamic>can be used to opt-in to dynamic rendering and make auth data available during server-side rendering. The RSCauth()helper should be preferred for accessing auth data during dynamic rendering. - Breaking
@clerk/nextjs: Converting auth() and clerkClient() interfaces to be async
@clerk/upgrade: Adding required codemod for @clerk/nextjs breaking changes
Migration guide
auth() is now async
Previously the `auth()` method from `@clerk/nextjs/server` was synchronous.
```typescript
import { auth } from "@clerk/nextjs/server";
export function GET() {
const { userId } = auth();
return new Response(JSON.stringify({ userId }));
}
```
The `auth` method now becomes asynchronous. You will need to make the following changes to the snippet above to make it compatible.
```diff
- export function GET() {
+ export async function GET() {
- const { userId } = auth();
+ const { userId } = await auth();
return new Response(JSON.stringify({ userId }));
}
```Clerk middleware auth is now async
```typescript
import { clerkClient, clerkMiddleware } from '@clerk/nextjs/server';
import { NextResponse } from 'next/server';
export default clerkMiddleware(async (auth, request) => {
const resolvedAuth = await auth();
const count = await resolvedAuth.users.getCount();
if (count) {
return NextResponse.redirect(new URL('/new-url', request.url));
}
});
export const config = {
matcher: [...],
};
```clerkClient() is now async
Previously the `clerkClient()` method from `@clerk/nextjs/server` was synchronous.
```typescript
import { clerkClient, clerkMiddleware } from '@clerk/nextjs/server';
import { NextResponse } from 'next/server';
export default clerkMiddleware((auth, request) => {
const client = clerkClient();
const count = await client.users?.getCount();
if (count) {
return NextResponse.redirect(new URL('/new-url', request.url));
}
});
export const config = {
matcher: [...],
};
```
The method now becomes async. You will need to make the following changes to the snippet above to make it compatible.
```diff
- export default clerkMiddleware((auth, request) => {
- const client = clerkClient();
+ export default clerkMiddleware(async (auth, request) => {
+ const client = await clerkClient();
const count = await client.users?.getCount();
if (count) {
}
```- Breaking
Support
unstable_rethrowinsideclerkMiddleware.We changed the errors thrown by
protect()insideclerkMiddlewarein order forunstable_rethrowto recognise them and rethrow them. - Breaking
Removes deprecated APIs:
authMiddleware(),redirectToSignIn(), andredirectToSignUp(). See the migration guide to learn how to update your usage.
Minor Changes
Bug fix: Correctly redirect to sign in page in Next 15.
Add experimental support for new UI components
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.