How to reference Firebase Functions config variables from a Firebase-hosted application?

前端 未结 2 998
执笔经年
执笔经年 2021-01-25 03:06

I am transitioning a Heroku-hosted ReactJS/NodeJS application to be hosted on Firebase. Because Firebase only handles static pages I need to reconfigure how my private environme

2条回答
  •  无人共我
    2021-01-25 03:36

    The variables you define through the link you provided are only available via Cloud Functions. They're not made available directly to the static content served by Firebase Hosting.

    If you want, you can make an HTTP function that does nothing but return the JSON from your env vars, and call that from your web content. Bear in mind that you're exposing your secret keys to the world.

提交回复
热议问题