Export and publish Firebase configurations.
This code depends on Python 3 and pip.
Install dependencies with
pip3 install --user -r requirements.txt
Download the service file of the Firebase project you intend to use:
- Go to your Firebase project in https://console.firebase.google.com.
- Then go to Project Settings (gear icon) -> Service Accounts tab and click the "Generate new private key" button. This will start a download. Rename the downloaded file to
service-account.json
and move the file to the current directory. - Enable the Google API for Firebase Remote Config of your project.
Run
./firebase-remote-config get
to download the latest configuration of the stored service account file. To use an alternative service account file, use
the -s
option, to use an alternative output file, use the -f option:
./firebase-remote-config get -f output.json -s ~/Downloads/my-long-service-file.json
The get command will print a so-called ETag. To publish a new version of the configuration, that ETag needs to be supplied to avoid version conflicts:
./firebase-remote-config publish -f output.json etag-123345-32
This code is published under the Apache License version 2.0. It is based on firebase/quickstart-python.