Start here

Environment loading and variables

Understand env precedence, required variables, and module env declarations.

Damat uses the same env cascade pattern as many Node runtimes:

.env.{environment}.local   ← highest priority
.env.{environment}
.env.local
.env                       ← lowest

Common values (the reference backend keeps this list in .env.example):

VariableRequiredDescription
DATABASE_URLUsuallyPostgreSQL URL for modules, durable work, inspection, and migrations
REDIS_URLOptional cache/pub-sub/lock accelerator for faster wake-up and invalidation
NODE_ENVdevelopment, production, or test
PORT / HOSTHTTP bind and host settings
DAMAT_RUNTIME_MODEOverrides runtime.mode: server, worker, or all
DAMAT_WORKER_TYPESOverrides worker names: comma-separated jobs,events,pipelines
DAMAT_REGISTRYRegistry source index for module resolution
DAMAT_MODULE_VERIFYInstall policy: off, warn, or require

DAMAT_MODULE_REGISTRY is accepted as a compatibility alias for DAMAT_REGISTRY. Modules declare their own environment requirements in damat.json; review those requirements during installation.

If values are missing, module-specific startup can fail even when app-level values are present.