Documentation

We are here to help you get from zero to one fast.

Get Started    Discussions

Secrets

reading time 3 mins

Secrets in Doppler work very similarly to how they would on any other platform, with a few exceptions. Our secrets engine has a couple of built-in perks!

Secret Names

Secret names must adhere to a specific format:

  • Secret names may only contain uppercase letters, numbers, and underscores
  • Secret names may not start with a number

For example, DATABASE_URL is a valid secret name while 1secret_name is not.

This strict format ensures that your secrets will work as expected when injected into an environment (regardless of the shell).

Referencing Secrets

The Doppler engine supports referencing secrets with the straightforward pattern ${SECRET_NAME}. Here is an example:

Name

Value

USER

brian

PORT

3030

WEBSITE

${USER}.doppler.com:${PORT}

Now, when we access the WEBSITE secret, the USER and PORT secrets will be inserted.

$ doppler secrets --raw

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ NAME    β”‚ VALUE                  β”‚ RAW                         β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ PORT    β”‚ 3030                   β”‚ 3030                        β”‚
β”‚ USER    β”‚ brian                  β”‚ brian                       β”‚
β”‚ WEBSITE β”‚ brian.doppler.com:3030 β”‚ ${USER}.doppler.com:${PORT} β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Referencing Across Projects

For workplaces on paid plans you can reference secrets across configs and projects. Users can only reference secrets they have access to, however secrets already being referenced will remain.

Type

Notation

Same config

${SECRET_NAME}

Across configs

${config.SECRET_NAME}

Across projects

${project.config.SECRET_NAME}

Now lets see this in practice! Here is what it would look like to reference the STRIPE_API_KEY secret in the billing project in the prd config.

Type

Notation

Same config

${STRIPE_API_KEY}

Across configs

${prd.STRIPE_API_KEY}

Across projects

${billing.prd.STRIPE_API_KEY}

Reserved Secrets

Doppler has a few special secrets you can use which makes it easier to track where you are in your CI/CD pipeline.

Name

Description

Example

DOPPLER_PROJECT

Identifier of current project

58ded6ac873

DOPPLER_ENVIRONMENT

Identifier of the current environment

dev

DOPPLER_CONFIG

Name of the current config

dev_stripe_billing

Updated 4 months ago



Secrets


reading time 3 mins

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.