better-auth

Implement authentication and authorization in TypeScript applications.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Better Auth provides a comprehensive, framework-agnostic authentication/authorization system for TypeScript applications, unifying email/password, OAuth, 2FA, passkeys, session management, RBAC, rate limiting, and a plugin ecosystem to accelerate secure auth integration.

Core Features & Use Cases

  • Built-in email/password with optional verification, password reset, and session management
  • OAuth providers and token management for social sign-in across frameworks (Next.js, Nuxt, Express, etc.)
  • Advanced security features: two-factor authentication (TOTP), passkeys/WebAuthn, magic links, and RBAC for multi-tenant apps
  • Real-world scenarios include SaaS apps needing flexible login methods, device-based sessions, and role-based access control

Quick Start

Install better-auth, configure a server with a database, enable the desired auth methods, and mount the API handler.

Frequently Asked Questions about better-auth

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

FAQPage Schema
How do I implement authentication and authorization in a TypeScript web app?

Authentication and authorization in TypeScript apps can be implemented using a framework-agnostic system that unifies email/password, OAuth, 2FA, passkeys, and session management. You install the library, configure a database adapter, enable desired auth methods, and mount the API handler.

Can I use better-auth with frameworks like Next.js, Nuxt, SvelteKit, or Express?

Yes, this authentication system works across Next.js, Nuxt, SvelteKit, and Express. It is entirely framework-agnostic, allowing you to integrate secure login methods and session management into your existing TypeScript application stack without framework lock-in.

What is the best way to add passkeys and WebAuthn to my existing sessions?

The best way to add passkeys and WebAuthn is using a TypeScript auth library with built-in advanced security features. It natively supports WebAuthn integration alongside existing session management, allowing passwordless device-based authentication without custom cryptographic implementations.

Does this authentication library support multi-tenant role-based access control?

Yes, the authentication library supports multi-tenant applications through built-in Role-Based Access Control (RBAC). This allows you to define granular user permissions and manage device-based sessions across different organizational tenants within your SaaS application.

How do I configure OAuth providers for social sign-in across different frameworks?

OAuth providers for social sign-in are configured by enabling the desired auth methods in your server setup. The system handles token management and OAuth integration natively across frameworks like Next.js and Express, streamlining social login configuration.

When do I need a CLI workflow for database migrations in TypeScript authentication?

You need a CLI workflow for database migrations when initializing or updating your auth configuration. The CLI generates the necessary database schemas and migration files, ensuring your multi-database adapters correctly map user identities, sessions, and OAuth tokens to your specific database structure.