@vishwanathb/vishwa-auth
v0.1.2
Published
Production-ready better-auth scaffold for Next.js (App Router, TypeScript). Auto-installs complete auth setup.
Downloads
252
Maintainers
Readme
vishwa-auth
Better-auth scaffold for Next.js - npm i vishwa-auth and get complete auth setup.
Features
- 🔐 Authentication: Email/Password, Sessions
- 🛡️ Security: Two-Factor Authentication (2FA)
- 📧 Email: Verification & Password Reset flows
- 📦 Database: Prisma with PostgreSQL (easy to switch)
- ⚛️ Client: React Hooks & Components
Quick Start
# 1. Create a Next.js app
npx create-next-app@latest my-app
cd my-app
# 2. Install the package
npm install @vishwanathb/vishwa-auth@latest
# 3. Initialize the scaffold
npx vishwa-auth init
# 4. Finalize Setup
npm install better-auth @prisma/client react-qr-code
npm install -D prisma
npx prisma generateSee SETUP.md for detailed instructions.
What's Installed
| File | Purpose |
|------|---------|
| lib/auth.ts | Server config (inc. 2FA plugin) |
| lib/auth-client.ts | React client hooks |
| app/api/auth/[...all]/route.ts | Auth API handler |
| app/(auth)/two-factor | 2FA Verification Page |
| app/(auth)/* | Login, Register, Forgot Password |
| app/dashboard/* | Protected page with 2FA settings |
| prisma/schema.prisma | DB schema with 2FA models |
License
MIT
