better-auth

Configure Better Auth authentication and authorization for TypeScript web applications.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pytest, pytest-cov, pytest-mock, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill reduces the complexity of implementing secure authentication and authorization in TypeScript applications by providing guided configuration for identity providers, sessions, databases, and advanced security features.

Core Features & Use Cases

  • Authentication Setup: Configure email/password authentication, OAuth providers, email verification, password resets, and account management.
  • Advanced Security: Add two-factor authentication, passkeys/WebAuthn, magic links, rate limiting, session controls, and organization-based access.
  • Database Integration: Connect Better Auth to PostgreSQL, MySQL, SQLite, MongoDB, Drizzle, Prisma, or Kysely and generate the required schema.
  • Use Case: Configure a Next.js enterprise application with PostgreSQL-backed sessions, GitHub and Google login, protected routes, organization membership, and administrator 2FA.

Quick Start

Use the better-auth skill to configure authentication for my TypeScript application with email/password login, Google OAuth, secure sessions, and a PostgreSQL database.

Frequently Asked Questions about better-auth

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

FAQPage Schema
How do I configure TypeScript authentication with OAuth and passkeys?

Yes, Better Auth supports enterprise multi-tenant organizations by configuring organization-based access controls, role management, and administrator two-factor authentication. You can secure multi-tenant applications using PostgreSQL or MySQL database adapters to manage membership and protected routes.

Can I use Better Auth with PostgreSQL and Prisma for session management?

Yes, Better Auth connects to PostgreSQL using Prisma, Drizzle, or Kysely database adapters to manage session controls. It generates the required database schema automatically to handle secure session management and user authentication data persistence.

How do I add two-factor authentication to a Next.js application?

Better Auth works with Next.js, Nuxt, SvelteKit, Remix, Astro, Hono, and Express frameworks to implement secure TypeScript authentication. It supports framework-specific integration for email/password logins, OAuth providers, and session management across these platforms.

Do I need to generate a database schema when setting up email and password login?

Yes, you need to generate a database schema when setting up email and password login to store user credentials and session data securely. Better Auth requires connecting a database adapter like SQLite or MongoDB and generating the schema before enabling authentication features.