#firebase #firestore #backend #bevy


firebase firestore for the bevy game engine

1 unstable release

0.1.0 Sep 6, 2023

#1208 in Database interfaces


35K SLoC

Prolog 31K SLoC // 0.1% comments Rust 3.5K SLoC // 0.0% comments Happy 277 SLoC Shell 182 SLoC // 0.3% comments JavaScript 162 SLoC Go 149 SLoC // 0.2% comments


Google Firebase Firestore integration for Bevy.

Currently only implements Google + GitHub OAuth2 and a limited subset of Firestore operations.


This is very very not battle-tested, and you will be trusting the plugin with API keys that can be used to rack up some serious bills if you're not careful. Check docs to see how to set up Firestore with an emulator.

Your keys will either be embedded in the distributed binary, or provided as separate files, but no matter which they will need to be essentially public. Ensure your GCP is prepared for this.

This crate is massive. I'm pretty sure it's due to depending on googleapis, I'll be looking in to shrinking it down by finalising the API code next release.


cargo add bevy-firebase-firestore


Requires bevy-tokio-tasks for the tonic crate to work. Removing dependencies is a TODO, I just don't know Rust well enough yet.

Version Compatibility

Targets Bevy 0.11.0


Setting up

Create a Firebase project and note your ProjectID and client ID and Secret.

Place the client keys in a keys.ron in the root of your project, and add keys.ron to your .gitignore.

The keys.ron should be formatted as so:

    Google: Some(("YOUR-GOOGLE-CLIENT-ID-STRING.apps.googleusercontent.com","YOUR-GOOGLE-CLIENT-SECRET"))

This structure will change, likely in the next release, so I'd advise against writing any tooling around it.

    // PLUGINS
    // Dependency for firestore RPC to work

Secrets + Keys

Google likes to put the required keys all over the place, with a couple of steps to set a project up. Here's a little walkthrough to get a hold of everything needed to use the plugins.

Creating a Firebase project

Go to this link and create a project.

Project ID, API Key

Once you have created a project, go to Project Settings (In the Settings cog on the Firebase project console) and take note of the Project ID and Web API Key.

Client ID, Client Secret

We need to create an identifier to authenticate the app with Google's backend. Go here, select your project in the top left dropdown and create a new OAuth2 credential. Name it something recognisable, and make note of the Client ID and Client Secret once it is generated.

NOTE: I have only tested with Desktop clients.


Clone repo, run git submodule init and git submodule update.


Apache 2.0 or MIT at user's discretion.


~835K SLoC