better-auth

Configure better-auth with Drizzle and Spiceflow for TypeScript authentication.

40|2|Updated Sep 24, 2025
One-click install
npx skills add https://github.com/remorses/opencode-config --skill better-auth-remorses
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: better-auth
Source: https://github.com/remorses/opencode-config/tree/main/skills/better-auth
Command: npx skills add https://github.com/remorses/opencode-config --skill better-auth-remorses

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

better-auth provides a comprehensive authentication framework for TypeScript applications, offering email/password, social OAuth, session management, 2FA, and a consistent API compatible with standard Request/Response objects across server and client code.

Core Features & Use Cases

  • Email/password and social OAuth authentication with session handling and 2FA support.
  • Server configuration via a Drizzle adapter (Postgres/SQLite) and Spiceflow middleware integration for forwarding auth requests.
  • Client setup, server-side session checks, and React client hooks to access session state in UI.

Quick Start

Install better-auth in your TypeScript project and configure the Drizzle adapter, Spiceflow middleware, and client hooks to enable end-to-end authentication.

Frequently Asked Questions about better-auth

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

FAQPage Schema
How do I add authentication to a Spiceflow TypeScript application?

Authentication in Spiceflow TypeScript applications is added by configuring a Drizzle adapter on the server, integrating middleware to forward auth requests, and setting up React client hooks to access session state.

What authentication methods can I implement for TypeScript session management?

TypeScript session management supports email/password authentication, social OAuth integration, and two-factor authentication (2FA) to secure user access across server and client code.

Does better-auth work with Drizzle ORM for user authentication?

Yes, Drizzle ORM is supported for user authentication through a dedicated server-side Drizzle adapter, enabling database connections for Postgres or SQLite environments.

Can I use React hooks to check authentication session state?

Yes, React client hooks are provided to access and check authentication session state directly within your UI components, ensuring consistent request and response handling.

What is the best way to handle OAuth and secure session handling in TypeScript?

The best way to handle OAuth and secure sessions in TypeScript is using a framework that offers social OAuth integration, 2FA, and consistent API support for standard Request/Response objects across server and client code.

Do I need a separate database adapter to manage sessions with this approach?

Yes, you need a Drizzle adapter configured on the server to manage sessions and persist authentication data in either Postgres or SQLite databases.