Variables and Secrets

Using Variables and Secrets

Variables and Secrets in dex are reusable placeholders that help you manage configuration values across environments while supporting collaboration and security.

Both are used as text replacements throughout the platform and can be referenced dynamically in configurations, especially when working with external data sources in Connections. However, they serve different purposes:

  • Variables store visible, editable values that can be reused across multiple components. When you update a variable, it is automatically updated wherever it’s referenced.

  • Secrets store sensitive values like passwords or tokens. Once entered, they are encrypted and cannot be viewed or edited again—ensuring privacy and security in shared environments.

Adding Variables and Secrets

Creating and Managing Variables and Secrets

To create a new variable or secret, go to the Variables menu on the left-hand sidebar. Click “New Variable” to open the form.

You’ll need to provide the following:

  • Name: A unique identifier for the variable or secret. Names must contain only uppercase letters and underscores (e.g. API_TOKEN or COMMON_VARIABLE).

  • Value: The text or secret you want to store.

  • Mark as Secret: If enabled, the value will be encrypted and hidden after saving.

  • Scope: Choose whether this variable is available at the Project level or the Environment level.

  • Choose the Project or Environment: Select the scope where this variable or secret will be accessible.

Once saved, variables will remain editable and visible. Secrets, on the other hand, are hidden and cannot be retrieved or updated—only deleted and re-created.

Using a Variable

To reference a variable or secret in dex, use the double-curly brace syntax:

{{ VARIABLE_NAME }}

This works across all configuration fields, especially when setting up credentials, file paths, schema names, or API keys in Connections.

For example:

  • Use {{ DB_PASSWORD }} in a database connection form.

  • Reference {{ BUCKET_NAME }} in your storage configuration.

When dex runs your workflows, these placeholders will be automatically replaced with the latest value stored in the Variables menu—ensuring consistency and maintainability across teams and projects.

Last updated

Was this helpful?