Load secrets into environment variables
The Dashlane CLI allows you to load secrets into environment variables. This is useful for example when you want to use secrets in your applications in development.
By using secret references in your environment variables, you can load secrets from your Dashlane account into your environment variables and avoid having to store them in plain text in your code.
Follow the guide in Read secrets references to learn how to get your secret reference.
It should look like this:
You can now export your secret reference into an environment variable :
In your code you can for instance read the variable from the env:
const token = process.env.GITLAB_TOKEN;
Finally, you can use the
dcli exec command to run your application with the environment variables loaded from your Dashlane account.
dcli exec -- node app.js
The stdin and stdout of your application will be piped to the terminal.
Every environment variable that starts with
dl:// will be replaced by the secret value from your Dashlane account.