Skip to content

Releases: clerk/javascript

@clerk/nextjs@6.0.1

23 Oct 20:11
46e54ed
Compare
Choose a tag to compare

Patch Changes

  • Await usage of cookies() and ensure the return value of the server action is valid. (#4396) by @BRKalow

  • Updated dependencies [3fdcdbf88, 1c7e105a3]:

    • @clerk/types@4.28.0
    • @clerk/backend@1.15.1
    • @clerk/clerk-react@5.13.1
    • @clerk/shared@2.10.1

@clerk/nextjs@6.0.0

23 Oct 00:35
180f5a5
Compare
Choose a tag to compare

Major Changes

  • 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 RSC auth() helper should be preferred for accessing auth data during dynamic rendering. (#4366) by @jacekradko

  • @clerk/nextjs: Converting auth() and clerkClient() interfaces to be async (#4366) by @jacekradko

    @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.

    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.

    - 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

    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.

    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.

    - 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) {
    }
  • Support unstable_rethrow inside clerkMiddleware. (#4366) by @jacekradko

    We changed the errors thrown by protect() inside clerkMiddleware in order for unstable_rethrow to recognise them and rethrow them.

  • Removes deprecated APIs: authMiddleware(), redirectToSignIn(), and redirectToSignUp(). See the migration guide to learn how to update your usage. (#4366) by @jacekradko

Minor Changes

Patch Changes

@clerk/localizations@3.4.0

23 Oct 20:11
46e54ed
Compare
Choose a tag to compare

Minor Changes

  • Adding experimental support for legal consent for <SignUp/> component (#4337) by @octoper

Patch Changes

  • Updated dependencies [3fdcdbf88]:
    • @clerk/types@4.28.0

@clerk/localizations@3.3.1

23 Oct 00:35
180f5a5
Compare
Choose a tag to compare

Patch Changes

@clerk/fastify@2.0.5

23 Oct 20:11
46e54ed
Compare
Choose a tag to compare

Patch Changes

  • Updated dependencies [3fdcdbf88, 1c7e105a3]:
    • @clerk/types@4.28.0
    • @clerk/backend@1.15.1
    • @clerk/shared@2.10.1

@clerk/fastify@2.0.4

23 Oct 00:35
180f5a5
Compare
Choose a tag to compare

Patch Changes

@clerk/express@1.3.3

23 Oct 20:11
46e54ed
Compare
Choose a tag to compare

Patch Changes

  • Updated dependencies [3fdcdbf88, 1c7e105a3]:
    • @clerk/types@4.28.0
    • @clerk/backend@1.15.1
    • @clerk/shared@2.10.1

@clerk/express@1.3.2

23 Oct 00:35
180f5a5
Compare
Choose a tag to compare

Patch Changes

@clerk/elements@0.17.1

23 Oct 20:11
46e54ed
Compare
Choose a tag to compare

Patch Changes

  • Updated dependencies [3fdcdbf88]:
    • @clerk/types@4.28.0
    • @clerk/shared@2.10.1

@clerk/elements@0.17.0

23 Oct 00:35
180f5a5
Compare
Choose a tag to compare

Minor Changes

  • Add experimental support for new UI components (#4114) by @BRKalow

Patch Changes

  • Remove @clerk/clerk-react as a dev depedency. Move @clerk/shared to depedencies (previously devDepedencies). (#4114) by @BRKalow

  • Updated dependencies [3b50b67bd, 3b50b67bd]:

    • @clerk/shared@2.10.0
    • @clerk/types@4.27.0