



















Clerk has updated our SDK to support Next.js version 13.4.0. We've added stable support for the App Router, which is the default for new applications. We've also improved the ergonomics of our middleware helper for more composability and to mitigate common pitfalls.
See the updates in our new Next.js documentation, or read on for more details.
Next.js version 13.4.0 launched today and the App Router is now stable. In turn, Clerk's support for the App Router is also now stable in @clerk/nextjs version 4.17.0.
If you previously adopted @clerk/nextjs/app-beta, there have been very few changes:
auth() and currentUser() helpers have been moved to a permanent home in @clerk/nextjs@clerk/nextjs/app-beta/client are no longer necessary, and you can import from @clerk/nextjs intstead. The package now automatically detects if components are being used from a client component or a server component, and loads the proper form.That's all! Our documentation has been updated to reflect the changes.
Along with today's launch, we've also released a new middleware helper to make things a little easier and more composable.
In its simplest form, these few lines are all you need to integrate Clerk:
This sets your application in a protected mode – if users are signed out the will be automatically redirected to a sign in. Unprotected pages need to be explicitly listed in the publicRoutes argument:
This new helper also has beforeAuth and afterAuth arguments to enable more composability with libraries like next-intl. For more details, checkout the updated middleware documentation.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。