Using Firebase Admin in browser

186 views
Skip to first unread message

Vincent Bergeron

unread,
Sep 17, 2018, 10:28:10 PM9/17/18
to Firebase Google Group
Hi!

I have an internal angular app that uses the old sdk 2. I connect to FB using the URL and the legacy token, so I have admin access.

I need to switch this program to use sdk3+ but I have absolutely no idea how can I achieve the same thing...

I know I can't use the admin sdk in the browser... I would really like some help...

Thanks

VB

mark.t...@smpl.company

unread,
Sep 18, 2018, 10:16:04 AM9/18/18
to Firebase Google Group
If you have needs for Firebase admin while using the browser, you could use cloud functions to get around this. Basically anything you need to do using Firebase admin can be done on a cloud function. To use the browser at this point, you have several options such as direct calls to your cloud functions or http requests.

https://firebase.google.com/docs/functions/http-events
https://github.com/firebase/functions-samples/blob/Node-8/authorized-https-endpoint/functions/index.js

This code sample shows how to make an authorized endpoint. Instead of returning hello world, you could do whatever you want using Firebase admin and return the results as needed.

Vincent Bergeron

unread,
Sep 18, 2018, 11:38:22 AM9/18/18
to Firebase Google Group
I do not want to use cloud functions, I want to have an admin access in my browser as I can do right now with the SDK version 2.

My in-house app is working well and I don't want (and have time) for a complete refactoring.

VB
Reply all
Reply to author
Forward
0 new messages