This question already has an answer here:

What is the proper way to save and access database and API credentials in my node js application? Currently I use a dotenv package and store them in a .env file. I am not uploading my code to github but keeping it private. This data is essential to the app itself and not user specific.

marked as duplicate by Xiong Chiamiov, David, Steffen Ullrich, Anders, Community Jan 29 '18 at 21:59

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Browse other questions tagged or ask your own question.