Does anyone know how to use Firebase Cloud Firestore on Roblox?

I’m trying to make use of their database for some cross-server features.

EDIT: So I got it working and also made a open sourced module for anyone who wants to use it.

Okay, I got it worked out using Firebase’s Realtime Database rather than Cloud Firestore, expect what I’m missing is that Roblox doesn’t have PUT and DELETE request, and according to

They are working to add it. Hopefully, I can utilize this soon.

I worked it out by using a Chrome extension called Postman for testing HttpRequests, in Roblox, I believe these should do the same.

GET, to get the JSON of the database table.

HttpService:GetAsync(“https://[ProjectName].firebaseio.com/crossServerInvitations.json”, true);

POST, updates the database with the new JSON but it creates a new object. (If PUT is available, PUT would not create a new table)

HttpService:PostAsync(“https://[ProjectName].firebaseio.com/crossServerInvitations/[InvitationID].json”, HttpService:JSONEncode(dataTable), Enum.HttpContentType.ApplicationUrlEncoded);

Note that there is no security here, does anyone know how to add some sort of security such as authentications to this?

Hi!

I’m sorry but as I am not on my PC right now I can’t write a detailed post on how I’m using firebase and how to implement it. Nevertheless, you can use the X-Http-Override header to call other HTTP Verbs with the ROBLOX HttpService.

1 Like

Oh thanks, that would be amazing, hope to see it soon.

1 Like

I managed to get PUT and DELETE work, now I just need a authentication method.

So I have a key for authentication token. Simulating it with Custom and just pasting in “key…” successfully allow me to write. However I have no clue how to apply this key into PostAsync’s header.

Progress: adding URL.json?auth=“some key” returns “error”: “Could not parse auth token.”
I’ve tried parsing it in JSON but no luck on finding out what I’m suppose to enter.

1 Like

@devSparkle Do you know how to authenticate for using firebase?

You must create a Service Account in your Google Cloud panel. You can then use the Service Account token to authenticate any requests!

1 Like