Deprecated
.env.keys (old format deprecated)
The format detailed here has been DEPRECATED since May 2024. Please see updated .env.keys file format.
.env.keys holds your environment decryption DOTENV_KEYs. Here is what it looks like.
.env.keys
#/!!!!!!!!!!!!!!!!!!!.env.keys!!!!!!!!!!!!!!!!!!!!!!/
#/ DOTENV_KEYs. DO NOT commit to source control /
#/ [how it works](https://dotenv.org/env-keys) /
#/--------------------------------------------------/
DOTENV_KEY_DEVELOPMENT="dotenv://:key_e507c60efa8841d8d5bbb85bd701ee92406cf3b06506d1d80f1553c2a72791e4@dotenvx.com/vault/.env.vault?environment=development"
DOTENV_KEY_PRODUCTION="dotenv://:key_10283719af6a30ef49050048617f4fea10c23a38021fbebeb9fd858caa01852e@dotenvx.com/vault/.env.vault?environment=production"
Some quick takeaways:
- It uses the
.envformat DOTENV_KEY_DEVELOPMENTcontains the decryption key toDOTENV_VAULT_DEVELOPMENTin.env.vaultDOTENV_KEY_PRODUCTIONcontains the decryption key toDOTENV_VAULT_PRODUCTIONin.env.vault
Generating
It's auto-generated when running dotenvx encrypt.
$ dotenvx encrypt
✔ encrypted to .env.vault (.env)
✔ key added to .env.keys (DOTENV_KEY_DEVELOPMENT)
Do not commit .env.keys to source code. Keep them somewhere safe like 1password or dotenvx ops.
History
The .env.keys file came out of development work on dotenv-vault – around early 2023.