MCPcopy
hub / github.com/angular/angularfire

github.com/angular/angularfire @20.0.1 sqlite

repository ↗ · DeepWiki ↗ · release 20.0.1 ↗
727 symbols 1,817 edges 244 files 28 documented · 4%
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 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](docs/analytics.md#analytics)
import { } from '@angular/fire/analytics';
#### [Authentication](docs/auth.md#authentication)
import { } from '@angular/fire/auth';
#### [Cloud Firestore](docs/firestore.md#cloud-firestore)
import { } from '@angular/fire/firestore';
#### [Cloud Functions](docs/functions.md#cloud-functions)
import { } from '@angular/fire/functions';
#### [Cloud Messaging](docs/messaging.md#cloud-messaging)
import { } from '@angular/fire/messaging';
#### [Cloud Storage](docs/storage.md#cloud-storage)
import { } from '@angular/fire/storage';
#### [Performance Monitoring](docs/performance.md#performance-monitoring)
import { } from '@angular/fire/performance';
#### [Realtime Database](docs/database.md#realtime-database)
import { } from '@angular/fire/database';
#### [Remote Config](docs/remote-config.md#remote-config)
import { } from '@angular/fire/remote-config';
#### [App Check](docs/app-check.md#app-check)
import { } from '@angular/fire/app-check';
#### [Vertex AI](docs/vertexai.md#vertex-ai)
import { } from '@angular/fire/vertexai';

Extension points exported contracts — how you extend this code

OverrideOptions (Interface)
(no doc)
tools/build.ts
FirebaseAppWithContainer (Interface)
(no doc)
src/core.ts
Window (Interface)
(no doc)
src/test-config.ts
FirebaseApp (Interface)
(no doc)
src/compat/firebase.app.ts
Messaging (Interface)
(no doc)
src/messaging/messaging.ts
Database (Interface)
(no doc)
src/database/database.ts
Auth (Interface)
(no doc)
src/auth/auth.ts
NgAddOptions (Interface)
(no doc)
src/schematics/interfaces.ts

Core symbols most depended-on inside this repo

ɵzoneWrap
called by 314
src/zones.ts
rando
called by 78
src/utils.ts
set
called by 46
src/compat/database/interfaces.ts
forEach
called by 35
src/compat/database/interfaces.ts
add
called by 32
src/compat/firestore/collection/collection.ts
ɵgetAllInstancesOf
called by 28
src/core.ts
initializeApp
called by 28
src/compat/firebase.app.module.ts
then
called by 28
src/compat/storage/task.ts

Shape

Function 245
Method 198
Class 192
Interface 88
Enum 4

Languages

TypeScript100%

Modules by API surface

src/schematics/interfaces.ts38 symbols
src/compat/remote-config/remote-config.ts26 symbols
src/compat/database/interfaces.ts26 symbols
src/zones.ts16 symbols
src/compat/firestore/interfaces.ts13 symbols
tools/build.ts11 symbols
src/schematics/utils.ts11 symbols
src/compat/storage/ref.ts11 symbols
src/compat/firestore/collection/collection.ts11 symbols
src/schematics/setup/prompts.ts10 symbols
src/compat/performance/performance.ts10 symbols
src/compat/firestore/document/document.ts10 symbols

Dependencies from manifests, versioned

@11ty/eleventy0.11.1 · 1×
@11ty/eleventy-navigation0.1.6 · 1×
@angular-devkit/architect0.2000.0 · 1×
@angular-devkit/build-angular20.0.0 · 1×
@angular-devkit/core20.0.0 · 1×
@angular-devkit/schematics20.0.0 · 1×
@angular-eslint/builder20.0.0-alpha.1 · 1×
@angular-eslint/eslint-plugin20.0.0-alpha.1 · 1×
@angular/animations20.0.0 · 1×
@angular/cli20.0.0 · 1×
@angular/common20.0.0 · 1×
@angular/compiler20.0.0 · 1×

For agents

$ claude mcp add angularfire \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact