Config vars change the way your app behaves. In addition to creating your own, some add-ons come with their own. Config var values are persistent–they remain in place across deploys and app restarts. Unless you need to change a value, you only need to set it once. There are several ways in which we can create, update, and delete the config cars inside our Heroku dyno. Here are two beginner-friendly ways that can help you.
Using the Heroku CLI
We can change the config vars of an app using the command line. To perform this operation you should have Heroku CLI installed on your machine.
View current config vars value
$ heroku config === APP_NAME Config Vars USER_ROLE: admin WEBSITE_NAME: thelovekesh
Set a config var
$ heroku config:set WEBSITE_NAME=thelovekesh Setting WEBSITE_NAME and restarting ⬢ APP_NAME... done, v3 WEBSITE_NAME: thelovekesh
Remove a config var
$ heroku config:unset WEBSITE_NAME=thelovekesh Unsetting WEBSITE_NAME=thelovekesh and restarting ⬢ APP_NAME... done, v3
Using the Heroku dashboard
To change config vars of an app from the dashboard follow these steps
1. log in to Heroku.com
2. Choose the app inside the dashboard
3. Go to the settings
4. Scroll down and click on Revel Config Vars
After clicking the button you will see a prompt like an image. From there you can add, update and delete config vars.