Skip to main content

Documentation Index

Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Configuration

veryfront.config.ts options, environment variables, and runtime settings.

Prerequisites

  • A project created with veryfront init (see Quickstart).
  • Write access to veryfront.config.ts and the project’s .env file.

Config file

// veryfront.config.ts
import { defineConfig } from "veryfront";

export default defineConfig({
  title: "My App",
  description: "A Veryfront application",
});
defineConfig provides TypeScript autocompletion but doesn’t transform the config: it’s a pass-through for type safety.

Options

Project metadata

defineConfig({
  projectSlug: "my-app", // Project identifier
  title: "My App", // Default page title
  description: "A great app", // Default meta description
});

Directories

Override the default directory conventions:
defineConfig({
  directories: {
    app: "src/app", // Override page/route directory
    pages: "src/pages", // Override pages-router directory
    components: ["src/components"],
    ai: "src/ai",
  },
});

Router mode

defineConfig({
  router: "app", // "app" (default) | "pages"
});

Build

defineConfig({
  build: {
    outDir: "dist", // Output directory
    trailingSlash: false, // Add trailing slashes to URLs
  },
});

Layout

defineConfig({
  layout: "components/layout.tsx", // Custom layout path
  // layout: false,                 // Disable layout
});

App wrapper

defineConfig({
  app: "components/app.tsx", // Custom app wrapper
  // app: false,                // Disable app wrapper
});

React version

defineConfig({
  react: {
    version: "19.1.1", // Override detected React version
  },
});

Experimental features

defineConfig({
  experimental: {
    rsc: true, // React Server Components
    precompileMDX: true, // Pre-compile MDX at build time
  },
});

AI discovery

Control which directories are scanned for AI primitives:
defineConfig({
  ai: {
    tools: {
      discovery: {
        enabled: true,
        paths: ["tools", "packages/shared-tools"],
      },
    },
    agents: {
      discovery: {
        enabled: true,
        paths: ["agents"],
      },
    },
    skills: {
      discovery: {
        enabled: true,
        paths: ["skills", "internal/skills"],
      },
    },
    prompts: {
      discovery: {
        paths: ["prompts"],
      },
    },
    resources: {
      discovery: {
        paths: ["resources"],
      },
    },
    workflows: {
      discovery: {
        paths: ["workflows"],
      },
    },
    tasks: {
      discovery: {
        paths: ["tasks"],
      },
    },
  },
});
Notes:
  • paths are relative to your project root.
  • Defaults are tools, agents, skills, prompts, resources, workflows, and tasks.
  • Set enabled: false to disable discovery for that primitive.

AI providers and MCP

Configure provider defaults or the app-facing MCP surface:
defineConfig({
  ai: {
    providers: {
      openai: {
        defaultModel: "gpt-4o-mini",
      },
    },
    mcp: {
      enabled: true,
      port: 3002,
      expose: ["tools", "prompts", "resources"],
    },
  },
});

Environment variables

Set environment variables in .env files or your deployment platform:

Veryfront Cloud bootstrap

VariableDescription
VERYFRONT_API_TOKENVeryfront API token for cloud/bootstrap-aware features and agent service registration
VERYFRONT_PROJECT_IDProject id used for project-scoped agent service registration
VERYFRONT_PROJECT_SLUGProject slug used by Veryfront Cloud-aware features
VERYFRONT_API_URLOverride the hosted API URL for self-hosted API deployments
VERYFRONT_AGENT_SERVICE_NAMEOptional agent service name. Defaults to the nearest project manifest name, then veryfront-agent-service
VERYFRONT_AGENT_SERVICE_URLPublic URL for a separately deployed agent service that should register with the control plane
VERYFRONT_AGENT_SERVICE_KEYOptional stable key for this agent service instance. Defaults to a deterministic key derived from service name, agent id, scope, and URL
VERYFRONT_AGENT_SERVICE_REGISTRATIONAgent service registration mode: auto, enabled, or disabled. Defaults to auto
VERYFRONT_AGENT_SERVICE_HEARTBEAT_INTERVAL_MSPush runtime heartbeat interval in milliseconds. Defaults to 30000
VERYFRONT_AGENT_SERVICE_REGIONOptional region metadata for the registered agent service
VERYFRONT_API_BASE_URLOverride the REST API base URL directly
VERYFRONT_DEFAULT_MODELOverride the default Veryfront Cloud model
VERYFRONT_DEFAULT_EMBEDDING_MODELOverride the default Veryfront Cloud embedding model
VERYFRONT_RAG_BACKENDOverride the default RAG backend selection

Provider API keys

VariableDescription
OPENAI_API_KEYOpenAI API key
OPENAI_BASE_URLCustom OpenAI-compatible endpoint
ANTHROPIC_API_KEYAnthropic API key
ANTHROPIC_BASE_URLCustom Anthropic-compatible endpoint
GOOGLE_API_KEYGoogle AI API key
GOOGLE_GENERATIVE_AI_API_KEYAlternate Google AI API key env name

Local AI

VariableDescription
VERYFRONT_DISABLE_LOCAL_AISet to 1 to disable server-side local model fallback (browser fallback may still run unless browserFallback: false is set in useChat)

Framework

VariableDescription
PORTServer port (default: 3000)
NODE_ENVdevelopment, production, or test
REDIS_URLRedis connection URL
REQUEST_TIMEOUT_MSIncoming HTTP request timeout
VF_HTTP_FETCH_TIMEOUTOutgoing fetch timeout
SSR_MAX_CONCURRENT_TRANSFORMSConcurrency limit for SSR transforms
VERYFRONT_EXPERIMENTAL_RSCForce-enable RSC experimental mode

Observability

VariableDescription
VERYFRONT_OTELEnable Veryfront tracing and metrics defaults
OTEL_TRACES_ENABLEDEnable OpenTelemetry tracing explicitly
OTEL_METRICS_ENABLEDEnable OpenTelemetry metrics explicitly
OTEL_EXPORTER_OTLP_ENDPOINTShared OTLP collector endpoint
OTEL_EXPORTER_OTLP_TRACES_ENDPOINTTrace-specific OTLP endpoint
OTEL_EXPORTER_OTLP_METRICS_ENDPOINTMetrics-specific OTLP endpoint
OTEL_SERVICE_NAMEService name for traces
For runtime-specific env behavior, veryfront/config and the cloud bootstrap helpers resolve these values per request where needed. Prefer environment variables for secrets and deployment-specific values, and keep veryfront.config.ts for stable project structure and feature defaults.

Environment-based config

Use getEnv to read environment variables inside your config:
import { defineConfig, getEnv } from "veryfront";

const isProd = getEnv("NODE_ENV") === "production";

export default defineConfig({
  title: isProd ? "My App" : "My App (Dev)",
  build: {
    outDir: isProd ? "dist" : ".dev",
  },
});

Reading config at runtime

The framework reads veryfront.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 editing veryfront.config.ts, restart veryfront dev. The dev banner should print 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.

Next