better-auth-skill

Integrates Better Auth authentication into TypeScript applications with plugins, sessions, and adapters.

1|Updated Aug 7, 2025
One-click install
npx skills add https://github.com/zzafergok/arktos --skill better-auth-skill-zzafergok
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: better-auth-skill
Source: https://github.com/zzafergok/arktos/tree/main/.agent/skills/better-auth-skill
Command: npx skills add https://github.com/zzafergok/arktos --skill better-auth-skill-zzafergok

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires better-auth, @better-auth/cli.

What problem does it solve? Setting up authentication in TypeScript applications involves many decisions—email/password, OAuth, two-factor, passkeys, sessions, and database adapters—and misconfigurations cause subtle bugs. This Skill provides a structured integration guide for projects that have chosen or are evaluating Better Auth. ## Core Features & Use Cases - Configuration Guidance: Covers installation, environment variables, server setup with Drizzle/Prisma adapters, and CLI schema generation and migration. - Feature Selection Matrix: Maps features like OAuth, TOTP two-factor, passkeys, magic links, and organizations to the exact plugins required. - Framework Integration: Includes Next.js route handlers, middleware protection, React client usage, session management strategies, and type-safe session inference. - Use Case: You are adding authentication to a Next.js app with a PostgreSQL database. Use this Skill to configure email/password plus GitHub OAuth, generate the schema with the CLI, mount the API handler, and protect dashboard routes with middleware. ## Quick Start Ask the AI to integrate Better Auth into your TypeScript project with email and password sign-in and GitHub OAuth.

Frequently Asked Questions about better-auth-skill

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

FAQPage Schema
How do I set up Better Auth in a Next.js app?▼

Install better-auth, create an auth server instance with a database adapter, then mount the handler in app/api/auth/[...all]/route.ts using toNextJsHandler. Set BETTER_AUTH_SECRET and BETTER_AUTH_URL environment variables and run the CLI to generate your schema.

How to add two-factor authentication with Better Auth?▼

Import the twoFactor plugin from better-auth/plugins/two-factor and add it to the plugins array in your auth configuration. After adding any plugin, run the Better Auth CLI again to regenerate the database schema.

Does Better Auth support Prisma and Drizzle adapters?▼

Yes, Better Auth provides adapters for both Prisma and Drizzle, plus a built-in adapter. Use npx @better-auth/cli generate to create the schema for Prisma or Drizzle, and the migrate command for the built-in adapter.

Why is email verification not working in Better Auth?▼

Email verification does not work unless you define the sendVerificationEmail function in your configuration. You must implement the email delivery logic yourself, typically using a transactional email service.

When should I not use Better Auth for my project?▼

Do not use it if your project already has a different authentication solution in place; this Skill explicitly warns against replacing existing auth on your own. It is intended only for projects that have selected or are evaluating Better Auth.