bobmatnyc avatar

Better Auth Authentication

This handles Better Auth setup for TypeScript apps, covering email/password login and OAuth providers like GitHub. You get client methods for signUp, signIn (both email and social), and signOut, plus email verification hooks if you need them. The separation between server config (credentials, verification handlers) and client calls is clean, and it includes callback URLs for post-auth redirects. If you're already using Better Auth or evaluating it against NextAuth or Clerk, this gives you the implementation patterns without digging through docs. The guardrails about keeping secrets server-side and calling client methods only from the client are basic but worth the reminder.

skills.sh installs
398
GitHub stars
79
last updated
Aug 21, 2026

Install

$ npx -y skills add bobmatnyc/claude-mpm-skills --skill better-auth-authentication --agent claude-code

Installs into .claude/skills of the current project.

Files

Better Auth Authentication

Goals

  • Enable email/password authentication and social providers.
  • Implement sign-up, sign-in, sign-out, and verification flows.
  • Handle redirects and errors consistently.

Quick start

  1. Enable emailAndPassword and configure socialProviders.
  2. Create a client with createAuthClient.
  3. Use signUp.email, signIn.email, signIn.social, and signOut on the client.
import { betterAuth } from "better-auth";

export const auth = betterAuth({
  emailAndPassword: { enabled: true },
  socialProviders: {
    github: {
      clientId: process.env.GITHUB_CLIENT_ID as string,
      clientSecret: process.env.GITHUB_CLIENT_SECRET as string,
    },
  },
});
import { createAuthClient } from "better-auth/client";

const authClient = createAuthClient();

await authClient.signUp.email({
  email,
  password,
  name,
});

await authClient.signIn.email({
  email,
  password,
  callbackURL: "/dashboard",
});

await authClient.signIn.social({
  provider: "github",
  callbackURL: "/dashboard",
});

await authClient.signOut();

Sponsors

Details

Repository
github.com/bobmatnyc/claude-mpm-skills
Categories
Backend & APIs, Security
First seen
Jun 3, 2026

More from bobmatnyc/claude-mpm-skills

All 158
1secondsky avatarbun-websocket-serversecondsky/claude-skillsThis skill should be used when the user asks about "WebSocket in Bun", "real-time communication", "Bun.serve websocket", "ws server", "socket connections", "pub326skills.sh installs
2TryGhost avatarAdd Admin API EndpointTryGhost/GhostAdd a new endpoint or endpoints to Ghost's Admin API at `ghost/api/admin/**`.0skills.sh installs
3giuseppe-trisciuoglio avatarspring-boot-rest-api-standardsgiuseppe-trisciuoglio/developer-kitProvides REST API design standards and best practices for Spring Boot projects. Use when creating or reviewing REST endpoints, DTOs, error handling, pagination,4.3Kskills.sh installs
4giuseppe-trisciuoglio avatarunit-test-wiremock-rest-apigiuseppe-trisciuoglio/developer-kitProvides patterns for unit testing external REST APIs using WireMock. Stubs API responses, verifies request details, simulates failures (timeouts, 4xx/5xx error3.9Kskills.sh installs
5aj-geddes avatarrest-api-designaj-geddes/useful-ai-promptsDesign RESTful APIs following best practices for resource modeling, HTTP methods, status codes, versioning, and documentation. Use when creating new APIs, desig2.1Kskills.sh installs
6manutej avatarpostgresql-database-engineeringmanutej/luxor-claude-marketplaceComprehensive PostgreSQL database engineering skill covering indexing strategies, query optimization, performance tuning, partitioning, replication, backup and 1.8Kskills.sh installs