All docs

Getting Started

Project configuration

Configure your compos project with compos.config.ts.

compos.config.ts

The `compos.config.ts` file at the root of your project controls deployment behavior. Here is a minimal example:

ts
import { defineConfig } from "compos";

export default defineConfig({
  build: {
    command: "npm run build",
    output: ".next",
  },
  env: {
    NODE_ENV: "production",
  },
});

Build options

  • `command`: The build command to run. Defaults to auto-detection.
  • `output`: The directory containing built assets. Defaults to framework preset.
  • `installCommand`: Custom install command. Defaults to `npm install`.
  • `cache`: Enable or disable build caching. Defaults to `true`.

Environment variables

Define environment variables in the config or in the dashboard. Variables set in the dashboard take precedence over those in config.

ts
env: {
  DATABASE_URL: { value: "postgres://...", encrypted: true },
  API_KEY: { value: "sk-...", encrypted: true },
}

Health checks

Configure health checks so compos verifies deployment health before sending it traffic:

ts
healthcheck: {
  path: "/health",
  interval: 5000,
  timeout: 3000,
  retries: 3,
}