better-auth

Implement authentication and authorization for TypeScript applications with database adapters.

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

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 and authorization solution for TypeScript applications, reducing the complexity of implementing secure user management across stacks.

Core Features & Use Cases

  • Built-in email/password authentication with verification flows and password reset.
  • Social OAuth support (Google, GitHub, Discord, etc.) with account linking and multi-provider sign-in.
  • Advanced security features (2FA totp, passkeys/WebAuthn, magic links) and rate limiting.
  • Session management, RBAC, multi-tenant capabilities, and framework-agnostic adapters for major databases.
  • Extensible with adapters (SQLite, PostgreSQL, MySQL, MongoDB, Prisma, Drizzle, Kysely) to fit diverse ecosystems.

Quick Start

Install Better Auth in your project, configure a database adapter and environment variables, and mount the API hooks to enable end-to-end authentication flows.

Frequently Asked Questions about better-auth

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

FAQPage Schema
How do I add authentication to a TypeScript web app?

To add authentication to a TypeScript web app, implement a framework-agnostic layer covering email/password, OAuth, sessions, and RBAC. This requires configuring a database adapter and environment variables, with optional plugins for 2FA, passkeys, and magic links.

Does framework-agnostic TypeScript authentication support PostgreSQL and Prisma?

Framework-agnostic TypeScript authentication supports PostgreSQL, MySQL, MongoDB, and SQLite through database adapters. It integrates directly with Prisma, Drizzle, and Kysely to map sessions and users across diverse database ecosystems.

How do I set up 2FA and passkeys for user login in TypeScript?

To set up 2FA and passkeys for user login in TypeScript, extend a base authentication configuration with dedicated plugins. These optional plugins add WebAuthn passkey support and TOTP two-factor verification flows to the core session management system.

Can I implement multi-tenant authorization and RBAC in a TypeScript application?

You can implement multi-tenant authorization and RBAC in a TypeScript application using a framework-agnostic auth layer. It provides built-in role-based access control and multi-tenant capabilities to manage user permissions across different organizational boundaries.

How do I configure social OAuth providers like Google and GitHub in TypeScript?

To configure social OAuth providers like Google and GitHub in TypeScript, set up provider credentials as environment variables within a framework-agnostic auth layer. This enables account linking and multi-provider sign-in alongside standard email/password flows.

What database setup is required before implementing TypeScript authentication?

Before implementing TypeScript authentication, you must configure a database adapter for systems like PostgreSQL, MySQL, or SQLite. You also need to define required environment variables for OAuth providers and email verification to enable full authentication flows.