What problem does it solve?
This skill guides developers in adding robust authentication layers to TypeScript and JavaScript apps using Better Auth, removing guesswork and reducing security risks.
Core Features & Use Cases
- Core setup: identify framework, choose database, install better-auth, create auth.ts and auth-client.ts, set up route handler, run migrations, and extend with plugins.
- Configuration: environment variables such as BETTER_AUTH_SECRET and BETTER_AUTH_URL; OAuth secrets for providers like GitHub and Google.
- Server Config (auth.ts): minimal required config and progressively richer setups with socialProviders, email verification, plugins, and session settings.
- Client Config (auth-client.ts): framework-specific imports and common exports for signIn, signUp, signOut, useSession, getSession.
- Route Handler Setup: per-framework file mappings (Next.js, Express, SvelteKit, SolidStart, Hono, etc.) to wire authentication flows.
- Database Migrations & Adapters: guidance for migrating or setting up the chosen database with the authentication schema.
- Plugins & Extensibility: guidance on adding 2FA, SSO, admin tooling, and other plugins to extend authentication capabilities.
Quick Start
Set up a TypeScript/JavaScript project, install Better Auth, and configure server and client authentication following the installation, server config, client config, and route handler guidance to enable a secure auth flow.