Gathering detailed insights and metrics for firebase
Gathering detailed insights and metrics for firebase
Gathering detailed insights and metrics for firebase
Gathering detailed insights and metrics for firebase
npm install firebase
Typescript
Module System
Node Version
NPM Version
firebase@12.1.0
Updated on Aug 07, 2025
firebase@12.0.0
Updated on Jul 17, 2025
firebase@11.10.0
Updated on Jun 30, 2025
firebase@11.9.1
Updated on Jun 10, 2025
firebase@11.9.0
Updated on Jun 05, 2025
firebase@11.8.1
Updated on May 22, 2025
TypeScript (93.25%)
JavaScript (4.91%)
HTML (1.17%)
CSS (0.44%)
HCL (0.1%)
Shell (0.06%)
Handlebars (0.06%)
Total Downloads
440,518,149
Last Day
179,286
Last Week
3,052,927
Last Month
13,202,396
Last Year
117,849,418
NOASSERTION License
5,003 Stars
4,344 Commits
963 Forks
198 Watchers
810 Branches
236 Contributors
Updated on Aug 17, 2025
Latest Version
12.1.0
Package Id
firebase@12.1.0
Unpacked Size
24.57 MB
Size
5.71 MB
File Count
2,608
NPM Version
10.9.0
Node Version
22.10.0
Published on
Aug 07, 2025
Cumulative downloads
Total Downloads
Last Day
-2.5%
179,286
Compared to previous day
Last Week
-1.9%
3,052,927
Compared to previous week
Last Month
6.7%
13,202,396
Compared to previous month
Last Year
43.8%
117,849,418
Compared to previous year
28
Version 9 has a redesigned API that supports tree-shaking. Read the Upgrade Guide to learn more.
Firebase provides the tools and infrastructure you need to develop, grow, and earn money from your app. This package supports web (browser), mobile-web, and server (Node.js) clients.
For more information, visit:
This SDK is intended for end-user client access from environments such as the Web, mobile Web (e.g. React Native, Ionic), Node.js desktop (e.g. 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.
Install the Firebase NPM module:
$ npm init
$ npm install --save firebase
1import { initializeApp } from 'firebase/app'; 2 3// TODO: Replace the following with your app's Firebase project configuration 4const firebaseConfig = { 5 //... 6}; 7 8const app = initializeApp(firebaseConfig);
Firebase services (like Cloud Firestore, Authentication, Realtime Database, Remote Config, and more) are available to import within individual sub-packages.
The example below shows how you could use the Cloud Firestore Lite SDK to retrieve a list of data.
1import { initializeApp } from 'firebase/app'; 2import { getFirestore, collection, getDocs } from 'firebase/firestore/lite'; 3// Follow this pattern to import other Firebase services 4// import { } from 'firebase/<service>'; 5 6// TODO: Replace the following with your app's Firebase project configuration 7const firebaseConfig = { 8 //... 9}; 10 11const app = initializeApp(firebaseConfig); 12const db = getFirestore(app); 13 14// Get a list of cities from your database 15async function getCities(db) { 16 const citiesCol = collection(db, 'cities'); 17 const citySnapshot = await getDocs(citiesCol); 18 const cityList = citySnapshot.docs.map(doc => doc.data()); 19 return cityList; 20}
The Firebase Web SDK is designed to work with module bundlers to remove any unused code (tree-shaking). We strongly recommend using this approach for production apps. Tools such as the Angular CLI, Next.js, Vue CLI, or Create React App automatically handle module bundling for libraries installed through npm and imported into your codebase.
See Using module bundlers with Firebase for more information.
You can also load Firebase packages as script modules in browsers that support native ES modules.
1<!-- use script module by specifying type="module" --> 2<script type="module"> 3 import { initializeApp } from 'https://www.gstatic.com/firebasejs/${FIREBASE_VERSION}/firebase-app.js'; 4 import { getFirestore, collection, getDocs } from 'https://www.gstatic.com/firebasejs/${FIREBASE_VERSION}/firebase-firestore-lite.js'; 5 // Follow this pattern to import other Firebase services 6 // import {} from "https://www.gstatic.com/firebasejs/${FIREBASE_VERSION}/firebase-analytics.js"; 7 // import {} from "https://www.gstatic.com/firebasejs/${FIREBASE_VERSION}/firebase-app-check.js"; 8 // import {} from "https://www.gstatic.com/firebasejs/${FIREBASE_VERSION}/firebase-auth.js"; 9 // import {} from "https://www.gstatic.com/firebasejs/${FIREBASE_VERSION}/firebase-functions.js"; 10 // import {} from "https://www.gstatic.com/firebasejs/${FIREBASE_VERSION}/firebase-firestore.js"; 11 // import {} from "https://www.gstatic.com/firebasejs/${FIREBASE_VERSION}/firebase-storage.js"; 12 // import {} from "https://www.gstatic.com/firebasejs/${FIREBASE_VERSION}/firebase-performance.js"; 13 // import {} from "https://www.gstatic.com/firebasejs/${FIREBASE_VERSION}/firebase-remote-config.js"; 14 // import {} from "https://www.gstatic.com/firebasejs/${FIREBASE_VERSION}/firebase-messaging.js"; 15 // import {} from "https://www.gstatic.com/firebasejs/${FIREBASE_VERSION}/firebase-database.js"; 16 17 // TODO: Replace the following with your app's Firebase project configuration 18 const firebaseConfig = { 19 //... 20 }; 21 22 const app = initializeApp(firebaseConfig); 23 const db = getFirestore(app); 24 25 // Get a list of cities from your database 26 async function getCities(db) { 27 const citiesCol = collection(db, 'cities'); 28 const citySnapshot = await getDocs(citiesCol); 29 const cityList = citySnapshot.docs.map(doc => doc.data()); 30 return cityList; 31 } 32</script>
Note: To get a filled in version of the above code snippet, go to the Firebase console for your app and click on "Add Firebase to your web app".
While you can write entire Firebase applications without any backend code, many developers want to write server applications or command-line utilities using the Node.js JavaScript runtime.
You can use the same npm module to use Firebase in the Node.js runtime (on a server or running from the command line):
$ npm init
$ npm install --save firebase
In your code, you can access Firebase using:
1const { initializeApp } = require('firebase/app'); 2const { getFirestore, collection, getDocs } = require('firebase/firestore'); 3// ...
If you are using native ES6 module with --experimental-modules flag (or Node 12+) you should do:
1import { initializeApp } from 'firebase/app'; 2import { getFirestore, collection, getDocs } from 'firebase/firestore'; 3// ...
Please see Environment Support for which packages are available in Node.js.
Version 9 provides a set of compat packages that are API compatible with Version 8. They are intended to be used to make the upgrade to the modular API easier by allowing you to upgrade your app piece by piece. See the Upgrade Guide for more detail.
To access the compat packages, use the subpath compat
like so:
1// v9 compat packages are API compatible with v8 code 2import firebase from 'firebase/compat/app'; 3import 'firebase/compat/auth'; 4import 'firebase/compat/firestore';
The Firebase changelog can be found at firebase.google.com.
Please see Environment Support.
No vulnerabilities found.
@firebase/logger
A logger package for use in the Firebase JS SDK
@firebase/util
_NOTE: This is specifically tailored for Firebase JS SDK usage, if you are not a member of the Firebase team, please avoid using this package_
@firebase/functions
This is the Firebase Functions component of the Firebase JS SDK.
@firebase/storage-types
@firebase/storage Types