Dotenv, how to use dot env to create environment variables for software projects — Uniqtech Guide to Developer Tool

Uniqtech
Interview Buddy
Published in
3 min readOct 30, 2022

--

Use dot env (dotenv)to store environment variables. Please read our full disclaimer. We are not responsible for any issues, damages, costs. Do your own research. Environmental variables such as API keys are important authentication information. Warning: our tutorials have NOT been tested in live, production, commercial environments / settings. They are NOT tested for those use cases. They are for informational educational purpose only, NOT for production use.

Originally published on blog, re-post with permission

dotenv : Setting up environment variables for dev environment

It’s very important to protect API keys, private keys in blockchain and API development. In general the best practice is: do not have API keys, or any secrets, sitting unprotected in code bases, even if it is in the server side logic. Front end code is definitely a big no no. We use environment variables to manage private keys and secrets. Some cloud platforms such as Google Cloud offers encrypted, cloud managed keys, with extra features such as key rotations, that’s pretty cool. Here’re are some tips from Chainlink smart contract hardhat starter kit.

There are two options of setting environment variables: store credentials in a .env file AND set it in command line. Remember to add any env file to .gitignore else you risk losing your credentials and subject your app to…

--

--