samuelgozi/firebase-firestore-lite

Admin Login

yankeeinlondon opened this issue · 3 comments

Is there a way to use the Admin SDK's means of connecting to the DB (aka, with the "Service Account")? I love your library and had built my own abstractions (https://firemodel.info and https://universal-fire.net) but the JS overhead of the base SDK's is terrible. A really strong use-case for the HTTP API's is in serverless as you just keep paying for the massive JS parse time and I'd like to use this library there if possible.

I started working on an Admin library before the firebase team announced that they are working on lightweight libs too.
For that reason, I had put it on hold. But it is indeed possible.

This library is very extensible. You can pass it a mock Auth object instead of the real Auth instance with an authorizedRequest method that will take a request object and add the required headers for it:
https://samuelgozi.github.io/firebase-firestore-lite/interfaces/auth.html#authorizedrequest

So you'll need to implement the Admin authentication functionality yourself, but making this library use it will be very easy.

I might come back to the Admin project (I too have a project that could use it), but I don't promise anything.

Please feel free to open this issue and ask any follow-up questions, I'm closing it just so I can track which issues are pending, and this is more that just a feature request, it is closer to a library request (which is fine too, just out of the scope of this issues list).

No, they don’t share that information unfortunately