Authentication
Auth.js icon

Auth.js

Free, self-hosted OAuth/credentials auth for Next.js and other frameworks (formerly NextAuth). Still fine for existing projects, though its own maintainers now point new projects toward Better Auth.

What is Auth.js?

Auth.js (formerly NextAuth) is a free, self-hosted authentication library covering OAuth providers and credentials-based login for Next.js and a growing list of other frameworks. It's been the default auth answer in the Next.js ecosystem for years, though its own maintainers now steer new projects toward Better Auth as the actively recommended path forward.

Key features

  • Wide OAuth provider support (Google, GitHub, and dozens more) configured declaratively
  • Credentials provider for email/password or custom auth flows when OAuth alone isn't enough
  • Database adapters for most common databases and ORMs to persist sessions and users
  • Framework support beyond Next.js, including SvelteKit and Express
  • No third-party service dependency, everything runs in your own app and database

Who it's for

Reasonable to keep using on an existing project already built around it. For a new project, the maintainers' own guidance points elsewhere, worth at least comparing against Better Auth before committing.

Pricing

Free and open source, no hosted service or paid tier.