npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ngx-firebase

v22.0.1

Published

A lightweight, drop-in, and zoneless-friendly wrapper around the native Firebase JS SDK for Angular 22+.

Readme

@ngx-firebase

A lightweight, drop-in, and zoneless-friendly wrapper around the native Firebase JS SDK for Angular 22+.

This library serves as a modern, boilerplate-free alternative to @angular/fire, providing native Angular Dependency Injection (DI) class tokens and reactive RxJS wrappers around standard Firebase listeners.


⚡ Features

  • 📦 Zero overhead: Communicates directly with the Firebase JS SDK without complex wrappers.
  • 💉 Native Angular DI: Standard provider functions (provideFirestore, provideAuth, etc.) compatible with Angular's ApplicationConfig.
  • 🎭 RxJS Wrappers: Lightweight, memory-leak-safe wrappers for common tasks (docData, collectionSnapshots, user).
  • ⏱️ Zoneless Friendly: Uses native SDK snapshot listeners wrapped in RxJS observable streams.
  • 📊 Screen Tracking: Custom built-in ScreenTrackingService for automated Google Analytics route tracking.

📦 Installation

Install both the library and the native Firebase SDK:

npm install ngx-firebase firebase

🚀 Quick Start

1. Configure Providers

Register the Firebase services in your app.config.ts using the functional providers:

import { ApplicationConfig } from '@angular/core';
import { provideRouter } from '@angular/router';
import { initializeApp } from 'firebase/app';
import { getAuth } from 'firebase/auth';
import { getFirestore } from 'firebase/firestore';
import { 
  provideFirebaseApp, 
  provideAuth, 
  provideFirestore 
} from 'ngx-firebase';

import { routes } from './app.routes';

export const appConfig: ApplicationConfig = {
  providers: [
    provideRouter(routes),
    
    // Initialize Firebase App
    provideFirebaseApp(() => initializeApp({
      apiKey: "YOUR_API_KEY",
      authDomain: "YOUR_AUTH_DOMAIN",
      projectId: "YOUR_PROJECT_ID",
      storageBucket: "YOUR_STORAGE_BUCKET",
      messagingSenderId: "YOUR_MESSAGING_SENDER_ID",
      appId: "YOUR_APP_ID",
      measurementId: "YOUR_MEASUREMENT_ID"
    })),
    
    // Provide Firestore & Auth
    provideFirestore(() => getFirestore()),
    provideAuth(() => getAuth())
  ]
};

2. Using Services in Standalone Components

Inject the native Firebase instances directly using the provided tokens, and use the RxJS helpers:

import { Component, inject } from '@angular/core';
import { CommonModule } from '@angular/common';
import { Firestore, doc } from 'firebase/firestore';
import { docData } from 'ngx-firebase';
import { Observable } from 'rxjs';

@Component({
  selector: 'app-store-detail',
  standalone: true,
  imports: [CommonModule],
  template: `
    <div *ngIf="store$ | async as store">
      <h1>{{ store.name }}</h1>
      <p>{{ store.description }}</p>
    </div>
  `
})
export class StoreDetailComponent {
  private firestore = inject(Firestore);
  store$: Observable<any>;

  constructor() {
    // Reference a document using the native Firestore SDK
    const storeRef = doc(this.firestore, 'stores/store_123');
    
    // Wrap it reactively using docData
    this.store$ = docData(storeRef);
  }
}

3. Track Route Page Views Automatically (Google Analytics)

To enable automatic page view tracking, register provideAnalytics and inject ScreenTrackingService in your client config:

import { ApplicationConfig, provideEnvironmentInitializer, inject } from '@angular/core';
import { getAnalytics } from 'firebase/analytics';
import { provideAnalytics, ScreenTrackingService } from 'ngx-firebase';

export const clientConfig: ApplicationConfig = {
  providers: [
    provideAnalytics(() => getAnalytics()),
    ScreenTrackingService,
    provideEnvironmentInitializer(() => {
      // Force service initialization to listen to router events
      inject(ScreenTrackingService);
    })
  ]
};

📄 License

MIT © 2026 Sebas (quedicesebas)