create-auth

Implements Better Auth authentication in TypeScript and JavaScript applications.

Updated May 26, 2026
One-click install
npx skills add https://github.com/Albo-Club/albo-os --skill create-auth-albo-club
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-auth
Source: https://github.com/Albo-Club/albo-os/tree/main/.agents/skills/create-auth
Command: npx skills add https://github.com/Albo-Club/albo-os --skill create-auth-albo-club

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, email flows, and UI pages—and mistakes in any of them create security risks. This Skill guides the entire process with a structured planning phase and a framework-specific implementation workflow using Better Auth. ## Core Features & Use Cases - Project Scanning & Planning: Auto-detects your framework, database/ORM, existing auth libraries, and package manager, then asks targeted questions to build a confirmed implementation plan before writing code. - Framework-Specific Setup: Provides route handler configurations for Next.js, SvelteKit, Nuxt, Astro, Express, Hono, and SolidStart, plus database adapters for Prisma, Drizzle, MongoDB, and raw drivers. - Plugins & Auth UI: Covers OAuth providers, magic links, 2FA, organizations, admin, passkeys, and building sign-in/sign-up pages, with a security checklist and troubleshooting table. - Use Case: You are adding login to an existing Next.js app backed by PostgreSQL and Drizzle. The Skill detects your stack, confirms you want email/password plus Google OAuth, then scaffolds the auth config, route handler, schema migrations, and sign-in pages. ## Quick Start Ask the assistant to add Better Auth authentication with email/password and Google OAuth to your project, and it will scan your codebase and plan the implementation.

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, and add a route handler at app/api/auth/[...all]/route.ts using toNextJsHandler. For server components, include the nextCookies plugin, and create a client with better-auth/react.

How do I run database migrations for Better Auth with Drizzle?

Run npx @better-auth/cli@latest generate to output the auth schema, then use drizzle-kit push in development or drizzle-kit generate plus drizzle-kit migrate in production. Re-run the CLI after adding plugins.

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

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

Can I migrate an existing project from another auth library to Better Auth?

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

Why are Better Auth cookies not being set in production?

Cookies fail when the baseURL does not match your domain or secure cookies are not enabled. Set advanced.useSecureCookies to true in production and configure trustedOrigins to include your deployment domain.