Skip to content

Environment

Read the environment orchard runs in.

env

impure
env(name) → string

Read an environment variable by name.

Returns an empty string when the variable is unset, matching shell convention. Values read via env() may appear in run records — use for connection strings and config, not raw secrets.

ParameterTypeDescription
namestringEnvironment variable name.
env("DATABASE_URL")

→ "postgres://localhost/mydb"

env("UNSET_VAR")

→ ""