Auth Package
packages/auth wraps Better Auth into a reusable package-level factory.
What it exposes
Section titled “What it exposes”Currently the public entrypoint exports the auth creation config from packages/auth/src/config.ts.
Typical consumption
Section titled “Typical consumption”The API creates its auth instance like this:
import { createAuth } from '@dpg/auth';Then it passes:
- app name
- base URL
- auth secret
- trusted origins
- Drizzle DB adapter
- Redis secondary storage
- notification hooks
- OTP behavior flags
Why keep it in a package
Section titled “Why keep it in a package”This keeps auth concerns reusable and prevents the API app from owning all Better Auth wiring directly.