From fuse-nextjs
Complete Better Auth - 40+ OAuth providers, 20+ plugins, all adapters, all frameworks. Use when implementing authentication, login, OAuth, 2FA, magic links, SSO, Stripe, SCIM, or session management.
How this skill is triggered — by the user, by Claude, or both
Slash command
/fuse-nextjs:better-authThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
TypeScript-first authentication library with 40+ OAuth providers and 20+ plugins.
meta.jsonreferences/adapters/community-adapters.mdreferences/adapters/drizzle.mdreferences/adapters/mongodb.mdreferences/adapters/prisma.mdreferences/adapters/sql-databases.mdreferences/api.mdreferences/basic-usage.mdreferences/cli.mdreferences/client.mdreferences/comparison.mdreferences/concepts/cookies.mdreferences/concepts/database.mdreferences/concepts/oauth.mdreferences/concepts/plugins.mdreferences/concepts/security.mdreferences/concepts/sessions.mdreferences/concepts/users.mdreferences/email.mdreferences/errors.mdTypeScript-first authentication library with 40+ OAuth providers and 20+ plugins.
Before ANY implementation, use TeamCreate to spawn 3 agents:
After implementation, run fuse-ai-pilot:sniper for validation.
| Feature | Benefit |
|---|---|
| Framework agnostic | Next.js, SvelteKit, Nuxt, Remix, Astro, Expo, NestJS |
| Plugin architecture | Add only the features you need (20+ plugins) |
| Full TypeScript | End-to-end type safety, inference included |
| Self-hosted | Your data stays on your infrastructure |
| Database flexible | Prisma, Drizzle, MongoDB, PostgreSQL, MySQL, SQLite |
| Enterprise ready | SSO, SCIM, organizations, audit logs |
Google, GitHub, Discord, Apple, Microsoft, Slack, Spotify, Twitter/X, Facebook, LinkedIn, GitLab, Bitbucket, Dropbox, Twitch, Reddit, TikTok, and 25+ more documented in providers/.
| Plugin | Purpose |
|---|---|
| 2FA | TOTP authenticator, backup codes |
| Magic Link | Passwordless email login |
| Passkey | WebAuthn biometric authentication |
| Organization | Multi-tenant, roles, invitations |
| SSO | Enterprise SAML/OIDC single sign-on |
| SCIM | Directory sync, user provisioning |
| Stripe | Subscription billing integration |
| API Key | Machine-to-machine authentication |
| JWT/Bearer | Token-based API authentication |
Prisma, Drizzle, MongoDB, raw SQL (PostgreSQL, MySQL, SQLite), and community adapters.
Components organized in modules/auth/ following separation of concerns:
betterAuth configuration and initializationcreateAuthClient for client-side auth stateapp/api/auth/[...all]/route.ts handlerproxy.ts for route protection (replaces middleware)| Need | Reference |
|---|---|
| Initial setup | installation.md, server-config.md |
| Client usage | client.md, session.md |
| OAuth providers | providers/overview.md, individual provider docs |
| Add plugins | plugins/overview.md, individual plugin docs |
| Database setup | adapters/prisma.md, adapters/drizzle.md |
| Enterprise SSO | plugins/sso.md, guides/saml-okta.md |
| Payments | plugins/stripe.md, plugins/polar.md |
| Migration | guides/clerk-migration.md, other migration guides |
| Complete examples | examples/ for full implementations |
Core concepts explained in concepts/:
npx claudepluginhub fusengine/agents --plugin fuse-nextjsIntegrates Better Auth TypeScript authentication for Cloudflare D1 via Drizzle/Kysely, Next.js, Nuxt, and 15+ frameworks. Use for auth setup, D1 adapter errors, OAuth/2FA/RBAC.
Integrates Better Auth with NestJS backends and Next.js App Router frontends using Drizzle ORM and PostgreSQL. Covers database setup, social logins, 2FA, organizations, passkeys, and protected routes.
Use when adding authentication or login to any app - detects your stack (React, Next.js, Vue, Nuxt, Angular, Express, Fastify, FastAPI, ASP.NET Core, React Native, Expo, Android, Swift), sets up an Auth0 account if needed, and routes to the correct SDK setup workflow.