Injecting Secrets as ENV Vars Question


I am looking for a way to easily inject secrets as env vars for local environments from developer machine/laptop. Wanting to keep env files as secrets, but easily inject them during runtime.

The command: npm run start

Will grab ENV vars from a secret that contains all the environmental vars stored in vault.

is this possible?

This is essentially what I am attempting to do ( CLI Guide (

I don’t know doppler but in normal nodejs you should be able to run external programs. As long as you’re authenticated to vault consul-template is a program that allows you to programmatically get secret(s) into something you need.

Check: How to use an environment variable as part of a key in consul-template HCL · Issue #272 · hashicorp/consul-template · GitHub for various variations of the temelating to see which matches your situation.