veryfront.config.ts when a project needs
to deviate from those conventions.
Use environment variables for secrets and deployment-specific values. The
framework reads config and environment variables automatically.
Prerequisites
- A project created with
veryfront init(see Create project). - Write access to
veryfront.config.tswhen you need to override conventions. - Write access to the project’s
.envfile or deployment environment when you need secrets or deployment-specific values.
When to use config
Useveryfront.config.ts for stable project choices:
- Change directory conventions.
- Select app-router or pages-router mode.
- Change build output or trailing-slash behavior.
- Add a custom layout or app wrapper.
- Tune discovery paths for agents, tools, skills, prompts, resources, workflows, or tasks.
- Set project-level provider or MCP defaults.
Config file
defineConfig provides TypeScript autocompletion but doesn’t transform the
config. It is a pass-through for type safety.
Options
Project metadata
Directories
Override the default directory conventions:Router mode
Build
Layout
App wrapper
React version
Experimental features
AI discovery
Control which directories are scanned for AI primitives:pathsare relative to your project root.- Defaults are
tools,agents,skills,prompts,resources,workflows, andtasks. - Set
enabled: falseto disable discovery for that primitive. - Eval, task, trigger, and workflow definitions with filenames containing
.test.or.spec.are ignored during discovery. Rename production definitions that use those filename segments before upgrading.
AI providers and MCP
Configure provider defaults or the app-facing MCP surface:Environment variables
Set secrets and deployment-specific values in.env files or your deployment
platform. Keep stable project structure in veryfront.config.ts.
Common groups:
- Cloud bootstrap:
VERYFRONT_API_TOKEN,VERYFRONT_PROJECT_ID,VERYFRONT_PROJECT_SLUG, andVERYFRONT_API_URL. - Agent services:
VERYFRONT_AGENT_SERVICE_NAME,VERYFRONT_AGENT_SERVICE_URL,VERYFRONT_AGENT_SERVICE_KEY,VERYFRONT_AGENT_SERVICE_REGISTRATION, andVERYFRONT_AGENT_SERVICE_REGION. - Provider keys:
OPENAI_API_KEY,ANTHROPIC_API_KEY,GOOGLE_API_KEY, and provider-specific base URLs. - Runtime:
PORT,NODE_ENV,REDIS_URL, request timeouts, SSR limits, andVERYFRONT_EXPERIMENTAL_RSC. - Observability:
VERYFRONT_OTEL,OTEL_TRACES_ENABLED,OTEL_METRICS_ENABLED,OTEL_EXPORTER_OTLP_ENDPOINT,OTEL_EXPORTER_OTLP_HEADERS,OTEL_SERVICE_NAME, and relatedOTEL_*values.
veryfront.config.ts files must not choose the
shared runtime OTLP endpoint, headers, service name, resource attributes, or
enable flags. Veryfront filters OTEL_* and VERYFRONT_OTEL from shared
runtime project env before request execution. Dedicated runtimes and local
development can use project/deployment OTEL_* values because they run in their
own process boundary.
Use Providers for model-provider setup. Use
Agent service runtime for the registration
variables used by standalone agent services.
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.).
Verify it worked
After editingveryfront.config.ts, restart veryfront dev. The dev banner
prints the resolved title, output directory, and router mode. Set a
distinctive title and check that the document title in the browser matches.
For environment variables, set a temporary non-secret value such as
VERYFRONT_CONFIG_CHECK=enabled and read that value from a temporary API route.
Never return API tokens, provider keys, or other secrets from a route. Remove
the route and temporary value after confirming the configuration resolves.