Skip to main content
Configuration

Environment Variables

Configure RivetKit runtime behavior with environment variables for the inspector, metrics, storage, listener lifecycle, and logging.

These variables configure the RivetKit SDK inside your own process. Variables that connect your backend to a Rivet control plane, select a runner pool, or spawn a local engine live in Environment Variables in the platform docs.

Inspector

Environment VariableDescription
RIVET_INSPECTOR_DISABLESet to 1 to disable the inspector

Metrics

Environment VariableDescription
_RIVET_METRICS_TOKENBearer token that gates the per-actor Prometheus /metrics endpoint. When unset, /metrics is disabled.

Experimental

Environment VariableDescription
RIVET_EXPERIMENTAL_OTELSet to 1 to enable experimental OTel tracing in Rivet Actors

Storage

Environment VariableDescription
RIVETKIT_RUNTIMERuntime binding to use for RivetKit core: auto, native, or wasm. Defaults to auto.
RIVETKIT_STORAGE_PATHOverrides the default file-system storage path used by RivetKit when using the default driver.

Lifecycle

Environment VariableDescription
RIVETKIT_RUNTIME_MODEControls how registry.start() runs. Accepted values are envoy and serverless; any other explicit value errors. Defaults to envoy: opens a long-lived WebSocket to the control plane (Mode A). Set to serverless to bind an HTTP listener via registry.listen() (Mode B).
RIVETKIT_PUBLIC_DIRDirectory of static assets to serve alongside the framework routes when calling registry.listen(). Used as a fallback when opts.publicDir is not passed. On auto-listen via registry.start(), defaults to /public when this env var is unset.
RIVET_PORTPort the listener binds when calling registry.listen() without an explicit opts.port. Must be an integer between 1 and 65535. Defaults to 3000.

Logging

Environment VariableDescription
RIVET_LOG_LEVELLog level: trace, debug, info, warn, error, fatal, silent
RIVET_LOG_TARGETSet to 1 to include log target
RIVET_LOG_TIMESTAMPSet to 1 to include timestamps
RIVET_LOG_MESSAGESet to 1 to include message formatting
RIVET_LOG_ERROR_STACKSet to 1 to include error stack traces
RIVET_LOG_HEADERSSet to 1 to log request headers