From the creator of dotenv 20.5k

Dotenvx

Designed as a secure dotenv. You can encrypt your .env files–and more.

Encrypt your .env

$ echo "HELLO=World" > .env
$ dotenvx encrypt
◈ encrypted (.env)

Decrypt at runtime

$ echo "console.log('Hello ' + process.env.HELLO)" > index.js
$ dotenvx run -- node index.js
⟐ injected env (2) from .env
Hello World

Commit it safely

HELLO=encrypted:BAgYNmJ3PV9+aajRwCh1Wx...
$ git add .env
$ git commit -m "add encrypted env"

About Dotenvx

Once your secrets are in an encrypted git workflow, you'll wonder why you waited so long. It just feels so good.

Get Started