better-auth

Implement authentication and authorization for TypeScript apps across frameworks.

Updated Jun 16, 2025
One-click install
npx skills add https://github.com/Stonelukas/Mouse-on-Numpad --skill better-auth-stonelukas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: better-auth
Source: https://github.com/Stonelukas/Mouse-on-Numpad/tree/main/.opencode/skill/better-auth
Command: npx skills add https://github.com/Stonelukas/Mouse-on-Numpad --skill better-auth-stonelukas

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Building authentication and authorization for TypeScript apps is complex, error-prone, and framework-dependent, requiring boilerplate, security considerations, and ongoing maintenance.

Core Features & Use Cases

  • Built-in email/password authentication with optional email verification and password reset.
  • Built-in social OAuth providers (GitHub, Google, Discord, etc.) with provider configuration, sessions, and RBAC to support multi-user apps.
  • Plugin ecosystem for advanced features such as two-factor authentication (2FA), passkeys/WebAuthn, magic links, organization management, rate limiting, and comprehensive session management.
  • Multi-tenant support and RBAC to manage roles, teams, and permissions across organizations.

Quick Start

Install the Better Auth package in your project, configure a database adapter and environment variables, select the authentication methods you need, 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 with OAuth and RBAC?

TypeScript authentication with OAuth and RBAC is implemented via a framework-agnostic solution covering social providers, email/password, and role-based access control across Next.js, Nuxt, SvelteKit, Remix, and Express.

Can I add passkeys and two-factor authentication to my Express or Next.js app?

Passkeys and two-factor authentication are added through a plugin ecosystem supporting WebAuthn, 2FA, and magic links, integrating directly with Next.js, Express, SvelteKit, Remix, and Nuxt frameworks.

Does this framework-agnostic authentication solution support multi-tenant organizations?

Multi-tenant organization support is included natively, providing RBAC to manage teams, roles, and permissions across multiple organizations within a single TypeScript application environment.

What's the best way to handle session management across different TypeScript frameworks?

Session management across TypeScript frameworks is handled using built-in server and client integrations with environment-driven configuration, eliminating framework-specific boilerplate for Next.js, Nuxt, SvelteKit, and Express.

How do I set up database migrations for a TypeScript authentication system?

Database migrations for the TypeScript authentication system are executed using built-in schema migration tools, requiring a configured database adapter and environment variables before mounting the API handler.