
Two announcements in under a year reshaped open source authentication for JavaScript apps. In September 2025, Auth.js, the library most developers still call NextAuth.js, became part of Better Auth. In July 2026, Better Auth itself joined Vercel. If your Next.js app signs users in with NextAuth, or you are choosing auth for a new product, you now need to know which project is actually moving forward, whether migrating is worth it, and what the Vercel connection changes for you.
Key takeaways
- Better Auth is now the recommended choice for new JavaScript projects, since Auth.js joined Better Auth in September 2025 and receives only security patches and urgent fixes.
- Unlike Auth.js, Better Auth includes email and password sign-in and offers plugins for two-factor authentication, passkeys, magic links, organizations, SSO over OIDC or SAML, and SCIM.
- A working NextAuth app does not need an emergency migration, but needing organizations, two-factor authentication, passkeys or SSO, or facing the long-running v5 beta, are clear triggers to move.
- The riskiest migration step is moving password hashes from the User row into an Account row with providerId set to credential, or every password user fails to sign in.
- Better Auth joined Vercel in July 2026 but remains MIT licensed and stores users and sessions in your own database, so leaving it is a code migration, not a data extraction.
As of November 11, 2026. Facts were checked on better-auth.com, authjs.dev and the npm registry on that date. Current versions: better-auth 1.7.20; next-auth 4.24.15 stable and 5.0.0-beta.32.
The short answer: Better Auth is where new development is happening, and its maintainers strongly recommend it for new projects. Auth.js still receives security patches and urgent fixes, so a working NextAuth setup does not need an emergency migration. Plan a move when you need features Auth.js makes hard, such as organizations, two-factor authentication or passkeys, or when you would otherwise be upgrading to the long-running v5 beta.
What Happened to Auth.js?
The story matters because it tells you how much to trust each project’s future, and that is the real question behind any auth library choice.
September 22, 2025: Auth.js joins Better Auth
Better Auth founder Bereket Engida announced that Auth.js would be maintained and overseen by the Better Auth team. The post credits the Auth.js core maintainers for keeping the project alive and makes two commitments. Existing users “can continue doing so without disruption”, with the team addressing security patches and urgent issues as they come up. And the team “strongly recommend[s] new projects to start with Better Auth”, with one exception noted at the time: stateless sessions without a database. That gap has since closed; the current Better Auth migration guide states that Better Auth now supports stateless session management without any database. Today authjs.dev carries a banner reading “The Auth.js project is now part of Better Auth.”
July 7, 2026: Better Auth joins Vercel
Ten months later, Better Auth announced it was joining Vercel. The announcement says Vercel “shares our commitment to keeping auth open source, framework and platform agnostic”, and that the combined team will invest in auth for AI agents that act on a user’s behalf with scoped, revocable access. Better Auth remains MIT licensed on npm.
The state of each package today
| Package | Latest (Nov 11, 2026) | Status |
|---|---|---|
| better-auth | 1.7.20 (Nov 10, 2026); 1.8.0 in beta | Active development, MIT |
| next-auth | 4.24.15 stable; 5.0.0-beta.32 | Maintenance: security and urgent fixes |
| @auth/core | 0.41.3 | Maintenance |
The detail worth noticing: NextAuth v5 has been in beta for a long time, and the stable line is still v4. Teams that planned to “upgrade to v5 eventually” should now weigh moving to Better Auth instead.
Better Auth vs Auth.js: How Do They Differ?
Both libraries let you own your auth: users and sessions live in your database, not in a vendor’s. The difference is how much they do for you.
Scope: OAuth library vs full auth framework
Auth.js was built around OAuth sign-in: plug in Google or GitHub, get a session. Email and password sign-in exists through a Credentials provider, but hashing, storage, verification and reset flows are largely yours to build. Better Auth calls itself a framework-agnostic authentication and authorization framework for TypeScript. Email and password is built in, with passwords stored on the account record, and a plugin system adds two-factor authentication, passkeys, magic links, email OTP, phone numbers, organizations with members and teams, an admin plugin, API keys, SSO over OIDC or SAML 2.0, SCIM provisioning, and an OAuth 2.1 provider, among others.
Framework reach
Better Auth’s client works with React, Vue, Svelte and other frameworks, and the server side is framework agnostic rather than tied to Next.js. The founder’s Vercel post explains that a big reason for the project was the pain of moving NextAuth code to Svelte or Expo. If your company runs more than one frontend framework, one auth library across all of them is a real simplification.
Side by side
| Capability | Auth.js (NextAuth) | Better Auth |
|---|---|---|
| OAuth providers | Yes, large catalog | Yes, plus generic OAuth plugin |
| Email and password | Credentials provider, you build the rest | Built in |
| 2FA, passkeys, magic links | Not built in | Plugins |
| Organizations and roles | Not built in | Organization plugin |
| SSO (SAML, OIDC) and SCIM | Not built in | Plugins |
| Stateless sessions | Yes (JWT) | Yes (signed or encrypted cookie) |
| Database adapters | Many | Postgres, MySQL, SQLite, MS SQL, Prisma, Drizzle, MongoDB |
| Development status | Maintenance | Active |

