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

@qarapace/ngfire

v0.0.2

Published

Minimal Angular wrapper around the Firebase JS SDK

Readme

@qarapace/ngfire

A minimal Angular wrapper around the Firebase JS SDK.

Why

Inspired by @angular/fire and rxfire, ngfire aims to provide a thinner integration layer suited for modern Angular (zoneless, signals).

Stay minimal, stay current, stay out of the way.

Philosophy

  • Don't re-wrap what works: the Firebase JS SDK is well-designed, ngfire only adds value where Angular-specific bridging is needed
  • Thin layer: the less code between your app and Firebase, the easier it is to stay up to date and debug
  • Tree-shakable: single library covering App, Firestore, Auth, Functions, etc., import only what you use

Features

RxJS Observables

Firestore and Auth are inherently data flows — ngfire maps their listener-based APIs (onSnapshot, onAuthStateChanged, etc.) to RxJS Observables as the natural primitive.

For signals, Angular's built-in rxResource already bridges Observables seamlessly — no need for another wrapper.

Dependency Injection

Provide Firebase services (App, Firestore, Auth, Functions, etc.) through Angular DI with proper dependency chains:

FirebaseApp → Firestore
            → Auth
            → Functions
            → ...

Covered Firebase Products

  • App (initialization and configuration)
  • Analytics
  • Firestore
  • Auth
  • Functions

Installation

npm install @qarapace/ngfire

ngfire is a companion to the official firebase package — it does not bundle or replace it.

Usage

Configuration

// app.config.ts
import { provideNgFire } from '@qarapace/ngfire/app';
import { withAuth } from '@qarapace/ngfire/auth';
import { withFirestore } from '@qarapace/ngfire/firestore';
import { withFunctions } from '@qarapace/ngfire/functions';

export const appConfig: ApplicationConfig = {
  providers: [
    // Features are registered in order, guaranteeing factory execution sequence
    // (e.g. Auth is initialized before Firestore)
    provideNgFire(
      { firebase: environment.firebase },
      withAuth(),
      withFirestore(),
      withFunctions({ region: 'europe-west1' })
    ),
  ],
};

Auth service

import { inject, Injectable } from '@angular/core';
import { User } from 'firebase/auth';
import { Observable, first } from 'rxjs';
import { AUTH, onAuthStateChanged$ } from '@qarapace/ngfire/auth';

@Injectable({ providedIn: 'root' })
export class AuthService {
  private auth = inject(AUTH);

  // Cold observable — each subscriber gets its own Firebase listener
  readonly user$: Observable<User | null> = onAuthStateChanged$(this.auth);

  // Resolves once the auth state is known (useful for guards, resolvers, etc.)
  readonly onReady$ = this.user$.pipe(first());

  // Bridge to signals via Angular's built-in rxResource
  readonly user = rxResource({ stream: () => this.user$ });
}

Firestore service

import { inject, Injectable } from '@angular/core';
import { collection, doc, query, where } from 'firebase/firestore';
import { map } from 'rxjs';
import { FIRESTORE, onSnapshot$ } from '@qarapace/ngfire/firestore';

// Use the Firebase SDK directly — ngfire only provides essential helpers
// like onSnapshot$(), without unnecessary abstractions on top
@Injectable({ providedIn: 'root' })
export class DataService {
  private firestore = inject(FIRESTORE);

  getDocument(id: string) {
    return onSnapshot$(doc(this.firestore, 'items', id)).pipe(
      map((snap) => snap.data()),
    );
  }

  getActiveItems() {
    const q = query(
      collection(this.firestore, 'items'),
      where('active', '==', true),
    );
    return onSnapshot$(q).pipe(
      map((snap) => snap.docs.map((d) => d.data())),
    );
  }
}

Functions service

import { inject, Injectable } from '@angular/core';
import { httpsCallable } from 'firebase/functions';
import { FUNCTIONS } from '@qarapace/ngfire/functions';

@Injectable({ providedIn: 'root' })
export class FunctionsService {
  private functions = inject(FUNCTIONS);

  async sendEmail(to: string, subject: string) {
    const callable = httpsCallable(this.functions, 'sendEmail');
    return callable({ to, subject });
  }
}

Emulators

ngfire supports Firebase emulators out of the box. See Emulator Connection in the architecture doc for setup options, including a tree-shakable approach that keeps emulator code out of production builds.

Samples

The samples/ folder contains standalone usage examples, including integration with ngrx signal stores and rxResource.