better-auth

Integrate Better Auth into TypeScript applications for email/password, OAuth, sessions, and 2FA.

Updated Mar 7, 2026
One-click install
npx skills add https://github.com/MinhHoangDono/antigravity-kit --skill better-auth-minhhoangdono
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: better-auth
Source: https://github.com/MinhHoangDono/antigravity-kit/tree/main/.agent/skills/better-auth
Command: npx skills add https://github.com/MinhHoangDono/antigravity-kit --skill better-auth-minhhoangdono

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you implement secure, framework-agnostic authentication in TypeScript so you can avoid reinventing login, sessions, and security-critical flows.

Core Features & Use Cases

  • Email/password authentication for signup and login with session-based protection.
  • OAuth social login (e.g., GitHub) to let users authenticate with existing accounts.
  • Advanced auth options including 2FA/MFA and passkeys/WebAuthn, plus multi-tenant organization support.
  • Use Case: Build an app where users can sign in with email or GitHub, optionally enable 2FA, and access role-based/protected routes with rate-limited sign-in.

Quick Start

Tell the agent to generate the Better Auth server setup for your TypeScript backend, including required environment variables, an auth.ts configuration, and the CLI commands to generate and run migrations.

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 app with email, password, and OAuth?

To add TypeScript authentication, integrate Better Auth to configure email/password login alongside social OAuth providers like GitHub, securing your application through session-based protection.

What is the best way to set up 2FA and passkeys in a Next.js or Express backend?

Setting up 2FA and passkeys in Next.js or Express involves mounting a framework-specific request handler with an advanced authentication library like Better Auth to enable WebAuthn flows.

Does Better Auth work with Hono and other TypeScript frameworks?

Yes, Better Auth works with Hono, Next.js, and Express by mounting framework-specific request handlers onto your server configuration to process secure authentication workflows.

How do I generate and run database migrations for a TypeScript authentication setup?

To generate and run authentication database migrations, use the Better Auth CLI commands after establishing your server configuration and database integration to finalize the schema.

Do I need environment variables to configure sessions and secrets for TypeScript auth?

Yes, configuring TypeScript auth sessions requires env-driven secrets within your Better Auth server configuration to securely manage environment variables and protect user sessions.