A package designed to help teams use secret enviroment variables together, without the security risk
npm install dotenvcrypt --save
Navigate to the root if your project Generate the encryted env file on the command line with
npx dotenvcrypt MyPasswordString
This will generate your .env.enc file to push to version control
Add this snippet to your code
const { decrypt } = require('dotenvcrypt');
decrypt(process.env.YOUR_ENV_KEY);
NOTE: dotenv is not required for the variables to be loaded
Share the password with your team They then save it inside there personal .bashrc/.bash_profile using
export YOUR_ENV_KEY="MyPasswordString"
Which can now be accessed from the node instance, which will now decode and read the env variables into the app