Overview

The Better Auth integration provides:
  • ✅ JWT-based user authentication
  • ✅ Automatic user sync via NATS events
  • ✅ Organization management with multi-tenant support
  • ✅ Redis caching for performance
  • ✅ PostgreSQL as single source of truth

Getting Started

  1. Follow the Quick Start Guide
  2. Review Authentication Module for detailed architecture
  3. Test user sync via NATS events
  4. Verify user creation in PostgreSQL

Architecture

User Signs Up (Better Auth)

user.sync Event (NATS)

User Sync Handler

SyncUser(authID, email, name, org_id)

PostgreSQL User Created/Updated

Redis Cache Invalidated

Environment Variables

Required in .env:
BETTER_AUTH_URL=http://localhost:3100
BETTER_AUTH_SECRET=your_secret_key
See .env.example for full configuration.

Other Documentation

  • API Documentation (coming soon)
  • Database Schema (coming soon)
  • Deployment Guide (coming soon)