hs:better-auth

Implement TypeScript authentication with Better Auth covering OAuth, 2FA, passkeys, and sessions.

Updated Jul 19, 2026
One-click install
npx skills add https://github.com/Dozyboy/VSF --skill hs-better-auth-dozyboy
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: hs:better-auth
Source: https://github.com/Dozyboy/VSF/tree/main/Day2_VSF/Demo1/harness/plugins/hs/disabled-skills/better-auth
Command: npx skills add https://github.com/Dozyboy/VSF --skill hs-better-auth-dozyboy

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Building authentication from scratch in TypeScript applications is error-prone and time-consuming, especially when supporting multiple auth methods like OAuth, 2FA, and passkeys across different frameworks and databases. ## Core Features & Use Cases - Multiple Auth Methods: Configure email/password, social OAuth (GitHub, Google, Discord), magic links, passkeys/WebAuthn, and username authentication with a feature selection matrix. - Advanced Security Features: Add two-factor authentication (TOTP), organizations/multi-tenancy, rate limiting, and session management through Better Auth plugins. - Database Flexibility: Integrate with PostgreSQL, MySQL, SQLite, or MongoDB via direct connections or Drizzle, Prisma, and Kysely ORM adapters. - Use Case: You are building a Next.js SaaS app that needs GitHub OAuth login, optional 2FA for admins, and organization-based team management backed by PostgreSQL with Prisma. ## Quick Start Ask the assistant to set up Better Auth in your TypeScript project with your chosen database and authentication methods, optionally running the interactive initialization script to generate auth.ts and .env files.

Frequently Asked Questions about hs:better-auth

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

FAQPage Schema
How do I add authentication to a Next.js TypeScript app?▼

Install better-auth, create a server auth instance with your database config, and mount the handler in app/api/auth/[...all]/route.ts using toNextJsHandler. Then create a client with createAuthClient and call methods like signUp.email or signIn.social from your UI.

How do I set up GitHub or Google OAuth login with Better Auth?▼

Add the provider under socialProviders in your auth config with clientId and clientSecret from environment variables, then call authClient.signIn.social with the provider name. Register the callback URL http://localhost:3000/api/auth/callback/{provider} in your OAuth app settings.

Does Better Auth support Prisma and Drizzle ORM adapters?▼

Yes, Better Auth provides official adapters for Prisma, Drizzle, Kysely, and MongoDB, plus direct PostgreSQL, MySQL, and SQLite connections. After configuring the adapter, run npx @better-auth/cli generate to produce the schema for your ORM.

How do I add two-factor authentication or passkeys to my app?▼

Enable the twoFactor or passkey plugins on both the server and client, then regenerate your database schema with the CLI since plugins add their own tables. Users can then enroll TOTP authenticators or register WebAuthn passkeys through the client API.

Why do I need to regenerate the schema after adding Better Auth plugins?▼

Plugins like twoFactor, passkey, and organization introduce their own tables and fields that the core schema does not include. Running npx @better-auth/cli generate after adding a plugin creates the required tables, and you apply them with your ORM's migration tool.