Config file
defineConfig provides TypeScript autocompletion but doesn’t transform the config. It’s a pass-through for type safety.
Options
Project metadata
Directories
Override the default directory conventions:Router mode
Build
Layout
React version
Experimental features
Environment variables
Set environment variables in.env files or your deployment platform:
Provider API keys
| Variable | Description |
|---|---|
OPENAI_API_KEY | OpenAI API key |
ANTHROPIC_API_KEY | Anthropic API key |
GOOGLE_API_KEY | Google AI API key |
Framework
| Variable | Description |
|---|---|
PORT | Server port (default: 3000) |
NODE_ENV | development, production, or test |
REDIS_URL | Redis connection URL |
Observability
| Variable | Description |
|---|---|
OTEL_ENABLED | Enable OpenTelemetry tracing |
OTEL_ENDPOINT | OpenTelemetry collector endpoint |
OTEL_SERVICE_NAME | Service name for traces |
Environment-based config
UsegetEnv to read environment variables inside your config:
Reading config at runtime
The framework readsveryfront.config.ts automatically. Your config values are available to the build system and dev server. Pages and API routes access config indirectly through the features it enables (port, build output, router mode, etc.).
Next
- Building & Deploying: production builds and deployment
- Head & SEO: metadata and Open Graph tags
Related
veryfront(root):defineConfig,getConfig