Clerk
Drop-in sign-in screens, user management and sessions, hosted for you.
Pick it when You want working login with Google, email and a user dashboard by this afternoon.
Skip it if You must keep every user record in your own database or need to avoid per-user pricing at large scale.
- Pre-built sign-in and profile components
- Social logins, magic links and MFA in a few clicks
- Handles sessions and security patches for you
- Users live in their system, so moving away means a migration
- Price grows with active users
- Quick to set up
- Cheap while small
- Easy to leave
- Room to grow
PriceFree tier, then per monthly active user
How to connect it
- Create an application in the Clerk dashboard and switch on the sign-in methods you want.
- Install the SDK and wrap your app in the provider component.
- Add the middleware so protected routes redirect signed-out visitors to sign-in.
- Read the user id on the server and store it on your own rows as the owner.
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEYCLERK_SECRET_KEY
import { clerkMiddleware, createRouteMatcher } from "@clerk/nextjs/server";
const isPrivate = createRouteMatcher(["/dashboard(.*)"]);
export default clerkMiddleware(async (auth, req) => {
if (isPrivate(req)) await auth.protect(); // signed-out users are sent to sign-in
});