Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
bobmatnyc avatar

Better Auth Authentication

  • 271 installs
  • 63 repo stars
  • Updated July 18, 2026
  • bobmatnyc/claude-mpm-skills

Integrate Better Auth for sessions, OAuth providers, email login, and route protection in TypeScript web apps with secure cookie defaults.

About

Covers Better Auth setup for modern web apps: provider configuration, session lifecycle, protected routes, social login, database adapters, and secure defaults for SaaS authentication flows in TypeScript stacks.

  • OAuth providers
  • session cookies
  • email password login
  • route middleware guards
  • database adapters

Better Auth Authentication by the numbers

  • 271 all-time installs (skills.sh)
  • Ranked #653 of 2,203 Security skills by installs in the Skillselion catalog
  • Data as of Aug 1, 2026 (Skillselion catalog sync)
npx skills add https://github.com/bobmatnyc/claude-mpm-skills --skill better-auth-authentication

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs271
repo stars63
Last updatedJuly 18, 2026
Repositorybobmatnyc/claude-mpm-skills

What it does

Integrate Better Auth for sessions, OAuth providers, email login, and route protection in TypeScript web apps with secure cookie defaults.

Files

SKILL.mdMarkdownGitHub ↗

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();

Email verification

  • Provide emailVerification.sendVerificationEmail to send the verification link.
  • Use emailAndPassword.requireEmailVerification to enforce verification before sign-in.

Social providers

  • Configure providers in socialProviders with provider-specific credentials.
  • Use signIn.social to start OAuth flows.
  • Pass callbackURL, errorCallbackURL, and newUserCallbackURL for redirects.

Guardrails

  • Call client methods from the client only.
  • Keep secrets in server-only env variables.
  • Use rememberMe to control persistent sessions on email/password sign-in.

References

  • toolchains/platforms/auth/better-auth/better-auth-authentication/references/email-password.md
  • toolchains/platforms/auth/better-auth/better-auth-authentication/references/providers.md

Related skills

Securityappsecsecrets

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.