A set of reusable utilities for NextAuth.js, including OAuth callback handlers, session management, and Cognito integration. Current stable version 0.0.153. Released frequently (multiple versions per week) but still in early development. Key differentiators: provides pre-built NextAuth adapters and helpers for common providers, with TypeScript types included. Minimal documentation and limited community adoption; use with caution in production.
npm install ag-common-next-authVerified import paths — ran on the pinned version, not inferred.
Shows how to use OAuthCallback handler with Cognito provider, including environment variable fallbacks.
Ensure both variables are defined in your deployment environment (Vercel, etc.).
Update imports: replace `OAuthHandler` with `OAuthCallback`.
Replace `validateSession()` with `checkEnvironment()`.
Import from 'ag-common-next-auth/providers/cognito'.
Use ES import syntax; if using Node.js <14, upgrade or use dynamic import().
Use `import { OAuthCallback } from 'ag-common-next-auth'`Add them to your .env file or hosting environment.