Heroku config vars/env vars not working (using node.js)

Try heroku run env instead.

According to the documentation: "The SSH session created by Heroku Exec will not have the config vars set as environment variables (i.e., env in a session will not list config vars set by heroku config:set)."

see this for more information How to get environment variables in live Heroku dyno