1
votes

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"
1
Firebase Hosting doesn't execute any code on its backend. Are you referring to Cloud Functions instead? Web content doesn't normally deal with things called "environment variables". - Doug Stevenson
If you're using Cloud Functions to interact with Twilio, you can use configuration variables:firebase.google.com/docs/functions/config-env They're not exactly the same as a .env file, but serve the same purpose. - Frank van Puffelen
Yes - I'm trying to use cloud functions with Firebase hosting to get the app to work - Will Cousin

1 Answers

-3
votes

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