library · inferred from evidence
@clerk/nextjs/server
A library providing middleware and route matching utilities for Next.js applications, specifically for authentication.
- Infinite redirect to sign-in: your public-route matcher does not cover the sign-in page itself
Every page bounces to sign-in, including the sign-in page. The app is completely unusable and the cause is one missing matcher entry.
- Clerk createRouteMatcher() is deprecated: protect content close to the resource
Training data still teaches createRouteMatcher() for protecting routes. Clerk deprecated it; it now logs a runtime warning. Protect where the data is read, not in middleware.
- Clerk + Next.js Pages Router: ClerkProvider takes pageProps, server auth needs getAuth(req)
Pages Router has no Server Components and no async auth(). Wrap _app with ClerkProvider passing pageProps, and read the user server-side with getAuth(req) inside getServerSideProps.