Auth.js vs Clerk
Auth.js: Adding social sign-in to Next.js and similar apps.; Clerk: Shipping polished auth fast without running it yourself.
| Field | Auth.js | Clerk |
|---|---|---|
| Pricing | Open source | Free tier |
| Open source | Yes | No |
| Self-hostable | Yes | No |
| Ecosystem | JavaScript / TypeScript | JavaScript / TypeScript |
| Category | Auth | Auth |
Choose Clerk over Auth.js when
Choose it for a hosted service with prebuilt UI and organizations. It is billed per retained user above 50,000; Auth.js has no per-user bill.
Clerk: hosted, with prebuilt UI and organizations, billed per retained user above 50,000 (pricing). Auth.js has no per-user bill.
SourceChecked 25 November 2026
Choose Auth.js over Clerk when
Choose it for free, self-run auth with no per-user bill. Its v5 line has been in beta since 2023 and its maintainers recommend Better Auth for new projects.
Auth.js: free and self-run, with no per-user bill, but its v5 line has been in beta since 2023 and its maintainers recommend Better Auth for new projects (Auth.js README).
SourceChecked 25 November 2026
Auth.js
An open-source authentication library for web frameworks, best known as NextAuth.js, with many OAuth providers built in.
Choose Auth.js if
Adding social sign-in to Next.js and similar apps.
Why it’s here
Auth.js, formerly NextAuth.js, adds OAuth, email and credentials sign-in to a Next.js, SvelteKit, Express or Qwik app, inside your own code and without a hosted service. Its docs list 94 providers, including the email and Credentials ones, and 24 database adapters (docs). Sessions can be encrypted JWT cookies with no database at all (session strategies, README).
Pick it when
- You already run it. The maintainers say existing users "can continue doing so without disruption" and that security patches continue (announcement).
- You need stateless sessions against an existing backend such as LDAP or Active Directory. The README names stateless sessions without a database as the main reason not to switch (README); Better Auth's docs now describe a database-free stateless mode, so check that it covers your case (Better Auth sessions).
Skip it when
- You are starting a new project. The README recommends Better Auth for new projects, and the migration guide says "we strongly recommend using Better Auth" (README, migration guide).
- You need passwords, two-factor or organizations from the library. Users signed in through the Credentials provider "are not persisted in the database" (Credentials).
Current state
next-auth@latest is 4.24.15, published 2026-07-20. v5 is on the beta tag at 5.0.0-beta.32, published the same day; its first beta was 2023-10-24 (releases, npm registry). The licence is ISC, copyright Balázs Orbán (LICENSE). Better Auth Inc. announced on 2025-09-22 that it now oversees the project, and the docs footer carries its copyright (announcement). Better Auth then said on 2026-07-07 that it is joining Vercel (post).
Setup
npm install next-auth@beta
npx auth secret
Watch out for
Plain npm install next-auth installs v4; v5 needs the @beta tag (security post, installation). Guides for v4 and v5 differ, so match the guide to the version. The July 2026 release fixed four advisories, among them a v5 middleware check that failed open on provider configuration errors and an email check done before Unicode normalization (GHSA-8fpg-xm3f-6cx3, GHSA-7rqj-j65f-68wh). Each @auth/* package pins @auth/core exactly, so update the framework or adapter package, not the core alone.
Clerk
Hosted authentication and user management with prebuilt sign-in components, organisations and session handling.
Choose Clerk if
Shipping polished auth fast without running it yourself.
Why it’s here
Clerk is a hosted auth service: prebuilt sign-in, profile and organization components, a user database and session handling you do not run. In Next.js, npx -y clerk@latest init writes the provider, middleware and auth routes (quickstart). Each session token is a JWT that expires after 60 seconds and is refreshed in the background, which limits what a stolen token is worth (how Clerk works).
Pricing
From the official pricing page, read 2026-11-17, in US dollars (pricing):
- Hobby (free): 50,000 monthly retained users (MRUs) per app, up to 3 social connections, sessions fixed at 7 days, no MFA, no passkeys, 1 day of logs.
- Pro: $25 a month, or $20 billed annually. 50,000 MRUs included, then $0.02 each up to 100,000 and $0.018 each up to 1,000,000. So 100,000 MRUs on monthly billing costs $25 + 50,000 x $0.02 = $1,025. Includes MFA, passkeys, custom session length and 1 enterprise SSO connection; each extra connection is $75 a month.
- Business: $300 a month ($250 annually). Adds 10 dashboard seats, the SOC 2 report and priority support with no response-time SLA. The 99.99% uptime SLA is Enterprise only.
- Add-ons: B2B Authentication Enhanced at $100 a month ($85 annually) lifts the 20-member cap per organization and adds verified domains and custom roles. SMS codes cost $0.01 each in the US and Canada.
A user counts only if they return at least 24 hours after signing up, so a sign-up that never comes back is never billed.
Pick it when
- You want sign-in, profile and organization screens without building them, with SDKs for React, Next.js, Expo, Astro and native Android (docs index).
- You sell to businesses and need SAML or OIDC SSO soon: one connection is in the Pro price.
- Retention tracks revenue. Clerk's own FAQ says it is easiest to justify when it does (FAQ).
Skip it when
- You need auth to run on your own servers. Clerk sells only hosted plans.
- Your app is free, ad-supported or low revenue per user. Clerk's FAQ warns that per-MRU pricing "may feel expensive once you outgrow the free tier".
Current state
@clerk/nextjs 7.10.2 was published 2026-11-17, after 7.10.0 on 2026-11-14 and 7.9.26 on 2026-11-12 (releases). The clerk/javascript repository is MIT, copyright Clerk Inc (LICENSE); it holds the SDKs, not the hosted service.
Setup
npx -y clerk@latest init
Watch out for
You cannot migrate users from a development instance to production (migrating). Leaving is possible: the dashboard exports a CSV that includes hashed passwords, but moving to another provider ends every active session. Production Backend API calls are limited to 1,000 requests per 10 seconds per instance, and the currentUser() helper counts against that limit (rate limits). Directory Sync billing starts on 2027-01-01 (pricing).