/fuse-nextjs:better-authfrom fuse-nextjs
Implements Better Auth authentication in Next.js — OAuth, 2FA, magic links, SSO, Stripe billing, and session management.
Ships in fuse-nextjs. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Covers the full surface — 40+ OAuth providers (Google, GitHub, Discord, Apple, Microsoft, and more), 20+ plugins (2FA, magic links, passkeys, organizations/multi-tenant, enterprise SSO/SAML, SCIM provisioning, Stripe/Polar billing, JWT/Bearer, API keys), and database adapters (Prisma, Drizzle, MongoDB, raw SQL). Also covers migration paths from Auth.js, Clerk, Auth0, Supabase, and WorkOS. While Better Auth itself is framework-agnostic, this skill's architecture guidance (proxy.ts, App Router API route) is Next.js-specific — for Prisma schema/query details see prisma-7.
TypeScript-first authentication library with 40+ OAuth providers and 20+ plugins.
Before ANY implementation, spawn 3 agents in parallel, one Agent call each with a name:
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 |
| Since | Change |
|---|---|
| 1.5 | Standalone CLI npx auth@latest (generate, migrate, secret, init, check…) replaces @better-auth/cli; OAuth 2.1 Provider (@better-auth/oauth-provider) |
| 1.6 | session.freshAge computed from createdAt; oidcProvider deprecated |
| 1.7 | oidcProvider removed; generic OAuth providers use signIn.social (no genericOAuthClient); DB joins via advanced.database.joins; accounts keyed on (issuer, accountId); twoFactor.enable returns a method-discriminated response; MCP → @better-auth/mcp; SCIM decoupled from organization |
After upgrading to 1.7, regenerate the schema (npx auth@latest generate) and follow the official 1.7 upgrade guide.
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/:
meta.json (opens in a new tab)references/adapters/community-adapters.md (opens in a new tab)references/adapters/drizzle.md (opens in a new tab)references/adapters/mongodb.md (opens in a new tab)references/adapters/prisma.md (opens in a new tab)references/adapters/sql-databases.md (opens in a new tab)references/api.md (opens in a new tab)references/basic-usage.md (opens in a new tab)references/cli.md (opens in a new tab)references/client.md (opens in a new tab)references/comparison.md (opens in a new tab)references/concepts/cookies.md (opens in a new tab)references/concepts/database.md (opens in a new tab)references/concepts/oauth.md (opens in a new tab)references/concepts/plugins.md (opens in a new tab)references/concepts/security.md (opens in a new tab)references/concepts/sessions.md (opens in a new tab)references/concepts/users.md (opens in a new tab)references/email.md (opens in a new tab)references/errors.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub fusengine/claude-plugins --plugin fuse-nextjs11 skills in this plugin
/nextjs-16Use when building Next.js 16 apps — Turbopack, App Router, Cache Components, proxy.ts, v15 migration. Not for stack scaffolding (nextjs-stack) or React SPA (react-expert)./nextjs-i18nUse when implementing i18n in Next.js 16 — next-intl or DIY dictionaries, locale routing, language switch, or formatters./nextjs-server-componentsUse when deciding Server vs Client Component boundaries in Next.js 16, fetching data directly in components, or streaming with Suspense./nextjs-shadcnUse when building UI components in Next.js App Router with shadcn/ui — forms, dialogs, tables, toasts, accessible components./nextjs-stackUse as the master reference for a full Next.js 16+ stack — Prisma 7, Better Auth, shadcn/ui, TanStack Form, Zustand. Not for core framework API details (use nextjs-16)./nextjs-tanstack-formUse when building forms in Next.js 16 with TanStack Form v1 — Server Actions, Zod validation, multi-step wizards, field arrays.Other plugins' skills for the same job