You will want to read Configuration and Configs at Dev Heroku Center. Heroku expects and recommends that you use configuration variables (configured on the Heroku application itself, not the code base) to protect sensitive data, such as passwords. Use heroku config:set VARIABLE=value , but note that most Heroku hadrons automatically add authentication data to your configuration variables when they are created. You can verify what was installed using the heroku config command.
Using node, you will access your environment variables using process.ENV.VARIABLE , where VARIABLE is the name of the environment / configuration variable that you are trying to access.
As a final note, you can add local environment variables in .env to the project directory (add the file to .gitignore!) ... the wizard will load them when you use foreman start or foreman run .
source share