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.
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, OTLP endpoints, andOTEL_SERVICE_NAME.
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, read them back from a temporary API route. For
example, return getEnv("VERYFRONT_API_TOKEN") from a debug route and remove
it once you have confirmed the value resolves.