I'm currently developing a mobile app using Expo, React Native, and Firebase. In my local environment, everything is working fine, but I would like to have the ability to switch between development and production environments.
The structure of my application is as follows:
myApp/
/app // front end app
/assets
/components
/functions // firebase cloud functions
.firebaserc
firebaseConfig.json // project api keys etc
index.json
...
Based on my understanding, I believe I need to:
Create another app on Firebase for the production environment.
Create separate firebaseConfig.js files for each environment (production, testing).
Import the appropriate config based on the current environment.
const devApp = initializeApp(firebaseDevConfig, 'dev')
Define the environment I want to use (production, testing).
NODE_ENV=development
This part seems clear to me for the client-side, but I'm unsure about my Firebase Cloud Functions (/functions folder) as they initialize the app on their own...
What do I need to do to switch the environment for both the client-side and the Cloud Functions?
Thank you in advance.