-
Notifications
You must be signed in to change notification settings - Fork 84
Installation and Activation
- Install this plugin:
- [recommended] Copy this repository and extract all of the
GodotFirebase-main
contents (addons/
folder andoverride.cfg
file) to the root of your project atres://
--- or --- - [not recommended - always check version] Install this addon from the AssetLibrary inside Godot Engine's Editor: go to the
AssetLib
panel on the top bar and look forGodotFirebase
. When choosing which folders to install, only checkaddons/
folder andoverride.cfg
file
- [recommended] Copy this repository and extract all of the
- Open your Project Settings
- Go to Plugins
- Activate the GDFirebase plugin
- From there, you will have an autoload singleton with the variables Auth and Database. Reference it by using Firebase.Auth, etc.
-
Go create a Firebase app at console.firebase.google.com. A Guide can be found Here
-
Once the app has been created, add a web app to it:
-
Click on the Project Settings option
-
Click on the Add App button
-
Click the Web App button
-
Add a name to your web app and click Register App
-
-
This will show a series of values called "config". To use them you have two options:
-
Take those values and copy them to the appropriate variables in
res://addons/godot-firebase/firebase.gd
. -
(Recommended) Create a
.env
file at the root of the GodotFirebase plugin (specifically,res://addons/godot-firebase/.env
). Specify those values as environment variables in this file (see example structure below). Reload the project, and you will find a new category insideProject ↝ Project Settings ↝ General ↝ Firebase
, which isEnvironment Variables
. Fill all the fields inside this new category and you will be good to go.
-
[firebase/environment_variables]
apiKey=""
authDomain=""
databaseURL=""
projectId=""
storageBucket=""
messagingSenderId=""
appId=""
measurementId=""
clientId=""
clientSecret=""
domainUriPrefix=""
In order to let users login with their own Google account to your app, the OAuth authentication process must be configured to work with this Plugin.
This process will not be enabled with the main configuration, but still it is not mandatory to use standard login methods.
To enable Google OAuth Authentication, follow these steps:
- In your project, enable "Google" in "Sign-in Method":
- Go to console.cloud.google.com/apis/credentials:
- Select the project you are working on (and eventually, your organization):
- Press the "+ Create Credentials" button and chose "ID Client OAuth" to register new credentials:
- Select Desktop Application, then give a name to your credentials:
- Create your credentials and copy-paste them in the configuration file
.env
, or directly in your code: