create-auth

Scaffold and implement Better Auth authentication in TypeScript and JavaScript applications.

Updated Jul 29, 2026
One-click install
npx skills add https://github.com/zomeru/zomlab --skill create-auth-zomeru
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: create-auth
Source: https://github.com/zomeru/zomlab/tree/main/.agents/skills/create-auth
Command: npx skills add https://github.com/zomeru/zomlab --skill create-auth-zomeru

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding authentication to a TypeScript or JavaScript project involves many decisions—framework integration, database adapters, OAuth providers, plugins, and UI pages—and mistakes in any of them cause broken sessions or security gaps. This Skill guides the full Better Auth setup from planning through implementation. ## Core Features & Use Cases - Project Scanning & Planning: Auto-detects framework, ORM, database driver, package manager, and existing auth libraries, then asks structured planning questions before writing code. - Framework-Specific Setup: Provides route handler configurations for Next.js, SvelteKit, Nuxt, Astro, Express, Hono, and SolidStart, plus client imports for React, Vue, Svelte, and Solid. - Database & Plugin Integration: Covers Prisma, Drizzle, Kysely, and MongoDB adapters with CLI migration commands, plus plugins like 2FA, organizations, admin, bearer tokens, and passkeys. - Use Case: You have a Next.js app with a Neon PostgreSQL database and want email/password login plus GitHub OAuth. The Skill detects your stack, confirms a plan, then generates the auth config, route handler, Drizzle schema, and sign-in pages. ## Quick Start Ask the AI to add Better Auth authentication with email/password and GitHub OAuth to your existing Next.js project using Drizzle and PostgreSQL.

Frequently Asked Questions about create-auth

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

FAQPage Schema
How do I add authentication to a Next.js app with Better Auth?▼

Install better-auth, create a server config in lib/auth.ts with your database adapter, and add a route handler at app/api/auth/[...all]/route.ts using toNextJsHandler. For server components, include the nextCookies plugin, then run the CLI migrate or generate command for your adapter.

How to set up Better Auth with Drizzle and PostgreSQL?▼

Initialize a Drizzle db instance using node-postgres, postgres-js, or the Neon serverless driver, then pass it to drizzleAdapter with provider set to pg. Run the Better Auth CLI generate command to output the auth schema, then apply it with drizzle-kit push in development or generate plus migrate in production.

Does Better Auth support social OAuth providers like Google and GitHub?▼

Yes, Better Auth supports social OAuth through the socialProviders config option, including Google, GitHub, Apple, Microsoft, Discord, and Twitter/X. You add each provider's client ID and secret as environment variables and configure redirect URIs in the provider dashboard.

Can I migrate from NextAuth or Lucia to Better Auth?▼

Yes, the recommended approach is an incremental migration: audit your current auth for gaps, install Better Auth alongside the existing library, migrate routes first, then session logic, then UI, and finally remove the old library. Migration guides are available in the Better Auth documentation.

Why are Better Auth cookies not being set in production?▼

Cookies fail when the baseURL does not match your deployed domain or secure cookies are not enabled. Set advanced.useSecureCookies to true in production, configure trustedOrigins with your domain, and verify BETTER_AUTH_URL matches the deployment URL.