Should You Migrate an Existing Auth.js App?
Better Auth’s own migration guide is refreshingly direct: if your current setup is working well, there is no urgent need to migrate. That is the right default. Auth changes carry real risk, because a bug here locks real users out or, worse, lets the wrong user in.
Good reasons to stay on Auth.js for now
- Your app only uses OAuth sign-in and the session object, and it works.
- You are on stable v4 with no roadmap items that touch auth for the next two quarters.
- You have no automated tests around sign-in, which means a migration should start with writing them anyway.
Clear triggers to migrate
- You need B2B features: organizations, invitations, roles, or SSO for enterprise customers. These are where custom Auth.js code gets expensive, and they connect directly to multi-tenant architecture decisions.
- Customers or security reviews ask for two-factor authentication or passkeys.
- You built your own email and password flow on top of the Credentials provider and maintain it by hand.
- You were about to move to the v5 beta or add a second frontend framework.
What a real product’s auth list looks like
For a sense of scale, look at the sign-in rules on LyCare, the care operations app Lycore built: email and password or Google sign-in, passwords of at least 12 characters, breached passwords refused, optional or enforced two-factor authentication per company, seven-day sessions, and platform staff who can lock accounts and sign users out everywhere. Every item on that list is custom work on a bare OAuth library. Requirements like these are the strongest argument for a framework with plugins.
How to Migrate From Auth.js to Better Auth
The official migration guide walks through the change for the Next.js App Router. Here is the condensed path, with the parts that usually trip teams up.
Step 1: install and configure the server
Install better-auth, set BETTER_AUTH_SECRET (at least 32 characters; openssl rand -base64 32 works) and BETTER_AUTH_URL, then create the auth instance. Your provider config moves from a providers array to a socialProviders object.
// lib/auth.ts
import { betterAuth } from "better-auth"
import { nextCookies } from "better-auth/next-js"
import { Pool } from "pg"
export const auth = betterAuth({
database: new Pool({ connectionString: process.env.DATABASE_URL }),
emailAndPassword: { enabled: true },
socialProviders: {
github: {
clientId: process.env.GITHUB_CLIENT_ID!,
clientSecret: process.env.GITHUB_CLIENT_SECRET!,
},
},
plugins: [nextCookies()], // keep this last
})
Step 2: swap the route handler and client
Rename app/api/auth/[...nextauth] to app/api/auth/[...all] and mount the handler. On the client, replace next-auth/react imports with an auth client.
// app/api/auth/[...all]/route.ts
import { auth } from "@/lib/auth"
import { toNextJsHandler } from "better-auth/next-js"
export const { GET, POST } = toNextJsHandler(auth)
// lib/auth-client.ts
import { createAuthClient } from "better-auth/react"
export const authClient = createAuthClient()
// before: signIn("github")
await authClient.signIn.social({ provider: "github" })
Step 3: read sessions on the server
Every await auth() call becomes auth.api.getSession with the request headers. The guide also recommends doing auth checks in each page or route, not only in Proxy, and Better Auth’s Next.js docs label cookie-only checks in Proxy as suitable for optimistic redirects, not security.
import { auth } from "@/lib/auth"
import { headers } from "next/headers"
import { redirect } from "next/navigation"
export default async function DashboardPage() {
const session = await auth.api.getSession({ headers: await headers() })
if (!session) redirect("/sign-in")
return <h1>Welcome {session.user.name}</h1>
}
The nextCookies() plugin matters if you call auth functions from server actions: without it, cookies set during sign-in or sign-out are not written, and users appear to “half log in”.
What Changes in Your Database Schema?
If you used JWT sessions in Auth.js with no database adapter, the data migration is small. If you used a database adapter, this is where most of the work and risk sits.
Table-by-table differences
- User:
name,emailandemailVerifiedare required in Better Auth;emailVerifiedbecomes a boolean instead of a timestamp;createdAtandupdatedAtare added. - Session:
sessionTokenbecomestoken,expiresbecomesexpiresAt, andipAddressanduserAgentare added. - Account: camelCase columns (
refreshTokennotrefresh_token),providerIdplusaccountIdinstead ofproviderandproviderAccountId, notype,token_typeorsession_state, and apasswordcolumn. - VerificationToken becomes Verification, with a single
idkey and avaluecolumn.
The credentials trap
The guide flags one step as critical. Many Auth.js apps store password hashes on the User row. Better Auth expects them in the Account table: one account row per user with providerId set to credential and accountId set to the user’s id. Skip this and every password user fails to sign in after cutover. Also confirm your existing hash format is one Better Auth can verify, or plan a rehash-on-login step.
Generate, migrate, then backfill
# generate the Better Auth schema for your ORM (Prisma, Drizzle) or SQL
npx auth@latest generate
# or apply it directly with the built-in Kysely adapter
npx auth@latest migrate
Create the new tables alongside the old ones, write an idempotent backfill script, and run it against a copy of production first. Existing sessions will not carry over cleanly, so schedule the cutover when you can accept everyone signing in once more, and say so in your release notes.
A staged rollout plan
For anything beyond a small internal tool, avoid a single big-bang release. A sequence that works well: first ship the new tables and the backfill job with no user-facing change, and run the backfill repeatedly until it is clean and fast. Second, put the Better Auth handler behind a feature flag and sign in your own team through it in production for a few days. Third, switch new sign-ins to Better Auth while old sessions continue to be read by the old code until they expire. Finally, remove the Auth.js code and drop the old tables only after a full session lifetime has passed with no errors. Track sign-in success rate, password reset volume and support tickets at each step; a sudden change in any of them is your signal to pause.

