firebase-rest-api icon indicating copy to clipboard operation
firebase-rest-api copied to clipboard

[Bug]: <title>Forced to add "databaseURL" in config

Open QuestMerchant opened this issue 11 months ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Environment

-   OS: Windows 11
-   Python: 3.11

What happened?

firebase fails to initialize if not using Realtime Database. I feel like this should be optional now that Firestore is an option. Firestore doesn't store a URL in the config and this results in KeyError: 'databaseURL'

Code Snippet

config = {
    "apiKey": "******",
    "authDomain": "******",
    "projectId": "******",
    "storageBucket": "******",
    "messagingSenderId": "******",
    "appId": "******",
    "measurementId": "******"
}


# Initialize Firebase
firebaseApp = firebase.initialize_app(config)

Relevant log output

Traceback (most recent call last):
File "app.py", in <module>
firebaseApp = firebase.initialize_app(config)
File ".venv\Lib\site-packages\firebase\__init__.py" in initialize_app
return Firebase(config)
File ".venv\Lib\site-packages\firebase\__init__.py" in __init__
self.database_url = config["databaseURL"]
KeyError: 'databaseURL'

Anything else?

No response

QuestMerchant avatar Dec 17 '24 17:12 QuestMerchant

Hello @QuestMerchant , thank you for submitting an issue! A project committer will shortly review the issue.

github-actions[bot] avatar Dec 17 '24 17:12 github-actions[bot]