better-auth
Implement authentication and authorization with Better Auth - a framework-agnostic TypeScript authentication framework.
Skill by rafaelcalleja
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/rafaelcalleja-better-auth
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend, security, productivity
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
better-auth- Description
- Implement authentication and authorization with Better Auth - a framework-agnostic TypeScript authentication framework. Features include email/password authentication with verification, OAuth providers (Google, GitHub, Discord, etc.), two-factor authentication (TOTP, SMS), passkeys/WebAuthn support, session management, role-based access control (RBAC), rate limiting, and database adapters. Use when adding authentication to applications, implementing OAuth flows, setting up 2FA/MFA, managing user sessions, configuring authorization rules, or building secure authentication systems for web applications.
- License
- MIT
- Instructions
- 199 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (10)
- SKILL.md
- advanced-features.md · references/
- database-integration.md · references/
- email-password-auth.md · references/
- oauth-providers.md · references/
- .coverage · scripts/
- better_auth_init.py · scripts/
- requirements.txt · scripts/
- .coverage · scripts/tests/
- test_better_auth_init.py · scripts/tests/
SKILL.md (first lines)
# Better Auth Skill
Better Auth is comprehensive, framework-agnostic authentication/authorization framework for TypeScript with built-in email/password, social OAuth, and powerful plugin ecosystem for advanced features.
## When to Use
- Implementing auth in TypeScript/JavaScript applications
- Adding email/password or social OAuth authentication
- Setting up 2FA, passkeys, magic links, advanced auth features
- Building multi-tenant apps with organization support
- Managing sessions and user lifecycle
- Working with any framework (Next.js, Nuxt, SvelteKit, Remix, Astro, Hono, Express, etc.)
## Quick Start
### Installation
```bash
npm install better-auth
# or pnpm/yarn/bun add better-auth
```
### Environment Setup
Create `.env`:
```env
BETTER_AUTH_SECRET=<generated-secret-32-chars-min>
BETTER_AUTH_URL=http://localhost:3000
```
### Basic Server Setup
Create `auth.ts` (root, lib/, utils/, or under src/app/server/):
```ts
import { betterAuth } from "better-auth";
export const auth = betterAuth({
database: {
// See references/database-integration.md
},
emailAndPassword: {
enabled: true,
autoSignIn: true
},
socialProviders: {
github: {
clientId: process.env.GITHUB_CLIENT_ID!,
clientSecret: process.env.GITHUB_CLIENT_SECRET!,
}
}
});
```
### Database Schema
```bash
npx @better-auth/cli generate # Generate schema/migrations
npx @better-auth/cli migrate # Apply migrations (Kysely only)
```
### Mount API Handler
**Next.js App Router:**
```ts
// app/api/auth/[...all]/route.ts
import { auth } from "@/lib/auth";
import { toNextJsHandler } from "better-auth/next-js";
export const { POST, GET } = toNextJsHandler(auth);
```
**Other frameworks:** See references/email-password-auth.md#framework-setup
### Client Setup
Create `auth-client.ts`:
```ts
import { createAuthClient } from "better-auth/client";
export const authClient = createAuthClient({
baseURL: process.env.NEXT_PUBLIC_BETTER_AUTH_URL || "http://localhost:3000"
});
```
### Basic Usage
```ts
// Sign up
await authClient.signUp.email({
email: "user@example.com",
password: "secure123",
name: "John Doe"
});
// Sign in
await authClient.signIn.email({
email: "user@example.com",
password: "secure123"
});
// OAuth
await authClient.signIn.social({ provider: "github" });
// Session
const { data: session } = authClient.useSession(); // React/Vue/Svelte
const { data: session } = await authClient.getSession(); // Vanilla JS
```
## Feature Selection Matrix
| Feature | Plugin Required | Use Case | Reference |
|---------|----------------|----------|-----------|
| Email/Password | No (built-in) | Basic auth | [email-password-auth.md](./references/email-password-auth.md) |
| OAuth (GitHub, Google, etc.) | No (built-in) | Social login | [oauth-providers.md](./references/oauth-providers.md) |
| Email Verification | No (built-in) | Verify email addresses | [email-password-auth.md](./references/email-password-auth.md#email-verification) |
| Password Reset | No (built-in) | Forgot password flow | [email-password-auth.md](./references/email-password-auth.md#password-reset) |
| Two-Factor Auth (2FA/TOTP) | Yes (`twoFactor`) | Enhanced security | [advanced-features.md](./references/advanced-features.md#two-factor-authentication) |From rafaelcalleja/claude-market-place, MIT.
More from rafaelcalleja/claude-market-place
- 0.456score
chrome-devtools
rafaelcalleja
Browser automation, debugging, and performance analysis using Puppeteer CLI scripts.
SkillDFreshness: D★ 4Claude Code +9 - 0.455score
devops
rafaelcalleja
Deploy and manage cloud infrastructure on Cloudflare (Workers, R2, D1, KV, Pages, Durable Objects, Browser Rendering), Docker containers, and Google Cloud…
SkillDFreshness: D★ 4Claude Code +9 - 0.451score
new-release
rafaelcalleja
Crear nueva release de un plugin del marketplace actualizando versiones.
SkillDFreshness: D★ 4Claude Code +9 - 0.444score
to-be-cont
rafaelcalleja
Comprehensive documentation review and analysis of to-be-continuous GitLab CI/CD templates and framework architecture
SkillDFreshness: D★ 4Claude Code +9 - 0.435score
Systematic Debugging
rafaelcalleja
Four-phase debugging framework that ensures root cause investigation before attempting fixes.
SkillDFreshness: D★ 4Claude Code +9 - 0.238score
claude-code
rafaelcalleja
No description from the publisher yet.
SkillDFreshness: D★ 4Claude Code +9
Signals
- Stars
- 4
- Forks
- 1
- Open issues
- 0
- Last commit (this folder)
- Nov 10, 2025 (11 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.654score
better-auth
VoDaiLocz
Implement authentication and authorization with Better Auth - a framework-agnostic TypeScript authentication framework.
SkillAFreshness: A★ 28Claude Code +9 - 0.273score
better-auth
vibery-studio
Implement authentication and authorization with Better Auth - a framework-agnostic TypeScript authentication framework.
SkillDFreshness: D★ 3Claude Code +9
More from rafaelcalleja
- 0.456score
chrome-devtools
rafaelcalleja
Browser automation, debugging, and performance analysis using Puppeteer CLI scripts.
SkillDFreshness: D★ 4Claude Code +9 - 0.455score
devops
rafaelcalleja
Deploy and manage cloud infrastructure on Cloudflare (Workers, R2, D1, KV, Pages, Durable Objects, Browser Rendering), Docker containers, and Google Cloud…
SkillDFreshness: D★ 4Claude Code +9 - 0.451score
new-release
rafaelcalleja
Crear nueva release de un plugin del marketplace actualizando versiones.
SkillDFreshness: D★ 4Claude Code +9 - 0.444score
to-be-cont
rafaelcalleja
Comprehensive documentation review and analysis of to-be-continuous GitLab CI/CD templates and framework architecture
SkillDFreshness: D★ 4Claude Code +9 - 0.435score
Systematic Debugging
rafaelcalleja
Four-phase debugging framework that ensures root cause investigation before attempting fixes.
SkillDFreshness: D★ 4Claude Code +9
Cite this page
better-auth skill. Agent Mart. https://agentmart.dev/skills/rafaelcalleja-better-auth (last updated 2026-10-24)