env.json
or .env
file the variables into the process.env
object. You are right that these config files must not be pushed with Git to avoid making public. However you should be able on your production environment to define these environment variables (on Heroku for example you can define them in the settings of the app). Once you have define all of your environment variable for your production app the variables would normally automatically be defined in the process.env
object.