better-auth-integrations

Better Auth Integrations

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "better-auth-integrations" with this command: npx skills add bobmatnyc/claude-mpm-skills/bobmatnyc-claude-mpm-skills-better-auth-integrations

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

  • Create an auth instance (see better-auth-core ).

  • Add a catch-all route for /api/auth/* .

  • 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

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

drizzle-orm

No summary provided by upstream source.

Repository SourceNeeds Review
General

pydantic

No summary provided by upstream source.

Repository SourceNeeds Review
General

playwright-e2e-testing

No summary provided by upstream source.

Repository SourceNeeds Review
General

tailwind-css

No summary provided by upstream source.

Repository SourceNeeds Review