V
V
Vitaly2020-06-25 16:01:15
JavaScript
Vitaly, 2020-06-25 16:01:15

What is the difference between firebase module and firebase-admin in nodejs?

All the best!
Faced with the need to get data from firebase using nodejs, and here it’s somehow not entirely clear to me which npm module / package is best to use. The npm website seems to have a firebase module , and in the example it says that for the robots you need to call firebase = require('firebase') although in the firebase docks I almost see admin = require('firebase-admin'); So I don't understand what the difference is and how to work with it correctly.
I only need to get data by key

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aetae, 2020-06-25
@Aetae

You open the module page and read:
firebase :

This SDK is intended for end-user client access from environments such as the Web, mobile Web (eg React Native, Ionic), Node.js desktop (eg Electron), or IoT devices running Node.js. If you are instead interested in using a Node.js SDK which grants you admin access from a privileged environment (like a server), you should use the Firebase Admin Node.js SDK.

firebase-admin :
The Firebase Admin Node.js SDK enables access to Firebase services from privileged environments (such as servers or cloud) in Node.js.

In short: the first for the client, the second for the server.
Learn to look for information yourself, you can’t always ask here for every sneeze.
(No, you can't. You definitely can't. Infa 100%)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question