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

Better Auth Integrations

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

Connect Better Auth to OAuth providers, databases, email, and session storage for secure login in full-stack apps.

About

Covers Better Auth integration patterns for SaaS and API apps: wiring OAuth providers, database adapters, email flows, and session configuration into Next.js, Express, or similar stacks with secure defaults.

  • OAuth and social providers
  • Database session adapters
  • Email and magic-link hooks
  • Framework route mounting
  • Production session config

Better Auth Integrations by the numbers

  • 246 all-time installs (skills.sh)
  • Ranked #1,568 of 4,347 Backend & APIs 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-integrations

Add your badge

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

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

What it does

Connect Better Auth to OAuth providers, databases, email, and session storage for secure login in full-stack apps.

Files

SKILL.mdMarkdownGitHub ↗

Better Auth Integrations

Goals

  • Mount the Better Auth handler at /api/auth/* (or a custom base path).
  • Use framework helpers where available.
  • Ensure cookies and headers flow correctly in SSR and server actions.

Quick start

1. Create an auth instance (see better-auth-core). 2. Add a catch-all route for /api/auth/*. 3. Use a framework helper (or auth.handler) to return a Response.

Next.js App Router

import { auth } from "@/lib/auth";
import { toNextJsHandler } from "better-auth/next-js";

export const { GET, POST } = toNextJsHandler(auth);

Next.js Pages Router

import { auth } from "@/lib/auth";
import { toNodeHandler } from "better-auth/node";

export const config = { api: { bodyParser: false } };
export default toNodeHandler(auth.handler);

Cookie handling in Next.js server actions

Use the nextCookies plugin so server actions set cookies correctly.

import { betterAuth } from "better-auth";
import { nextCookies } from "better-auth/next-js";

export const auth = betterAuth({
  // ...config
  plugins: [nextCookies()],
});

Guardrails

  • Keep the base path consistent between server and client.
  • Prefer framework helpers when available.
  • Avoid running custom body parsers before the auth handler.

References

  • toolchains/platforms/auth/better-auth/better-auth-integrations/references/nextjs.md
  • toolchains/platforms/auth/better-auth/better-auth-integrations/references/frameworks.md

Related skills

Backend & APIsbackendintegrations

This week in AI coding

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

unsubscribe anytime.