I'm coming here to ask how to handle the credentials rotating in my JS app? Am I able to make an API request to get the credentials? I've looked at quite a few topics but none give direct answers so I hoped I'd ask for myself.


You don't handle it explicitly. Your application should access your Heroku Postgres database through the DATABASE_URL environment variable (or other environment variable created by Heroku, if applicable).

When changes occur to the active database service or to the assigned credential, or if you perform an explicit rotation, Heroku restarts your app and provides the new values via environment variable.

  • How would this manage user and password? Thanks for the response – John Sep 12 '20 at 23:54
  • The username and password are stored in the DATABASE_URL environment variable, which different environments consume in different ways. There are examples for various stacks, including Node.js, in the Heroku documentation – David Reed Sep 13 '20 at 2:01
  • Thank you for the help – John Sep 14 '20 at 0:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.