Godot Firebase Plugin
A Godot plugin that provides a unified GDScript interface for Firebase services on Android and iOS, with a modular node-based architecture that makes it easy to add and manage Firebase features directly in your scene tree. Supported services include Firebase Authentication and Cloud Firestore.
Key Features:
- Firebase Authentication — email/password, Google Sign-In, and anonymous sign-in
- User Management — create accounts, sign in/out, delete users, send verification and password-reset emails
- Account Linking — link anonymous accounts to Google credentials
- Cloud Firestore — add, set, get, update, and delete documents; query entire collections; and subscribe to real-time document change notifications
- Typed Firestore Results — all Firestore responses are wrapped in
FirestoreDocument,FirestoreResult, orFirestoreErrorobjects rather than raw dictionaries - Modular Architecture — each Firebase service is a self-contained child node of the
Firebaseroot node (e.g.FirebaseAuth,Firestore), making it easy to add only the modules you need - Signal-Based API — all async operations emit typed GDScript signals for clean, decoupled code
- Cross-Platform — single GDScript interface for both Android and iOS native SDKs
Installation
_Before installing this plugin, make sure to uninstall any previous versions of the same plugin._
_If installing both Android and iOS versions of the plugin in the same project, then make sure that both versions use the same addon interface version._
There are 2 ways to install the Firebase plugin into your project:
- Through the Godot Editor's AssetLib
- Manually by downloading archives from Github
Installing via AssetLib
Steps:
- search for and select the
Firebaseplugin in Godot Editor - click
Downloadbutton - on the installation dialog...
- keep
Change Install Foldersetting pointing to your project's root directory - keep
Ignore asset rootcheckbox checked - click
Installbutton
- keep
- enable the plugin via the
Pluginstab ofProject->Project Settings...menu, in the Godot Editor
When installing via AssetLib, the installer may display a warning that states "_[x number of]_ files conflict with your project and won't be installed." You can ignore this warning since both versions use the same addon code.
Installing manually
Steps:
- download release archive from Github
- unzip the release archive
- copy to your Godot project's root directory
- enable the plugin via the
Pluginstab ofProject->Project Settings...menu, in the Godot Editor
Usage
Add a Firebase node to your main scene (or an autoload global scene), then add FirebaseAuth and/or Firestore nodes as children of Firebase to enable the services your project needs. Each Firebase module is a separate child node — only add the ones you use.
- Connect to signals on the module nodes before calling any methods
- Call methods directly on the
FirebaseAuthorFirestorenode - Use the returned
FirebaseUser,FirestoreDocument, andFirestoreResultobjects to access data
Authentication Example
@onready var firebase: Firebase = $Firebase
@onready var auth: FirebaseAuth = $Firebase/FirebaseAuth
func _ready() -> void:
auth.auth_success.connect(_on_auth_success)
auth.auth_failure.connect(_on_auth_failure)
auth.sign_out_success.connect(_on_sign_out_success)
# Check if a user is already signed in
if auth.is_signed_in():
var user: FirebaseUser = auth.get_current_user()
print("Already signed in as: %s (%s)" % [user.get_name(), user.get_email()])
else:
auth.sign_in("[email protected]", "password123")
func _on_auth_success(user: FirebaseUser) -> void:
print("Signed in: %s (verified: %s)" % [user.get_email(), user.get_is_email_verified()])
func _on_auth_failure(error_message: String) -> void:
print("Auth failed: %s" % error_message)
func _on_sign_out_success(success: bool) -> void:
print("Signed out successfully: %s" % success)
Firestore Example
@onready var firestore: Firestore = $Firebase/Firestore
func _ready() -> void:
firestore.document_written.connect(_on_document_written)
firestore.document_write_failed.connect(_on_document_write_failed)
firestore.document_query_completed.connect(_on_document_query_completed)
firestore.collection_query_completed.connect(_on_collection_query_completed)
firestore.document_changed.connect(_on_document_changed)
# Write a document
var doc := FirestoreDocument.new()
doc.set_collection("players").set_document_id("player_1").set_value("score", 9001)
firestore.set_document(doc)
# Read a document
firestore.get_document("players", "player_1")
# Query an entire collection
firestore.get_collection("players")
# Subscribe to real-time updates
firestore.track_document("players", "player_1")
func _on_document_written(result: FirestoreDocument) -> void:
print("Written to %s / %s" % [result.get_collection(), result.get_document_id()])
func _on_document_write_failed(error: FirestoreError) -> void:
print("Write failed: %s" % error.get_error())
func _on_document_query_completed(result: FirestoreDocument) -> void:
print("Score: %s" % result.get_value("score"))
func _on_collection_query_completed(result: FirestoreResult) -> void:
for doc_id in result.get_all_document_ids():
var doc: FirestoreDocument = result.get_document(doc_id)
print("%s -> score: %s" % [doc_id, doc.get_value("score")])
func _on_document_changed(document: FirestoreDocument) -> void:
print("Live update for %s: score = %s" % [document.get_document_id(), document.get_value("score")])
Platform-Specific Notes
Android
- Download Android export template and enable gradle build from export settings
- Log into the Firebase Console
- Create a Firebase project and register your Android app
- Use same unique ID when exporting Godot app
- Enable all necessary Firebase features (Email Auth, Google Auth, Firestore, etc.) that you plan to use
- Download
google-services.jsonand place it in your project'sandroid/build/directory prior to export
- Create a Firebase project and register your Android app
- Troubleshooting:
- Logs:
adb logcat | grep 'godot'(Linux),adb.exe logcat | select-string "godot"(Windows) - You may find the following resources helpful:
- https://docs.godotengine.org/en/stable/tutorials/export/exporting_for_android.html
- https://developer.android.com/tools/adb
- https://developer.android.com/studio/debug
- https://developer.android.com/courses
iOS
- Follow instructions on Exporting for iOS
- Log into the Firebase Console
- Create a Firebase project (or use existing project with Android app) and register your iOS app
- Enable all necessary Firebase features (Auth, Firestore, etc.) that you plan to use
- Download
GoogleService-Info.plistand add it to your exported Xcode project
- View Xcode logs while running the game for troubleshooting.
- See Godot iOS Export Troubleshooting.
Links
Credits
Developed by Godot Firebase Team
Based on Godot Mobile Plugin Template v7
Original repository: Godot Firebase Plugin
Contributing
Contributions are welcome. Please see the contributing guide in the repository for details.
💖 Support the Project
If this plugin has helped you, consider supporting its development! Every bit of support helps keep the plugin updated and bug-free.
| ✦ | Ways to Help | How to do it |
|---|---|---|
| ✨⭐ | Spread the Word | Star this repo to help others find it. |
| 💡✨ | Give Feedback | Open an issue or suggest a feature. |
| 🧩 | Contribute | Submit a PR to help improve the codebase. |
| ❤️ | Buy a Coffee | Support the maintainers on GitHub Sponsors or other platforms. |
⭐ Star History
Changelog for version v1.0-Multi
No changelog provided for this version.