Open daniel-sudz opened 3 years ago
in progress
Is there an environment variable in netlify, like "NODE_ENV=Production"? If so, we could have our code check for that, and if it's set to "Production", to use firebase authentication like usual, but if it's set to "development", to deny access to the production database and instead use the emulator.
This will be a lot easier once we update firebase #107
Is your feature request related to a problem? Please describe. So people should be able to work on admin features, but shouldn't be able to wreck the production database. So we need to stub the database in development.
This is now supported: https://github.com/firebase/firebase-tools/issues/1677#issuecomment-717364427
https://firebase.google.com/docs/emulator-suite/connect_auth https://firebase.google.com/docs/emulator-suite/install_and_configure
We can import a mock database like so: https://stackoverflow.com/a/62977147
Although, generating the initial state and exporting it to a valid blob format has to be done manually.