better-auth

Implement authentication and authorization in TypeScript apps using Better Auth across multiple frameworks.

Updated Feb 2, 2026
One-click install
npx skills add https://github.com/vuminhieu/spexor-client --skill better-auth-vuminhieu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: better-auth
Source: https://github.com/vuminhieu/spexor-client/tree/main/.agent/skills/skills/better-auth
Command: npx skills add https://github.com/vuminhieu/spexor-client --skill better-auth-vuminhieu

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Better Auth provides a framework-agnostic authentication and authorization solution for TypeScript applications, enabling secure user management across frameworks and stacks.

Core Features & Use Cases

  • Built-in support for email/password authentication with verification, OAuth providers, two-factor authentication (2FA), and WebAuthn/passkeys.
  • Role-based access control (RBAC), session management, rate limiting, and multiple database adapters for flexible persistence.
  • Use cases include building secure login flows in web apps, SaaS platforms with multiple roles, and multi-tenant setups across modern frontends (React, Next.js, Nuxt, SvelteKit, Express, etc.).

Quick Start

Install Better Auth in your project, configure an auth.ts using betterAuth with your chosen database adapter and plugins, create a .env file with credentials, generate migrations, and mount the API handler in your framework.

Frequently Asked Questions about better-auth

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

FAQPage Schema
How do I implement TypeScript authentication across multiple frameworks?

Role-based access control (RBAC) in TypeScript applications is configured through the authentication library's built-in RBAC features. You define roles and permissions directly in your auth setup to manage secure user access for SaaS platforms and multi-tenant environments.

Does this TypeScript authentication library support WebAuthn and passkeys?

Yes, this TypeScript authentication library fully supports WebAuthn and passkeys. It provides built-in mechanisms for passwordless login, two-factor authentication (2FA), and standard OAuth providers alongside traditional email and password flows.

How do I set up OAuth providers and session management in a TypeScript web app?

OAuth providers and session management are set up by configuring an auth.ts file using the betterAuth function. You install the library, define your chosen database adapter and plugins, add credentials to a .env file, and generate database migrations.

What is the best way to add 2FA and rate limiting to a SaaS platform?

The best way to add 2FA and rate limiting to a SaaS platform is using a framework-agnostic TypeScript authentication solution. It provides built-in two-factor authentication, rate limiting, and multiple database adapters for secure, scalable user management.

Can I use a single authentication solution for React, Next.js, and Express?

Yes, you can use a single framework-agnostic authentication solution for React, Next.js, and Express. It provides server and client setup patterns, environment configuration, and schema generation workflows that adapt across modern frontend stacks.