This walks you through integrating Better Auth (a TypeScript authentication framework) with a NestJS backend and Next.js frontend, using Drizzle ORM and PostgreSQL. You get step-by-step setup for email/password auth, social logins, and plugins like 2FA, passkeys, magic links, and organizations. It's structured in four phases: database schema and migrations, backend configuration with auth handlers, frontend client setup with middleware, then adding advanced features. The checkpoints after each phase are helpful for catching issues early. Good fit if you're building a production app that needs modern auth patterns beyond basic JWT tokens, especially if you want passwordless options or multi-tenant support without rolling everything yourself.

skills.sh installs
3.7K
GitHub stars
369
last updated
Aug 21, 2026

Install

$ npx -y skills add giuseppe-trisciuoglio/developer-kit --skill better-auth --agent claude-code

Installs into .claude/skills of the current project.

Files

Better Auth Integration Guide

Overview

Better Auth is a type-safe authentication framework for TypeScript supporting multiple providers, 2FA, SSO, organizations, and passkeys. This skill covers integration patterns for NestJS backend with Drizzle ORM + PostgreSQL and Next.js App Router frontend.

When to Use

  • Setting up Better Auth with NestJS backend
  • Integrating Next.js App Router frontend
  • Configuring Drizzle ORM schema with PostgreSQL
  • Implementing social login (GitHub, Google, Facebook, Microsoft)
  • Adding MFA/2FA with TOTP, passkey passwordless auth, or magic links
  • Managing trusted devices and backup codes for account recovery
  • Building multi-tenant apps with organizations or SSO
  • Creating protected routes with session management

Quick Start

Installation

# Backend (NestJS)
npm install better-auth @auth/drizzle-adapter drizzle-orm pg
npm install -D drizzle-kit

# Frontend (Next.js)
npm install better-auth

4-Phase Setup

Sponsors

Details

Repository
github.com/giuseppe-trisciuoglio/developer-kit
Categories
Frontend Development, Backend & APIs, Security, Git & Pull Requests, Databases
First seen
May 16, 2026

More from giuseppe-trisciuoglio/developer-kit

All 102
1dotnet avatarextension-pointsdotnet/skillsGuide for MSBuild extensibility: CustomBefore/CustomAfter hooks, wildcard imports with alphabetic ordering, import gating with control properties, NuGet package3.7Kskills.sh installs
2hamen avatarmaterial-3hamen/material-3-skillImplement Google's Material Design 3 (Material You) UI system. Primary: Jetpack Compose Material3 (MaterialTheme, components, adaptive layout). Also Flutter and3.6Kskills.sh installs
3forcedotcom avataruplifting-components-to-slds2forcedotcom/sf-skillsMigrate Lightning Web Components from SLDS 1 to SLDS 2 by running the SLDS linter and fixing violations. Use this skill whenever users mention SLDS 2, SLDS upli3.6Kskills.sh installs
4minimax-ai avatarfullstack-devminimax-ai/skillsFull-stack backend architecture and frontend-backend integration guide. TRIGGER when: building a full-stack app, creating REST API with frontend, scaffolding ba3.5Kskills.sh installs
5himself65 avatargenerative-uihimself65/finance-skillsDesign system and guidelines for Claude's built-in generative UI — the show_widget tool that renders interactive HTML/SVG widgets inline in claude.ai conversati3.4Kskills.sh installs
6netlify avatarnetlify-frameworksnetlify/context-and-toolsGuide for deploying web frameworks on Netlify. Use when setting up a framework project (Vite/React, Astro, TanStack Start, Next.js, Nuxt, SvelteKit, Remix) for 3.4Kskills.sh installs