Last updated

Manage environment variables

Environment variables are used during both build and run time for the project.

They may also be used in the client-side code (when explicitly allowed).

You can set environment variables in one of two ways:

Restricted environment variables

When defining custom names, avoid commonly reserved environment variables, such as HOME and PATH, and those related to the Node environment such as NODE_ENV.

The PUBLIC_ prefix is shared with the client side, and should not be used for any secrets.

The REDOCLY_ prefix is reserved for future use by Redocly.

Add an environment variable

  1. Once logged in to Redocly, select the project.
  2. Select Settings > Environment variables.
  3. Select Add environment variable.
  4. Enter the Environment variable name and value.
  5. If the variable is a secret, select the secret checkbox to store it in an encrypted format and exclude it from the logs.

Change an environment variable

  1. Once logged in to Redocly, select the project.
  2. Select Settings > Environment variables.
  3. Hover over the environment variable you want to update.
  4. Select the Edit icon next to the variable you want to change.
  5. In the Edit environment variable dialog that opens, make changes to your variable value select to make the variable secret.
  6. Select Save.

Remove an environment variable

  1. Once logged in to Redocly, select the project.
  2. Select Settings > Environment variables.
  3. Select the Delete icon next to the variable you want to remove. The variable is removed from the list immediately.