auth-better-auth

Automate Better Auth integration in Next.js 16 with a Drizzle adapter.

9|2|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/aussiegingersnap/cursor-skills --skill auth-better-auth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-better-auth
Source: https://github.com/aussiegingersnap/cursor-skills/tree/main/skills/auth-better-auth
Command: npx skills add https://github.com/aussiegingersnap/cursor-skills --skill auth-better-auth

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Connects Next.js 16 apps to Better Auth using a Drizzle adapter, providing streamlined authentication including OAuth providers, session management, and protected routes.

Core Features & Use Cases

  • Configure OAuth providers (Google, GitHub, etc.) and manage user sessions in Next.js 16 apps.
  • Protect routes with a proxy.ts pattern and integrate with server components and API routes.
  • Provide a cohesive server-side and client-side auth workflow with a reusable setup.

Quick Start

Configure environment variables and install better-auth, then wire up the proxy.ts and server/client auth setup as shown.

Frequently Asked Questions about auth-better-auth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up Better Auth with a Drizzle adapter in Next.js 16?

To set up Better Auth with a Drizzle adapter in Next.js 16, configure your environment variables and install the better-auth package. You then wire up the server configuration alongside a reusable proxy.ts file for route protection.

What is the best way to protect routes using a proxy in Next.js 16?

The best way to protect routes in Next.js 16 is using a reusable proxy.ts pattern. This approach intercepts requests to secure server components and API routes by validating Better Auth user sessions before rendering.

Can I use Better Auth for OAuth and session management in Next.js?

Yes, you can use Better Auth for OAuth and session management in Next.js. It supports configuring providers like Google and GitHub while managing user sessions across a cohesive server and client workflow.

Does this authentication workflow support both server components and API routes?

Yes, this authentication workflow supports both server components and API routes. It provides a cohesive server-side and client-side auth setup that integrates seamlessly with your Next.js 16 proxy-based route protection pattern.

Do I need to manually configure environment variables for OAuth providers in Next.js?

Yes, you need to manually configure environment variables for OAuth providers in Next.js. The setup requires these variables to successfully connect Better Auth with providers like Google or GitHub for authentication.