Configuration
Config File
Section titled “Config File”Create simplicity-admin.config.ts at your project root:
import { defineConfig } from '@mabulu-inc/simplicity-admin-core';
export default defineConfig({ database: process.env.DATABASE_URL, schema: 'public', port: 3000, basePath: '/admin',
api: { graphql: true, rest: false, graphiql: true, },
auth: { secret: process.env.SIMPLICITY_ADMIN_AUTH_SECRET, accessTokenTTL: '15m', refreshTokenTTL: '7d', },
tenancy: { enabled: false, resolution: 'header', header: 'X-Tenant-ID', },
providers: {}, plugins: [],});Key Options
Section titled “Key Options”| Option | Type | Default | Description |
|---|---|---|---|
database | string | required | PostgreSQL connection string |
schema | string | 'public' | Application schema to introspect |
port | number | 3000 | Server port |
basePath | string | '/admin' | URL base path for the admin UI |
api.graphql | boolean | true | Enable GraphQL endpoint |
api.rest | boolean | false | Enable REST adapter |
api.graphiql | boolean | true | Enable GraphiQL explorer |
auth.secret | string | required | JWT signing secret |
auth.accessTokenTTL | string | '15m' | Access token time-to-live |
auth.refreshTokenTTL | string | '7d' | Refresh token time-to-live |
tenancy.enabled | boolean | false | Enable multi-tenancy |
tenancy.resolution | string | 'header' | How to resolve tenant ID |
tenancy.header | string | 'X-Tenant-ID' | Header name for tenant resolution |
providers | object | {} | Custom provider overrides |
plugins | array | [] | Plugin instances |
Resolution Order
Section titled “Resolution Order”Configuration values resolve in this order, where later sources override earlier ones:
- Defaults — Built-in sensible defaults
- Config file —
simplicity-admin.config.ts - Environment variables —
DATABASE_URL,SIMPLICITY_ADMIN_PORT, etc. - Runtime overrides — Values passed directly to
createAdmin()
// Runtime overrides take highest priorityapp.use('/admin', createAdmin({ database: process.env.DATABASE_URL, port: 4000, // Overrides config file and env var}));Environment Variables
Section titled “Environment Variables”See the Environment Variables reference for the complete list of supported variables.