0PricingLogin
React Academy · Lesson

Setting Up Auth.js in Next.js App Router

Install Auth.js, configure route handlers, and add a GitHub OAuth provider.

What Is Auth.js?

Auth.js (formerly NextAuth.js v5) is a full-featured authentication library for Next.js. It handles OAuth providers, credentials, sessions, and JWT out of the box.

Installation

Install the Auth.js beta and initialize the config file.

npm install next-auth@beta

# Create auth.ts at project root
touch auth.ts

All lessons in this course

  1. Setting Up Auth.js in Next.js App Router
  2. Session Management & useSession Hook
  3. Credentials Provider & Custom Login
  4. Middleware-Based Route Protection
← Back to React Academy