简体   繁体   中英

Does Firebase hosting allow environment variables?

I am running a single page react app that uses Firebase Authorization and the Twilio API for video chat. Everything works fine locally in dev and everything seems to work in my Firebase hosting production build, except the API to Twilio is not working.

How do you deploy an app to Firebase hosting that has environment variables in a.env file?

My environment variables look like this:

TWILIO_ACCOUNT_SID="XXXXXXXXXXXXXXXXX"

Yes, just declare your environment variable starting with REACT_APP if you're using ReactJS.

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