Skip to main content

Environments

Environments are a core feature of Kreya. They simplify your Kreya experience. You can add, edit and delete environments via Project → Environments.

Environment data​

Store environment-specific values in here. The environment data must be valid JSON and the keys should only consist of letters, numbers and underscores. Comments are allowed too, both // and /**/ style comments work.

User specific data​

Use user specific data for values that differ between team members or machines, such as a local API endpoint or a file path on your computer. These values override the shared environment data and are stored locally in your appdata folder, outside the Kreya project. Sharing the project does not share these overrides. User specific data is stored in plain text. For passwords, tokens, and API keys, use vault references as described below.

Vaults and secrets

Keep passwords, tokens, and API keys in a secret provider and reference them through Vaults and secrets. You can configure a vault with different provider locations or credentials for each environment, so requests use the appropriate secrets when you switch between development and production.

Put the secret reference, for example {{ secrets.my_vault.api_key }}, directly in a templated request or authentication field.

Process / System environment variables​

Kreya automatically imports system environment variables prefixed with KREYA_ENV_ into the active Kreya environment. The KREYA_ENV_ prefix is stripped. Additionally . and __ (double underscore) split the values into objects. These variables take precedence over "normal" and user specific environment values. System environment variables are especially useful in CI/CD systems or for secrets.

Example:

KREYA_ENV_FruitApi__ApiKey='FruitApiSecretKey'
KREYA_ENV_CarApi__ApiKey='CarApiSecretKey'

will be imported as

{
"FruitApi": { "ApiKey": "FruitApiSecretKey" },
"CarApi": { "ApiKey": "CarApiSecretKey" }
}

Changing the active environment​

You can view and change the active environment in the upper-left corner.

Using environment values​

See the Templating section.