Skip to content

Auth Package

packages/auth wraps Better Auth into a reusable package-level factory.

Currently the public entrypoint exports the auth creation config from packages/auth/src/config.ts.

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

This keeps auth concerns reusable and prevents the API app from owning all Better Auth wiring directly.