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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@angular/fire

v17.0.1

Published

Angular + Firebase = ❤️

Downloads

449,838

Readme

AngularFire

AngularFire smooths over the rough edges an Angular developer might encounter when implementing the framework-agnostic Firebase JS SDK & aims to provide a more natural developer experience by conforming to Angular conventions.

ng add @angular/fire

  • Dependency injection - Provide and Inject Firebase services in your components
  • Zone.js wrappers - Stable zones allow proper functionality of service workers, forms, SSR, and pre-rendering
  • Observable based - Utilize RxJS rather than callbacks for realtime streams
  • NgRx friendly API - Integrate with NgRx using AngularFire's action based APIs.
  • Lazy-loading - AngularFire dynamically imports much of Firebase, reducing time to load your app
  • Deploy schematics - Get your Angular application deployed on Firebase Hosting with a single command
  • Google Analytics - Zero-effort Angular Router awareness in Google Analytics
  • Router Guards - Guard your Angular routes with built-in Firebase Authentication checks

Example use

import { provideFirebaseApp, getApp, initializeApp } from '@angular/fire/app';
import { getFirestore, provideFirestore } from '@angular/fire/firestore';

@NgModule({
  imports: [
    provideFirebaseApp(() => initializeApp({ ... })),
    provideFirestore(() => getFirestore()),
  ],
  ...
})
export class AppModule { }
import { inject } from '@angular/core';
import { Firestore, collectionData, collection } from '@angular/fire/firestore';
import { Observable } from 'rxjs';

interface Item {
  name: string,
  ...
};

@Component({
  selector: 'app-root',
  template: `
  <ul>
    <li *ngFor="let item of item$ | async">
      {{ item.name }}
    </li>
  </ul>
  `
})
export class AppComponent {
  item$: Observable<Item[]>;
  firestore: Firestore = inject(Firestore);

  constructor() {
    const itemCollection = collection(this.firestore, 'items');
    this.item$ = collectionData(itemCollection);
  }
}

Polyfills

Neither AngularFire or Firebase ship with polyfills. To have compatibility across as wide-range of environments we suggest the following polyfills be added to your application:

| API | Environments | Suggested Polyfill | License | |-----|--------------|--------------------|---------| | Various ES5+ features | Safari < 10 | core-js/stable | MIT | | globalThis | Chrome < 71Safari < 12.1iOS < 12.2Node < 12 | globalThis | MIT | | Proxy | Safari < 10 | proxy-polyfill | Apache 2.0 | | fetch | Safari < 10.1iOS < 10.3 | cross-fetch | MIT |

Resources

Quickstart - Get your first application up and running by following our quickstart guide.

Contributing

Stackblitz Template - Remember to set your Firebase configuration in app/app.module.ts.

Upgrading to v7.0? Check out our guide.

Sample apps

We have three sample apps in this repository:

  1. samples/compat a kitchen sink application that demonstrates use of the "compatibility" API
  2. samples/modular a kitchen sink application that demonstrates the new tree-shakable API
  3. samples/advanced the same app as samples/modular but demonstrates more advanced concepts such as Angular Universal state-transfer, dynamically importing Firebase feature modules, and Firestore data bundling.

Having troubles?

Get help on our Q&A board, the official Firebase Mailing List, the Firebase Community Slack (#angularfire2), the Angular Community Discord (#firebase), Gitter, the Firebase subreddit, or Stack Overflow.

NOTE: AngularFire is maintained by Googlers but is not a supported Firebase product. Questions on the mailing list and issues filed here are answered on a best-effort basis by maintainers and other community members. If you are able to reproduce a problem with Firebase outside of AngularFire's implementation, please file an issue on the Firebase JS SDK or reach out to the personalized Firebase support channel.

Developer Guide

This developer guide assimes you're using the new tree-shakable AngularFire API, if you're looking for the compatability API you can find the documentation here.

See the v7 upgrade guide for more information on this change..

Firebase product integrations

Analytics

import { } from '@angular/fire/analytics';

Authentication

import { } from '@angular/fire/auth';

Cloud Firestore

import { } from '@angular/fire/firestore';

Cloud Functions

import { } from '@angular/fire/functions';

Cloud Messaging

import { } from '@angular/fire/messaging';

Cloud Storage

import { } from '@angular/fire/storage';

Performance Monitoring

import { } from '@angular/fire/performance';

Realtime Database

import { } from '@angular/fire/database';

Remote Config

import { } from '@angular/fire/remote-config';

App Check

import { } from '@angular/fire/app-check';

Deploying your site

  • Deploy to Firebase Hosting
  • Angular Universal: Deploy to Cloud Functions
  • Angular Universal: Deploy to Cloud Run