🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@angular/fire

Package Overview
Dependencies
Maintainers
2
Versions
357
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@angular/fire

Angular + Firebase = ❤️

20.0.1
latest
Source
npm
Version published
Weekly downloads
138K
-17.5%
Maintainers
2
Weekly downloads
 
Created
Source

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 real-time streams.
  • NgRx friendly API - Integrate with NgRx using AngularFire's action based APIs.
  • Lazy-loading - AngularFire dynamically imports much of Firebase, reducing the 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, initializeApp } from '@angular/fire/app';
import { getFirestore, provideFirestore } from '@angular/fire/firestore';

export const appConfig: ApplicationConfig = {
  providers: [
    provideFirebaseApp(() => initializeApp({ ... })),
    provideFirestore(() => getFirestore()),
    ...
  ],
  ...
})
import { AsyncPipe } from '@angular/common';
import { inject } from '@angular/core';
import { Firestore, collectionData, collection } from '@angular/fire/firestore';

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

@Component({
  selector: 'app-root',
  template: `
  <ul>
    @for (item of (item$ | async); track item) {
      <li>
        {{ item.name }}
      </li>
    }
  </ul>
  `,
  imports: [AsyncPipe]
})
export class AppComponent {
  firestore = inject(Firestore);
  itemCollection = collection(this.firestore, 'items');
  item$ = collectionData<Item>(itemCollection);
}

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 from v6.0? Check out our guide.

Sample app

The sample folder contains a kitchen sink application that demonstrates use of the "modular" API, in a zoneless server-rendered application, with all the bells and whistles.

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: While relatively stable, AngularFire is a developer preview and is subject to change before general availability. 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 assumes you're using the new tree-shakable AngularFire API, if you're looking for the compatibility 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';

Vertex AI

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

Keywords

angular

FAQs

Package last updated on 12 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts