Difference between firebase vs firebase-tools vs firebase-admin

831
  1. The firebase NPM package contains the Firebase SDK for client-side JavaScript, so that you can use Firebase inside your app.
  2. The firebase-tools NPM package contains the Firebase command-line interface, so that you can call commands like firebase deploy or use the Firebase emulator suite on your machine.
  3. The firebase-admin NPM package contains the Firebase SDK for Node.js on trusted environments (such as your development machine, a server you control, or Cloud Functions). This allows you to run Node.js scripts that access you Firebase project with administrative privileges.
Share:
831
Mainty
Author by

Mainty

Updated on December 30, 2022

Comments

  • Mainty
    Mainty over 1 year

    I'm new to flutter. and I'm kinda confused between

    • npm install firebase
    • npm install firebase-tools
    • npm install firebase-admin

    and where and for what should I use each of these. Thanks

    Edit: Sorry for the broad/ vague question.

    with firebase I understand you get -app, auth, firebase-database, firestore, storage, messaging, functions.

    with 'firebase-tools' - I understand that we can run emulator, deploy and even write firestore and storage rules without using the firebase console.

    and with running firestore init - the tool kinda creates the necessary functions and files the working project directory and sets up emulator for us.

    with firebase-admin i understand we get admin or super privileges to access certain firebase and GCP resources. and this is something that should NOT go into the client side code.

    my question mainly are

    1. why or should i even run npm i firebase or firebase init if i am adding firebase in pubspec.yaml/dependencies and /web/index.html and i'm running the app only on the web.[flutter project]. and I'm not deploying any function from CLI and creating rules in firebase console.

    2. I have seen certain tutorials where they use the firebase admin within a flutter app. was that purely for demonstartion purposes or is the developer creating an app like a dashboard/control panel for himself.

    Though I'm following the documentation as much as possible, I'm also watching tutorials from different sources. Hence the confusion.

    Thanks again :)

    • Doug Stevenson
      Doug Stevenson almost 3 years
      The first thing would be to read the documentation for these node modules, right? It's hard to tell if you've put much effort into figuring out what you want to know. I suggest editing the question with more detail on what you know so far, and where you are stuck with your research. I can tell you that they are all completely different and serve very different purposes, so comparing them doesn't make too much sense.