nextauth

Solid

NextAuth.js (Auth.js) configuration including providers, adapters, session management, callbacks, and JWT handling.

AI & Automation 814 stars 53 forks Updated today MIT

Install

View on GitHub

Quality Score: 95/100

Stars 20%
97
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# NextAuth Skill Expert assistance for implementing authentication in Next.js applications with NextAuth.js (Auth.js). ## Capabilities - Configure OAuth providers (Google, GitHub, etc.) - Set up credentials-based authentication - Implement database adapters (Prisma, Drizzle) - Handle JWT and session callbacks - Configure protected routes and middleware - Implement role-based access control ## Usage Invoke this skill when you need to: - Add authentication to Next.js app - Configure OAuth providers - Set up database sessions - Implement auth middleware - Handle user roles and permissions ## Inputs | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | providers | array | Yes | Auth providers to configure | | adapter | string | No | Database adapter (prisma, drizzle) | | sessionStrategy | string | No | jwt or database | | callbacks | array | No | Custom callbacks needed | ### Configuration Example ```json { "providers": ["google", "github", "credentials"], "adapter": "prisma", "sessionStrategy": "jwt", "callbacks": ["jwt", "session", "signIn"] } ``` ## Implementation Patterns ### Basic Configuration (App Router) ```typescript // app/api/auth/[...nextauth]/route.ts import NextAuth from 'next-auth'; import { authOptions } from '@/lib/auth'; const handler = NextAuth(authOptions); export { handler as GET, handler as POST }; // lib/auth.ts import { NextAuthOptions } from 'next-auth'; import GoogleProvider from 'next-auth/pr...

Details

Author
a5c-ai
Repository
a5c-ai/babysitter
Created
4 months ago
Last Updated
today
Language
JavaScript
License
MIT

Integrates with

Related Skills