| 1 | /** |
| 2 | * Static Better Auth instance for the `@better-auth/cli` only. |
| 3 | * |
| 4 | * The Better Auth CLI needs a top-level `auth` export, which Nest DI deliberately avoids. The running app never imports this; it gets its instance from `AuthModule.forRootAsync`. |
| 5 | * |
| 6 | * Run it from the repo root so the root `.env` is picked up: bunx @better-auth/cli generate --config apps/api/auth.ts |
| 7 | */ |
| 8 | import { createDatabase } |
| 9 | |
| 10 | import { createAuth } |
| 11 | |
| 12 | const { db } |
| 13 | |
| 14 | export const auth = |
| 15 | secret: process.env |
| 16 | baseURL: process.env |
| 17 | }); |