better-auth

Implement authentication and authorization with Better Auth in Node.js.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This skill helps developers quickly implement secure authentication and authorization for web applications.

Core Features & Use Cases

  • Email/password authentication with optional verification and password reset
  • OAuth providers for popular identities
  • Two-factor authentication (2FA), passkeys/WebAuthn, and magic links
  • Session management, RBAC, rate limiting, and multi-database adapters
  • Framework-agnostic integration across Next.js, Nuxt, SvelteKit, Remix, Express, and more
  • Real-world scenarios: you’re building a multi-tenant app with secure user lifecycles and role-based access

Quick Start

  1. Install the library: npm install better-auth
  2. Create a basic server config using betterAuth({ emailAndPassword: { enabled: true } })
  3. Mount the API handler in your framework and generate migrations if using a DB

Frequently Asked Questions about better-auth

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

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

Secure authentication and authorization in TypeScript web apps can be implemented using a framework-agnostic library to configure email/password logins, OAuth providers, 2FA, and RBAC. You install the package, create a server config, and mount the API handler.

Can I add passkeys and WebAuthn to my existing authentication flow?

Yes, you can add passkeys and WebAuthn to your authentication flow alongside 2FA, magic links, and OAuth providers. This provides secure passwordless options while maintaining existing session management and RBAC configurations.

Does framework-agnostic authentication work with Next.js and Express?

Framework-agnostic authentication works seamlessly with Next.js, Express, Nuxt, SvelteKit, and Remix. You mount the API handler in your chosen framework and generate database migrations to start managing user sessions.

What is the best way to handle multi-tenant user lifecycles and role-based access?

Handling multi-tenant user lifecycles and role-based access is best achieved using a library with built-in RBAC and session management. This allows you to define roles and securely manage user states across multiple tenants without custom logic.

How do I set up OAuth providers and email/password login with rate limiting?

To set up OAuth providers and email/password login with rate limiting, configure your server instance with emailAndPassword enabled, add your OAuth identities, and activate the built-in rate limiting features to secure the endpoints.

Do I need a specific database to manage sessions and authentication data?

No specific database is required because the library supports multi-database adapters. You can connect your preferred database, generate the necessary migrations, and manage sessions and authentication data across any supported Node.js environment.