简体   繁体   中英

Setting Firebase environment variables

I have used Heroku and Netlify for storing Firebase environment variables, and it seems pretty straightforward as I can go to the website and enter them manually. I was looking around Firebase and it seems a little more complicated. Where does everyone go to for setting environment variables for Firebase? Is there a sure fire way to do it on the website by just entering in the values? I'm currently messing around with create-react-app.

I know this is a little after the fact but you set firebase environment variables from the command line using

firebase functions:config:set someObject.key1="www.api.com" someObject.key2="someOtherKey"

then access them using the firebase-functions npm package

var api = functions.config().someObject.key1;

I will happily admit it's nowhere near as simple as the way Heroku/Amazon do it where they just append variables to process.ENV and it can all be configured from a UI

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM