This is a practical Auth.js v5 implementation guide covering Google OAuth and credentials-based authentication for Next.js apps. It walks through the full setup from environment variables to middleware configuration, including proper password hashing with bcrypt and session management. The skill focuses on the App Router pattern and includes both providers configured in a single auth.ts file, which is the current v5 approach. Useful if you're migrating from v4 or starting fresh and need working examples of the authorize callback, protected routes, and custom sign-in pages. The credentials section is more complete than most guides, with actual Zod validation and database lookups instead of placeholder comments.

skills.sh installs
797
GitHub stars
23
last updated
Aug 21, 2026

Install

$ npx -y skills add gocallum/nextjs16-agent-skills --skill authjs-skills --agent claude-code

Installs into .claude/skills of the current project.

Files

Links

Installation

pnpm add next-auth@beta

Note: Auth.js v5 is currently in beta. Use next-auth@beta to install the latest v5 version.

What's New in Auth.js v5?

Key Changes from v4

  • Simplified Configuration: More streamlined setup with better TypeScript support
  • Universal auth() Export: Single function for authentication across all contexts
  • Enhanced Security: Improved CSRF protection and session handling
  • Edge Runtime Support: Full compatibility with Edge Runtime and middleware
  • Better Type Safety: Improved TypeScript definitions throughout

Environment Variables

Required Environment Variables

Sponsors

Details

Repository
github.com/gocallum/nextjs16-agent-skills
Categories
Frontend Development, Backend & APIs, Security, AI & Agent Building
First seen
May 16, 2026

More from gocallum/nextjs16-agent-skills

All 9
1aklofas avatarbomaklofas/kicad-happyBOM (Bill of Materials) management for electronics projects — the workflow skill that coordinates DigiKey, Mouser, LCSC, element14, JLCPCB, PCBWay, and KiCad sk795skills.sh installs
2signerlabs avatarbuild-featuresignerlabs/shipswift-skillsBuild an iOS feature using ShipSwift component recipes. Use when the user says "build", "create", "add a feature", or describes an iOS feature they want to impl784skills.sh installs
3adobe avatarappbuilder-action-scaffolderadobe/skillsCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add768skills.sh installs
4product-on-purpose avatarutility-slideshow-creatorproduct-on-purpose/pm-skillsGenerates professional presentations from a JSON deck specification using 18 slide types with dark/light variants, content-to-layout decision logic, and calibra764skills.sh installs
5kostja94 avatarhowto-section-generatorkostja94/marketing-skillsWhen the user wants to create, optimize, or audit a HowTo section block—an in-page block of ordered steps with optional Schema.org HowTo JSON-LD. Also use when 763skills.sh installs
6product-on-purpose avatarfoundation-lean-canvasproduct-on-purpose/pm-skillsProduces a one-page lean canvas across nine interlocking blocks (problem, customer, UVP, solution, channels, revenue, cost, metrics, unfair advantage) with opti762skills.sh installs