Skip to content

godot-mobile-plugins/godot-firebase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Β Β Β Β Β 


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.

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
  • Modular Architecture β€” each Firebase service is a self-contained child node of the Firebase root node (e.g. FirebaseAuth), 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

Table of Contents


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 Firebase plugin in Godot Editor
  • click Download button
  • on the installation dialog...
    • keep Change Install Folder setting pointing to your project's root directory
    • keep Ignore asset root checkbox checked
    • click Install button
  • enable the plugin via the Plugins tab of Project->Project Settings... menu, in the Godot Editor

Installing both Android and iOS versions of the plugin in the same project

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 Plugins tab of Project->Project Settings... menu, in the Godot Editor

Usage

Add a Firebase node to your main scene (or an autoload global scene), then add a FirebaseAuth node as a child of Firebase to enable authentication features. Each Firebase module is a separate child node β€” only add the ones your project needs.

  • Connect to signals on the FirebaseAuth node before calling any methods
  • Call authentication methods directly on the FirebaseAuth node
  • Use the returned FirebaseUser object to access the signed-in user's profile data

Example usage:

@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("user@example.com", "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)

Signals

FirebaseAuth Signals

Signal Parameters Description
auth_success user: FirebaseUser Emitted when a sign-in or account creation succeeds. The resulting FirebaseUser object contains the authenticated user's profile.
auth_failure error_message: String Emitted when a sign-in or account creation attempt fails.
link_with_google_success user: FirebaseUser Emitted when an anonymous account is successfully linked to a Google credential.
link_with_google_failure error_message: String Emitted when linking an anonymous account to Google fails.
sign_out_success success: bool Emitted after a sign-out attempt, indicating whether it succeeded.
password_reset_sent success: bool Emitted after attempting to send a password-reset email, indicating whether it was sent successfully.
email_verification_sent success: bool Emitted after attempting to send a verification email to the current user, indicating whether it was sent successfully.
user_deleted success: bool Emitted after attempting to delete the current user's account, indicating whether the deletion succeeded.

Methods

FirebaseAuth Methods

Method Returns Description
create_user(email: String, password: String) void Creates a new Firebase user account with the given email and password. Emits auth_success or auth_failure.
sign_in(email: String, password: String) void Signs in an existing user with email and password. Emits auth_success or auth_failure.
sign_in_with_google() void Starts the Google Sign-In flow. Emits auth_success or auth_failure.
sign_in_anonymously() void Signs in the user anonymously. Emits auth_success or auth_failure.
link_anonymous_with_google() void Links the currently signed-in anonymous account to a Google credential. Emits link_with_google_success or link_with_google_failure.
is_signed_in() bool Returns true if a user is currently signed in, false otherwise.
get_current_user() FirebaseUser Returns a FirebaseUser for the currently signed-in user, or null if no user is signed in.
sign_out() void Signs out the current user. Emits sign_out_success.
send_password_reset_email(email: String) void Sends a password-reset email to the given address. Emits password_reset_sent.
send_verification_email() void Sends an email-verification message to the current user's email address. Emits email_verification_sent.
delete_current_user() void Permanently deletes the currently signed-in user's account. Emits user_deleted.

Classes

FirebaseUser

Extends RefCounted. Encapsulates the profile data of an authenticated Firebase user. Instances are returned by FirebaseAuth.get_current_user() and carried by the auth_success and link_with_google_success signals.

Method Returns Description
get_user_id() String The unique Firebase UID for this user.
set_user_id(a_user_id: String) void Sets the user's UID.
get_name() String The user's display name.
set_name(a_name: String) void Sets the user's display name.
get_email() String The user's email address.
set_email(a_email: String) void Sets the user's email address.
get_photo_url() String URL of the user's profile photo.
set_photo_url(a_photo_url: String) void Sets the user's profile photo URL.
get_is_email_verified() bool Returns true if the user's email address has been verified.
set_is_email_verified(a_is_email_verified: bool) void Sets the email-verified flag.
get_is_anonymous() bool Returns true if the user is signed in anonymously.
set_is_anonymous(a_is_anonymous: bool) void Sets the anonymous flag.

FirebaseModule

Extends Node. Abstract base class for all Firebase feature module nodes (e.g. FirebaseAuth). Handles locating and caching the native plugin singleton, and automatically re-acquires it when the app resumes from the background. All module nodes must be direct children of a Firebase node β€” the editor will display a configuration warning if this requirement is not met.

Nodes

The plugin exposes its functionality through a tree of custom Godot nodes. Add the Firebase root node to your scene and attach only the module child nodes for the Firebase services your project uses.

Note: Additional module nodes (extending FirebaseModule) will be added here as support for more Firebase services is introduced.


Firebase

Extends: Node

The root node for the entire plugin. Add this node to your main scene or an autoload scene. It automatically tracks all FirebaseModule child nodes as they enter and leave the scene tree, and surfaces editor configuration warnings when the node tree is set up incorrectly.

Properties:

Property Type Description
auth FirebaseAuth Reference to the FirebaseAuth child node, or null if none is present. Updated automatically as children are added or removed.

Configuration warnings (shown in the Godot editor):

  • Shown when no FirebaseAuth child node is present (authentication features will be unavailable).
  • Shown when more than one FirebaseAuth child node is detected (only one is supported at a time).

FirebaseAuth

Extends: FirebaseModule β†’ Node

Add this node as a direct child of Firebase to enable Firebase Authentication. It bridges GDScript signals and method calls to the underlying native Android/iOS Firebase Auth SDK via the plugin singleton.

Signals: see Signals section above.

Methods: see Methods section above.

Scene tree example:

Main (Node)
└── Firebase (Firebase)
    └── FirebaseAuth (FirebaseAuth)

Platform-Specific Notes

Android

iOS


Links


All Plugins

✦ Plugin Android iOS Latest Release Downloads Stars
Admob βœ… βœ…
Connection State βœ… βœ…
Deeplink βœ… βœ…
Firebase βœ… βœ… πŸ”œ -
In-App Review βœ… βœ…
Native Camera βœ… βœ…
Notification Scheduler βœ… βœ…
OAuth 2.0 βœ… βœ…
QR βœ… βœ…
Share βœ… βœ…
Vision βœ… βœ…

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

Star History Chart

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Contributors