Auth.js
Authjs (open source)Open-source auth library for Next.js (formerly NextAuth.js), now framework-agnostic. OAuth providers, sessions, JWT — you own the database and the UI.
- Auth is a load-bearing part of your app and you want to own the database, schema, and UI.
- Per-MAU pricing doesn't fit your business model — high-volume free users, for instance.
- Your auth needs are conventional (social + email) and you don't need B2B / SSO features.
- You're philosophically uncomfortable with users-as-a-service for your core product.
- Engineering time is cheaper for you than $1k+/mo at scale — typical for early-stage and indie.
- B2B features (organizations, SSO, RBAC, invitations) are core to the product — you'd build it all from scratch.
- Hosted UI components matter — Auth.js gives you the logic, you write the JSX.
- You'd rather not own the auth surface area at all (security audits, password storage, session revocation).