This document provides a comprehensive guide to the configuration system in Sim Studio. It covers how the platform manages settings across different deployment scenarios, from local development to production-grade Kubernetes clusters.
For detailed reference information, see:
next.config.ts, including image handling, headers, and external packages.Sim Studio's configuration system is designed for flexibility and type safety. It ensures that sensitive secrets are protected while allowing the platform to adapt to various infrastructures (Docker, Kubernetes, Railway, etc.).
Key features include:
@t3-oss/env-nextjs apps/sim/package.json90getEnv helper provides seamless access to variables in both client and server contexts apps/sim/app/(auth)/login/login-form.tsx18.env files, Docker Compose environment blocks, and Kubernetes Secrets.The system bridges the gap between raw environment variables and typed code entities.
This diagram illustrates how a raw environment variable (e.g., DATABASE_URL) propagates through the system to become a typed property used by the application logic.
Sources: apps/sim/app/(auth)/login/login-form.tsx18 helm/sim/values.yaml69-97 apps/sim/package.json90
Local setups typically rely on a .env file or docker-compose.local.yml. In this mode, the application uses local service instances for PostgreSQL (port 5432) and the Socket server (port 3002) docker-compose.local.yml6-26 The development environment is managed via turbo run dev package.json13
Production deployments require strict validation of secrets. The Helm chart provides a robust way to map Kubernetes Secrets to the application's expected environment variables via the secrets.existingSecret configuration helm/sim/values.yaml53-66
Kubernetes Configuration Mapping
The following diagram shows how Helm values.yaml maps to the application's internal configuration keys.
Sources: helm/sim/values.yaml85-98 docker-compose.prod.yml11-28
| Category | Key Variables | Description |
|---|---|---|
| Database | DATABASE_URL | Connection string for PostgreSQL (requires pgvector) docker-compose.prod.yml13 |
| Authentication | BETTER_AUTH_SECRET, BETTER_AUTH_URL | Keys for session signing and the base URL for the auth service helm/sim/values.yaml88-89 |
| Security | ENCRYPTION_KEY, INTERNAL_API_SECRET | Used for encrypting sensitive block data and authenticating internal service calls helm/sim/values.yaml89-90 |
| AI Providers | OPENAI_API_KEY, ANTHROPIC_API_KEY_1 | API keys for various LLM providers helm/sim/values.yaml118-125 |
| Realtime | NEXT_PUBLIC_SOCKET_URL, REDIS_URL | Public WebSocket endpoint and Redis for state synchronization docker-compose.prod.yml20-25 |
The next.config.ts file integrates these variables into the Next.js build pipeline to handle:
output: 'standalone' for optimized Docker images when DOCKER_BUILD is detected apps/sim/next.config.ts75-77isolated-vm, ffmpeg-static, and pino that require special handling in the Next.js runtime apps/sim/next.config.ts81-91Sources: apps/sim/next.config.ts1-225 apps/sim/package.json165
For more details on specific variables, proceed to Environment Variables.