Multiple environments
Route secrets by environment using a single interpolation
Use this pattern when each environment has its own 1Password item in the same vault.
Configure 1Password
Create one item per environment in your vault, named with the lowercase
environment label (matching APP_ENV):
APP_ENV | 1Password item |
|---|---|
development | Project development |
preview | Project preview |
production | Project production |
Each item holds fields for every secret the schema references (e.g. SECRET).
Write the schema
Interpolate APP_ENV directly into the 1Password reference:
SECRET=op("op://Vault/Project ${APP_ENV}/SECRET")Sync to your targets
pnpm oe.env syncVarlock resolves the value separately for each target environment.