Auth Config
Auth Config protocol schemas
Better-Auth Configuration Protocol
Defines the configuration required to initialize the Better-Auth kernel.
Used in server-side configuration injection.
Source: packages/spec/src/system/auth-config.zod.ts
TypeScript Usage
import { AuthConfig, AuthPluginConfig, AuthProviderConfig } from '@objectstack/spec/system';
import type { AuthConfig, AuthPluginConfig, AuthProviderConfig } from '@objectstack/spec/system';
// Validate data
const result = AuthConfig.parse(data);AuthConfig
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| secret | string | optional | Encryption secret |
| baseUrl | string | optional | Base URL for auth routes |
| databaseUrl | string | optional | Database connection string |
| providers | Object[] | optional | |
| plugins | Object | optional | |
| session | Object | optional |
AuthPluginConfig
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| organization | boolean | ✅ | Enable Organization/Teams support |
| twoFactor | boolean | ✅ | Enable 2FA |
| passkeys | boolean | ✅ | Enable Passkey support |
| magicLink | boolean | ✅ | Enable Magic Link login |
AuthProviderConfig
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| id | string | ✅ | Provider ID (github, google) |
| clientId | string | ✅ | OAuth Client ID |
| clientSecret | string | ✅ | OAuth Client Secret |
| scope | string[] | optional | Requested permissions |