better-auth

Configure authentication and authorization for TypeScript applications across frameworks.

Updated Jan 13, 2026
One-click install
npx skills add https://github.com/danielctc/ReactSpacesMonoRepo --skill better-auth-danielctc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: better-auth
Source: https://github.com/danielctc/ReactSpacesMonoRepo/tree/main/.claude/skills/better-auth
Command: npx skills add https://github.com/danielctc/ReactSpacesMonoRepo --skill better-auth-danielctc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Developers need to add secure authentication and authorization across frameworks without tying to a single stack, while supporting modern features like OAuth, 2FA, RBAC, and session management.

Core Features & Use Cases

  • Framework-agnostic authentication/authorization for TypeScript apps with support for email/password, social OAuth, RBAC, and multi-tenant setups.
  • Plugins and adapters enable seamless integration with Next.js, Nuxt, SvelteKit, Express, and other frameworks, plus database backends like Drizzle, Prisma, Kysely, and MongoDB.
  • Use Case: Rapidly add secure login flows to a SaaS product with multiple teams and roles, while keeping codebase framework-agnostic.

Quick Start

Install the better-auth package, configure your database adapter and environment variables, generate the auth config via the CLI, and mount the API handler in your framework. Then run migrations and start your dev server. For example, install, run the interactive initializer, set BETTER_AUTH_SECRET and BETTER_AUTH_URL, and integrate the generated auth.ts into your app.

Frequently Asked Questions about better-auth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add framework-agnostic authentication to a TypeScript app?

OAuth providers and 2FA are supported through optional plugins. You can enable these advanced features after configuring your base authentication setup and database adapter for your TypeScript application.

Can I use Prisma or Drizzle for session management with TypeScript auth?

Prisma, Drizzle, Kysely, and MongoDB are all supported database adapters for session management. You select your preferred adapter during configuration to store authentication and authorization data securely.

What's the best way to set up RBAC and multi-tenant authorization in TS?

Yes, you can integrate authentication with Next.js, Nuxt, SvelteKit, and Express using dedicated plugins. These plugins enable seamless mounting of the API handler within your chosen framework's architecture.

How do I initialize auth and configure environment variables for a TS app?

You initialize authentication by running the interactive CLI initializer, setting the BETTER_AUTH_SECRET and BETTER_AUTH_URL environment variables, and running migrations. This generates an auth.ts file to integrate into your app.