Skip to main content
skill CX Codex

authjs-skills — Claude Code skill: Auth.js v5 setup for Next.js

An agent skill that walks through Auth.js v5 authentication in Next.js: Google OAuth, email and password sign-in, environment variables.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add gocallum/nextjs16-agent-skills --skill authjs-skills -a claude-code
Open on GitHub

What authjs-skills does

The skill covers installing and wiring Auth.js v5 into a Next.js project. It walks through creating auth.ts at the project root, the route handler at app/api/auth/[...nextauth]/route.ts, and an optional middleware.ts. Separate sections handle the Google provider and the credentials provider.

Google sign-in needs AUTH_GOOGLE_ID and AUTH_GOOGLE_SECRET from Google Cloud Console, plus an AUTH_SECRET. You can generate the secret with openssl rand -base64 32 or pnpm dlx auth secret, and the skill tells you to keep it in .env.local rather than in version control.

Install the package as pnpm add next-auth@beta. Auth.js v5 is in beta, so skipping the @beta tag pulls v4 and a different API. The credentials path also wants bcryptjs and zod. Migrating an existing v4 app? The config shape and the auth() export changed, so check the migration guide instead of copying your old setup.

What it helps with

  • add Google sign-in to a Next.js app
  • build an email and password form with bcrypt hashing
  • protect /dashboard and /profile routes with middleware
  • keep auth config in one auth.ts instead of scattered files
  • generate AUTH_SECRET and organise environment variables in .env.local

Example prompts for the agent

  • set up Auth.js v5 in this Next.js project
  • add the Google OAuth provider to auth.ts
  • configure middleware to redirect signed-out users to /auth/signin

How to install authjs-skills

1Skills CLI (Vercel)

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

2Manually: put the files in place

~/.claude/skills/authjs-skills/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/authjs-skills/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about authjs-skills

How do I install authjs-skills in Claude?

Run npx skills add gocallum/nextjs16-agent-skills --skill authjs-skills -a claude-code. The skill lands at ~/.claude/skills/authjs-skills/SKILL.md.

What does authjs-skills do?

It guides the agent through Auth.js v5 setup in Next.js: auth.ts config, the route handler, middleware, the Google and Credentials providers, and environment variables.

What do I need before using it?

A Next.js project and next-auth@beta installed. Google sign-in requires AUTH_GOOGLE_ID and AUTH_GOOGLE_SECRET; the credentials provider needs bcryptjs and zod.

Similar skills

All skills for Backend and APIs →

From the same set3

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor