Cookbook
Step-by-step recipes for common authentication patterns and use cases
Beginner
Next.js App Router with Google OAuth
Complete setup for Google OAuth authentication in Next.js 16 with App Router
Next.jsOAuthGoogle
Beginner
Email Magic Links with Resend
Implement passwordless authentication using email magic links and Resend
EmailPasswordlessResend
Intermediate
Multi-Provider Authentication
Support multiple OAuth providers (Google, GitHub, Microsoft) in one app
OAuthMulti-Provider
Intermediate
Protected API Routes
Secure your API routes with session validation and role-based access control
APISecurityRBAC
Advanced
MCP Agent Authentication
Enable AI agents to authenticate as users with scoped permissions
MCPAIAgents
Advanced
Custom Database Adapter
Create a custom database adapter for MongoDB or any other database
DatabaseAdapterCustom
Intermediate
Session Management with Redis
Store sessions in Redis for distributed applications and better performance
RedisSessionsPerformance
Intermediate
Social Login with Profile Sync
Sync user profiles from OAuth providers and keep them updated
OAuthProfileSync
Advanced
Two-Factor Authentication
Add TOTP-based two-factor authentication for enhanced security
2FASecurityTOTP