2 minutes reading time
.ENV
Tutorial

Adding Teammates

Use dotenv-vault to add teammates - so they can securely push and pull changes to your .env file. No more sharing .env files over insecure channels like Slack and email.

1. Run dotenv-vault open

Open terminal, enter your project’s root directory (where your .env.vault file is), and run dotenv-vault open.

$ npx dotenv-vault open

FYI: Not a developer? You can navigate to this page by visiting ui.dotenv.org.

2. Click Team Dropdown

Click the ‘Team’ dropdown button and then click ‘Manage access’.

3. Click Add Teammate

On the next page, click ‘Add Teammate’.

4. Enter Teammate’s Email Address

Enter your teammate’s email address and click ‘Add teammate’.

5. Tell Your Teammate to Check Their Email

They will receive an email with instructions to run dotenv-vault pull. They can also choose to log in.

6. Teammate: Run dotenv-vault login

Your teammate visits their terminal, enters the project directory (which they’ve already git-cloned via a service like GitHub or GitLab), and runs dotenv-vault login.

$ npx dotenv-vault login

7. Teammate: Click Login

On the next screen, your teammate should follow the login process and click ‘Log in’.

8. Teammate: View .env.me file (optional)

Your teammate now has their own .env.me file (on their machine only) in the root of the project. The .env.me file uniquely authorizes them to access the project’s shared .env file. Think of it like a unique SSH key at GitHub.

Run ls -al to view it.

$ ls -al
Jul 28 17:54 .
Jul 27 13:46 ..
Jul 28 18:11 .env.me
Jul 28 18:09 .env.vault
Jul 28 17:54 .gitignore
Jul 27 14:49 index.js
...

9. Teammate: Run dotenv-vault pull

Your teammate returns to their terminal and runs dotenv-vault pull.

$ npx dotenv-vault pull

remote:   Securely pulling... done
remote:   Securely pulled development (.env)

10. Teammate: Run dotenv-vault push (optional)

Your teammate can edit the .env file and push changes with dotenv-vault push.

$ npx dotenv-vault push

remote:   Securely pushing (.env)... done
remote:   Securely pulled development (.env)

11. You: Run dotenv-vault pull (optional)

Pull the changes your teammate made with dotenv-vault pull.

$ npx dotenv-vault pull

remote:   Securely pulling... done
remote:   Securely pulled development (.env)

That’s it! Thanks for using dotenv-vault with your teammates and friends.

Updated Saturday (Nov 26)