Definitive Guide to Setting up Auth.js in Next.js 15
Step-by-step tutorial on configuring Auth.js (NextAuth) with the Prisma adapter in a Next.js 15 App Router project.
Last Updated • 7/2/2026
Introduction
Authentication is hard. Auth.js (formerly NextAuth.js) makes it easier. In this guide, we'll set up Auth.js with GitHub and Google providers in a modern Next.js 15 App Router project.
Prerequisites
- Next.js 15 project
- PostgreSQL database (Neon or local)
- Prisma ORM
Step 1: Installation
First, install the core package and the Prisma adapter:
npm install next-auth @auth/prisma-adapter
Step 2: Configuration
Create the auth.ts config file at the root of your application.
Conclusion
You now have robust, edge-compatible authentication.
Guide FAQ
Can I use Auth.js at the edge?
Yes, but you need an edge-compatible database driver or you should split your auth config to avoid initializing the Prisma Client on the edge.