Encrypt your secrets.
Ship them with your code.
Encrypt
$ echo "HELLO=Secret" > .env
$ dotenvx encrypt
◈ encrypted (.env)
Encrypt your secrets in .env files. The values become encrypted text, while the variable names stay readable. Only your private key can unlock the secrets.
Commit
HELLO=encrypted:BAgYNmJ3PV9+aajRwCh1Wx...
$ git add .env
$ git commit -m "Add encrypted secrets"
Commit your encrypted .env alongside your code. Share secrets through git, but keep your private key out of the repository.
Ship
$ dotenvx run -- node index.js
⟐ injected env (2) from .env
Ship your code and encrypted secrets together. Your deployment supplies the private key so Dotenvx can unlock your secrets at runtime. Where do I put the private key?
Built on three foundational primitives.
Git for distribution, .env for secrets storage, and secp256k1 for encryption. Dotenvx is open source, with over 200 million installs, and comes from the creator of dotenv.
See how it feels for yourself.
Encrypt, Commit, and Ship, and keep your private key out of git. Try the whole workflow locally before changing how you deploy.