Angular + Firebase = ❤️
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
import { ApplicationConfig } from '@angular/core';
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
import { getFirestore, provideFirestore } from '@angular/fire/firestore';
export const appConfig: ApplicationConfig = {
providers: [
provideFirebaseApp(() => initializeApp({ /* ...your Firebase config... */ })),
provideFirestore(() => getFirestore()),
// ...
],
// ...
}import { AsyncPipe } from '@angular/common';
import { Component, 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 (items$ | async); track item) {
<li>
{{ item.name }}
</li>
}
</ul>
`,
imports: [AsyncPipe]
})
export class App {
firestore = inject(Firestore);
itemCollection = collection(this.firestore, 'items');
items$ = collectionData<Item>(this.itemCollection);
}Quickstart - Get your first application up and running by following our quickstart guide.
Deploying SSR to App Hosting - Deploy a server-rendered app to Firebase App Hosting, and avoid the silent SSR-to-CSR fallback.
Stackblitz Template - A runnable AngularFire example. Add your own Firebase configuration to connect it to your project.
Upgrading from v6.0? Check out our guide.
Upgrading from AngularFire 20? See the v21 upgrade guide.
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.
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: 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.
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..
AI Logic |
Analytics |
App Check |
Authentication |
Cloud Firestore |
Cloud Functions |
Cloud Messaging |
Cloud Storage |
Data Connect |
Performance Monitoring |
Realtime Database |
Remote Config |
`ng add @angular/fire@canary` installs the release candidate instead of the canary build
What happened to @angular/fire v21?
docs: the App Check guide does not cover server-side rendering
AppCheck Error: reCAPTCHA placeholder element must be empty
Angular 22 release please
Upgrade to Angular 22
Angular v21 support
Fix ng build warnings
Use `TransferState` to hand server-rendered Firestore data to the browser, instead of reading every document twice
Six `firebase` entry points have no `@angular/fire` equivalent, so their exports are unreachable