firebase

Difference between firebase vs firebase-tools vs firebase-admin


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

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 :)


Solution

    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.