I have an admin site that has a react frontend, using redux actions, with a node.js app as the server which uses firebase-admin to do the work.
I want to use firestore's onsnapshot listener. but im not sure how this works within the HTTP protocol?
I can't use the firebase-admin from my frontend app, and i cant create realtime DB functionality from the backend within HTTP protocol.
The goal: to set snapshot listeners on my collections from rreact frontend without having to go through multiple authentication processes, considering ive got a separate auth system for admins with my express api.
Is there a solution for this?
EDIT:
my client app is currently initialized with firebase web app config data, but because im authenticating admins with my own express server, the firebase web SDK hasnt authenticated with firebase, so i dont have permission for the data i need. im not sure if i need a service account, or a web app config with extra setup or what
My recommendation is to integrate the Firebase JS SDK into your client app using signInWithCustomToken().
It's not too complicated to do. Though I suppose that depends a lot on how your current auth setup works.
The general idea is this:
Send auth request to your auth service.
Process the request like normal.
Evaluate if the user should have access to Firebase.
If they should, use firebase-admin to create a custom token and send it back to the user.
Use the token on the client to authenticate with Firebase.auth
You should make sure to have Firestore rules to allow admin users to access the data you need.
As an alternative that doesn't use the Firebase client SDK, you could have a long-running node process that opens an onSnapshot. Your react app could receive data from it using either Server-Sent Events or through a WebSocket
I'm new to firebase part and I've one requirement to use firebase as a part of serverless architecture, below mentioned is something I need to do, can expertly guide me what to choose from firebase to achieve the same.
I want to create restful API using firebase with NodeJs with an express module of the node, is it something possible or any alternative way to achieve the same using nodejs?
I want to use the firebase authentication mechanism with nodejs code part, ultimately want to create API using the nodeJS with firebase to authenticate the user, so what to use from firebase to achieve the same?
There would be straight forward API that I want to create including the authentication and data store in cloud using firebase, here do I need to use either firestore or real-time database?
I want to deploy the nodeJs project using firebase with firebase cloud, can give me some more details on like how we can do that, reference link sharing would be appreciated.
I had a basic look into few stuff like firebase client SDK, firebase admin SDK, not sure in my case whether I would require to use client SDK or admin SDK to create restFul API.
Note: I want to use no SQL data base, where various collection I can create and can use the same using firebase, I checked that and firestore would perform the same thing, like to store the JSON data, but wanted to know is there any other way to store data or firestore is the best option?
I checked somewhere on reference link about the cloud function, this function can be triggered based on some event, including some https request trigger as well, wanted to confirm using cloud function to create restful API is the good approach or what is the best way to create API using firebase.
I want to create restful API using firebase with NodeJs with express module of node, is it something possible or any alternative way to achieve the same using nodejs?
Yes it is possible
I want to use the firebase authentication mechanism with nodejs code part, ultimately want to create API using the nodeJS with firebase to authenticate the user, so what to use from firebase to achieve the same?
You can use firebase SDK for authentication
There would be straight forward API that I want to create including the authentication and data store in cloud using firebase , here do I need to use either firestore or real time data base?
If you are asking of the database, then you can use any database of your choice, wheater it is MongoDB, firebase-realtime-database etc
I am not able to find how to implement swagger when we are implementing Microservice using Moleculer framework, as i am using Api-gateway to parse and map the request and send to specific Node or service using NATS transporter.
Check this OpenAPI mixin for API Gateway: https://github.com/icebob/kantab/blob/master/backend/mixins/openapi.mixin.js
Currently developing an extension of the basic network using node sdk. Im trying to figure out a way to implement user auth (REST api preferred). Is there any documentation that has this approach?
(User object currently used by the node app is the default User1 created by registerUser.js in fabric-samples)
I am planning to develop a mobile app which will retrieve data from a node.js REST API but also needs an integrated realtime chat with groups up to 12 people. How should I develop the backend in this case? Build everything with Websockets, including simple data communication or using both a REST API and Websockets?
I already developed an app with a REST API which later got a realtime chat with socket.io but using both feels wrong to me (especially when you use a PHP REST API and node.js for socket.io :D).
What would be the best practice in this case?