nextauth
Installation
SKILL.md
NextAuth.js (Auth.js)
NextAuth (evolving into Auth.js) is a complete open-source authentication solution. It is designed to work with any OAuth service, supports email/passwordless, and owns your data (Database Adapters).
When to Use
- Data Ownership: You want to own the User/Session data in your own Database (Postgres, Prisma) rather than an external provider.
- Cost: It's free/open-source. No MAU limits.
- Flexibility: You need custom providers or complex session strategies.
Quick Start (Next.js App Router - v5 Beta)
// auth.ts
import NextAuth from "next-auth";
import GitHub from "next-auth/providers/github";