@repo/auth package provides a minimal, adapter-based authentication system for React applications. It’s designed to work with any authentication backend through a simple adapter pattern.
Features
- Adapter-based architecture - Works with any auth provider (Better Auth, NextAuth, Supabase, etc.)
- Pre-built UI components - Login and register forms with built-in validation
- Type-safe hooks - Fully typed React hooks for authentication operations
- Enhanced error handling - User-friendly error messages with automatic filtering
- Loading states - Built-in loading and error state management
Installation
This package is part of the Money monorepo and is available as a workspace package:Package Contents
The auth package exports the following:useAuth
Core authentication hook with sign in, sign up, and sign out methods
LoginForm
Pre-built login form component with email/password fields
RegisterForm
Registration form with terms acceptance checkbox
AuthLayout
Centered layout wrapper for authentication pages
Quick Start
1. Create an Adapter
First, create an adapter for your authentication provider:2. Use Pre-built Forms
3. Or Use the Hook Directly
The adapter pattern allows you to use any authentication backend without changing your UI code.
Architecture
The package follows a simple, composable architecture:Next Steps
Configuration
Learn about adapters and TypeScript types
Usage Guide
See real-world examples and patterns