Type-safe Better Auth integration guide for NestJS, Next.js App Router, and Drizzle ORM with PostgreSQL.

CCM score
49 of 100
skills.sh installs
3.8K
GitHub stars
372
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers a four-phase setup: Drizzle database, NestJS backend, Next.js frontend, then plugins
  • Includes Drizzle config, Better Auth instance, NestJS auth controller, and lib/auth.ts client snippets with checkpoints after each phase
  • Provides examples for Server Component sessions, 2FA TOTP with trusted devices, and passkey registration and login
  • Designed for developers adding social login, MFA, organizations, SSO, or protected routes to a TypeScript stack

Install

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

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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

Details

Repository
github.com/giuseppe-trisciuoglio/developer-kit
Categories
Backend & APIs, Frontend & UI Code
First seen
May 16, 2026

More from giuseppe-trisciuoglio/developer-kit

All 95

Similar to Better Auth

More Backend & APIs