Hey guys… wondering…
How do I go about hiding my API key if pushing to github>
Do I need to create a module and add it to .gitignore ?
Hello there,
It is most common to have this workflow:
- Create a
sample.env
file which might looks something like this:
API_KEY=
- Create a
.gitignore
file with:
.env
- Create a
.env
file, and add your actual secrets:
API_KEY=string_key
Depending on your stack and environment, you will likely need an external library to handle parsing the .env
file. For example, the most common for Nodejs is dotenv
.
Hope this helps
1 Like
Thanks brother! Sounds very appropriate and around the lines I thought it would be like.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.