Next.js Dynamic Keys
- Category
- SDK
- Published
Keys and options passed to clerkMiddleware()
at runtime are available in Clerk’s server-side helpers.
Users building a multi-tenant application might need to provide different Clerk keys depending on the incoming request. Previously, you would need to pass these keys to all of Clerk’s Next.js server-side helpers. With Dynamic Keys support, keys passed to clerkMiddleware()
are made available to auth()
and other server-side helpers.
With a centralized place for passing server-side options, implementing a multi-tenant application that requires dynamic Clerk keys should be much more straightforward. This feature is available as of @clerk/nextjs@5.2.x
.
Check out the documentation for additional details and happy building!