/**
* better-auth CLI Configuration
*
* This file is used by the better-auth CLI to generate database schema.
* It runs in Node.js (not Workers) so uses placeholder values.
*
* Usage:
* npx @better-auth/cli generate --config ./src/lib/auth-cli.ts
*
* After generating, apply migrations to D1:
* npx drizzle-kit generate
* npx wrangler d1 migrations apply mcp-template-db --local
* npx wrangler d1 migrations apply mcp-template-db --remote
*/
import { betterAuth } from 'better-auth';
import { oidcProvider, admin, apiKey, jwt } from 'better-auth/plugins';
// CLI config - placeholder values (actual values come from env at runtime)
export default betterAuth({
// Placeholder database for schema generation
database: {
provider: 'sqlite',
url: 'file:./local.db',
},
// Placeholder social providers (shows CLI what fields we need)
socialProviders: {
google: {
clientId: 'placeholder',
clientSecret: 'placeholder',
},
microsoft: {
clientId: 'placeholder',
clientSecret: 'placeholder',
},
github: {
clientId: 'placeholder',
clientSecret: 'placeholder',
},
},
// Same plugins as runtime config
plugins: [
jwt(),
oidcProvider({
allowDynamicClientRegistration: true,
loginPage: '/login',
consentPage: '/consent',
}),
admin(),
apiKey(),
],
});