What Does the Vercel Deal Mean for Your Auth?
Whenever an open source project joins a platform company, the fair question is whether it stays neutral. Here is what is on the record, and what to watch.
What has been stated
The announcement commits to keeping auth “open source, framework and platform agnostic”. The npm package is MIT licensed, and the docs continue to cover non-Vercel setups and adapters for the major databases. Nothing in the library requires Vercel hosting: it runs wherever your Node.js or Workers code runs, and stores data in your own database.
Where the commercial layer sits
Better Auth also offers Better Auth Infrastructure, described as an enterprise-grade dashboard, security and managed services layer. It connects through a dash() plugin and adds user and session management screens, analytics, audit logs, a security plugin and managed email and SMS. That is optional. Check current pricing on the Better Auth site before relying on it, and keep in mind that your core auth keeps working without it.
How to protect yourself
Own the schema, pin versions, and read the changelog before minor upgrades, as you would with any security dependency. Because users and sessions are in your database, the exit cost from Better Auth is a code migration, not a data extraction from a vendor. That is the main structural advantage over hosted auth, and it does not change with the Vercel news.
When Is Managed Auth Still the Better Choice?
Library-based auth is not the right answer for every team. Hosted options such as Clerk, Supabase Auth or Auth0 trade control and per-user pricing for less code to own.
When a hosted service fits
Choose managed auth when you have no one on the team who wants to own security-sensitive code, when you need prebuilt sign-in UI on day one, or when you are already committed to a platform whose auth is tightly integrated with its database permissions, as with Supabase row-level security. Check each vendor’s current pricing page, because most bill by monthly active or retained users and the curve matters once you grow.
When Better Auth fits
Choose Better Auth when user data must stay in your database for contractual or architectural reasons, when per-user fees would become a meaningful cost line, or when B2B features like organizations and SSO are central to your product. The trade-off is that you own patching, monitoring and abuse protection, a responsibility we discuss in our piece on why security skills matter more for developers now.
Pros and Cons of Better Auth
Pros
- Actively developed, with Auth.js maintainers’ blessing and the Auth.js user base behind it.
- Built-in email and password plus plugins for 2FA, passkeys, organizations, SSO and SCIM.
- Your users and sessions live in your own database; no per-user fee for the library.
- Works across frameworks, so one auth layer can serve several frontends.
- CLI generates schema for Prisma, Drizzle or plain SQL.
Cons
- Migration from Auth.js with a database adapter needs a schema change and a careful backfill.
- Fast release pace means you should read changelogs and test upgrades.
- You own security operations: patching, rate limits, monitoring and incident response.
- Corporate backing is new; its long-term roadmap under Vercel is still taking shape.
Frequently Asked Questions
Is NextAuth.js deprecated?
Not formally. Auth.js is maintained by the Better Auth team, which has committed to security patches and urgent fixes, and the npm package last shipped versions 4.24.15 and 5.0.0-beta.32 on July 20, 2026. What has changed is the direction: new features and new framework work go into Better Auth, and the maintainers strongly recommend Better Auth for new projects. Treat NextAuth as a stable, maintenance-mode dependency. It is safe to keep in a working app, but a weak choice for a new build, because you would be starting on a library whose own maintainers point you elsewhere.
Does Better Auth only work on Vercel or with Next.js?
No. Better Auth is a TypeScript library that runs inside your own server code and stores data in your own database, with adapters for PostgreSQL, MySQL, SQLite, MS SQL, Prisma, Drizzle and MongoDB. The client supports React, Vue, Svelte and other frameworks. Joining Vercel came with a public commitment to stay framework and platform agnostic, and the docs still cover other hosts. You can run it in a Docker container, on a Node.js server, or on serverless platforms. As with any library, test it on your actual hosting target, particularly cookie behavior behind proxies and CDNs.
Will users have to sign in again after migrating?
Plan for yes. Session tables and cookie formats differ between the two libraries, so the simplest safe approach is to migrate users and accounts, then let existing sessions expire and ask everyone to sign in once. OAuth users simply click their provider again and Better Auth links them to the migrated account. Password users keep their passwords if you moved the hashes into the account table correctly and the hash format is supported. Announce the change in advance, schedule it during low traffic, and keep the old auth code on a branch so you can roll back quickly if sign-in error rates jump.
How long does an Auth.js to Better Auth migration take?
For an app using only OAuth with JWT sessions, a developer can usually complete the code change and tests in two to four days. With a database adapter, credentials users and custom callbacks, expect one to three weeks including the schema migration, backfill testing on a production copy and a staged cutover. The biggest variable is how much custom logic sits in Auth.js callbacks, such as adding roles to the session token, because each callback must be re-expressed as Better Auth configuration, hooks or plugins. Write sign-in, sign-out and permission tests before you start; they are what make the cutover safe.
Conclusion
The Auth.js and Better Auth story has a clear ending: one team, one recommended library, and Auth.js in maintenance mode. For new projects, start with Better Auth. For existing NextAuth apps, there is no fire to put out; migrate when your roadmap needs organizations, 2FA, passkeys or SSO, and budget most of the effort for the schema and credentials backfill rather than the code. If you are planning auth as part of a wider SaaS build, our guide to building a SaaS product covers how auth decisions interact with billing, tenancy and permissions.
Building or migrating authentication for your product? Talk to Lycore. Our offshore team plans and runs auth migrations at USD 25 per hour, as a fixed-price project or on a monthly retainer, and you can see the kind of sign-in and permission rules we build in LyCare.


