What problem does it solve?
This Skill helps developers add robust authentication to TypeScript and JavaScript applications using Better Auth, replacing ad-hoc auth logic with a scalable, standards-based solution.
Core Features & Use Cases
- New project setup: bootstrap a project with authentication scaffolding, including route protection and session handling.
- Migration and enhancement: audit existing auth flows, plan incremental improvements, and migrate to plugin-based capabilities.
- Client/server integration: configure server and client components, and wire up routes, sign-in/up flows, and session management.
- Use Case: imagine starting a new app; you install Better Auth, scaffold auth files, configure providers, and secure routes across your API and UI.
Quick Start
Set up a new TS/JS project and install Better Auth:
- Initialize your project (npm init or your framework's starter).
- Install the core package: npm install better-auth.
- Create server config at lib/auth.ts (or src/lib/auth.ts) and client config at auth-client.ts.
- Add route handlers for your framework (Next.js App Router, Express, etc.).
- Run migrations and test sign-in flows locally.