Skip to content

Configuration

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: [],
});
OptionTypeDefaultDescription
databasestringrequiredPostgreSQL connection string
schemastring'public'Application schema to introspect
portnumber3000Server port
basePathstring'/admin'URL base path for the admin UI
api.graphqlbooleantrueEnable GraphQL endpoint
api.restbooleanfalseEnable REST adapter
api.graphiqlbooleantrueEnable GraphiQL explorer
auth.secretstringrequiredJWT signing secret
auth.accessTokenTTLstring'15m'Access token time-to-live
auth.refreshTokenTTLstring'7d'Refresh token time-to-live
tenancy.enabledbooleanfalseEnable multi-tenancy
tenancy.resolutionstring'header'How to resolve tenant ID
tenancy.headerstring'X-Tenant-ID'Header name for tenant resolution
providersobject{}Custom provider overrides
pluginsarray[]Plugin instances

Configuration values resolve in this order, where later sources override earlier ones:

  1. Defaults — Built-in sensible defaults
  2. Config filesimplicity-admin.config.ts
  3. Environment variablesDATABASE_URL, SIMPLICITY_ADMIN_PORT, etc.
  4. Runtime overrides — Values passed directly to createAdmin()
// Runtime overrides take highest priority
app.use('/admin', createAdmin({
database: process.env.DATABASE_URL,
port: 4000, // Overrides config file and env var
}));

See the Environment Variables reference for the complete list of supported variables.