...

/

Accessing Secret Values

Accessing Secret Values

Learn how to access the secret values in the configuration object in an application.

We'll cover the following...

Previously, we’ve used a couple of values that should be secret, but we initially kept them on the code. Those are values that might change from environment to environment, and configuration we want to keep as a secret for security reasons. This requirement makes it impossible to have them checked out into version control, so they have to live somewhere else.

One common practice to do this is to get these values from the environment, using environment variables. Deno provides an API that we’ll use to read from environment variables. We’ll be extending the config module so that it also includes secret values on its exported object of type Configuration.

Here are the values that are supposed to be secrets and that are ...