Config Helpers
1.0.0How @app-factory/config parses ops/apps.yaml and resolves secrets.
Loader API
import { loadAppsConfig, AppsYaml } from '@app-factory/config';
const config = await loadAppsConfig({
source: 'local',
path: 'ops/apps.yaml',
});
loadAppsConfig validates against the Zod schema in common/lib/config/src/schema.ts and returns typed tenants, providers, and secrets.
Success
Use loadAppsConfig in scripts and CLI extensions instead of parsing YAML
manually. The loader keeps Doppler overrides and secret resolution in sync.
Helper functions
import { getAppConfig, getProviderStrategy } from '@app-factory/config';
const app = await getAppConfig('demo-app');
const strategy = getProviderStrategy(app, { fallback: 'supabase' });
getAppConfig(appId)reads and caches tenant configuration.getProviderStrategydecides which infrastructure provider to use based on config + overrides.
Regenerating env files
Generate .env files
pnpm --filter @app-factory/config exec tsx src/cli/generate-env.ts- Writes
.env.generatedfiles next to each app template. - Resolves secrets from Doppler, 1Password, or environment variables.
Validation errors
Important
Validation uses Zod. When a config fails, the loader throws a detailed error
listing the path, expected type, and fix suggestions. See
common/lib/config/src/loader.ts for formatting.