@angular/fire 20.1.0 → 21.0.0-canary.20260927232311.sha-38dfc3f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -32
- package/ai/package.json +2 -1
- package/analytics/package.json +2 -1
- package/app/package.json +2 -1
- package/app-check/package.json +2 -1
- package/auth/package.json +2 -1
- package/auth-guard/package.json +2 -1
- package/compat/analytics/package.json +2 -1
- package/compat/auth/package.json +2 -1
- package/compat/auth-guard/package.json +2 -1
- package/compat/database/package.json +2 -1
- package/compat/firestore/package.json +2 -1
- package/compat/functions/package.json +2 -1
- package/compat/messaging/package.json +2 -1
- package/compat/package.json +2 -1
- package/compat/performance/package.json +2 -1
- package/compat/remote-config/package.json +2 -1
- package/compat/storage/package.json +2 -1
- package/data-connect/package.json +2 -1
- package/database/package.json +2 -1
- package/docs/ai.md +52 -0
- package/docs/analytics.md +2 -5
- package/docs/app-check.md +6 -8
- package/docs/app-hosting.md +95 -0
- package/docs/auth.md +214 -29
- package/docs/compat/auth/router-guards.md +1 -1
- package/docs/compat.md +1 -1
- package/docs/data-connect.md +56 -0
- package/docs/database.md +14 -12
- package/docs/deploy/getting-started.md +2 -0
- package/docs/firestore.md +7 -7
- package/docs/functions.md +3 -5
- package/docs/install-and-setup.md +45 -24
- package/docs/install-firebase-tools.md +2 -0
- package/docs/messaging.md +83 -52
- package/docs/performance.md +3 -5
- package/docs/remote-config.md +3 -5
- package/docs/storage.md +3 -5
- package/docs/version-21-upgrade.md +90 -0
- package/docs/zones.md +45 -1
- package/fesm2022/angular-fire-ai.mjs +8 -8
- package/fesm2022/angular-fire-ai.mjs.map +1 -1
- package/fesm2022/angular-fire-analytics.mjs +10 -10
- package/fesm2022/angular-fire-analytics.mjs.map +1 -1
- package/fesm2022/angular-fire-app-check.mjs +4 -4
- package/fesm2022/angular-fire-app-check.mjs.map +1 -1
- package/fesm2022/angular-fire-app.mjs +5 -6
- package/fesm2022/angular-fire-app.mjs.map +1 -1
- package/fesm2022/angular-fire-auth-guard.mjs +7 -7
- package/fesm2022/angular-fire-auth-guard.mjs.map +1 -1
- package/fesm2022/angular-fire-auth.mjs +4 -4
- package/fesm2022/angular-fire-auth.mjs.map +1 -1
- package/fesm2022/angular-fire-compat-analytics.mjs +17 -21
- package/fesm2022/angular-fire-compat-analytics.mjs.map +1 -1
- package/fesm2022/angular-fire-compat-auth-guard.mjs +7 -7
- package/fesm2022/angular-fire-compat-auth-guard.mjs.map +1 -1
- package/fesm2022/angular-fire-compat-auth.mjs +9 -11
- package/fesm2022/angular-fire-compat-auth.mjs.map +1 -1
- package/fesm2022/angular-fire-compat-database.mjs +11 -13
- package/fesm2022/angular-fire-compat-database.mjs.map +1 -1
- package/fesm2022/angular-fire-compat-firestore.mjs +12 -14
- package/fesm2022/angular-fire-compat-firestore.mjs.map +1 -1
- package/fesm2022/angular-fire-compat-functions.mjs +7 -7
- package/fesm2022/angular-fire-compat-functions.mjs.map +1 -1
- package/fesm2022/angular-fire-compat-messaging.mjs +9 -11
- package/fesm2022/angular-fire-compat-messaging.mjs.map +1 -1
- package/fesm2022/angular-fire-compat-performance.mjs +13 -17
- package/fesm2022/angular-fire-compat-performance.mjs.map +1 -1
- package/fesm2022/angular-fire-compat-remote-config.mjs +11 -16
- package/fesm2022/angular-fire-compat-remote-config.mjs.map +1 -1
- package/fesm2022/angular-fire-compat-storage.mjs +16 -18
- package/fesm2022/angular-fire-compat-storage.mjs.map +1 -1
- package/fesm2022/angular-fire-compat.mjs +8 -9
- package/fesm2022/angular-fire-compat.mjs.map +1 -1
- package/fesm2022/angular-fire-data-connect.mjs +4 -4
- package/fesm2022/angular-fire-data-connect.mjs.map +1 -1
- package/fesm2022/angular-fire-database.mjs +4 -4
- package/fesm2022/angular-fire-database.mjs.map +1 -1
- package/fesm2022/angular-fire-firestore-lite.mjs +4 -4
- package/fesm2022/angular-fire-firestore-lite.mjs.map +1 -1
- package/fesm2022/angular-fire-firestore.mjs +9 -6
- package/fesm2022/angular-fire-firestore.mjs.map +1 -1
- package/fesm2022/angular-fire-functions.mjs +4 -4
- package/fesm2022/angular-fire-functions.mjs.map +1 -1
- package/fesm2022/angular-fire-messaging.mjs +10 -6
- package/fesm2022/angular-fire-messaging.mjs.map +1 -1
- package/fesm2022/angular-fire-performance.mjs +5 -8
- package/fesm2022/angular-fire-performance.mjs.map +1 -1
- package/fesm2022/angular-fire-remote-config.mjs +7 -6
- package/fesm2022/angular-fire-remote-config.mjs.map +1 -1
- package/fesm2022/angular-fire-storage.mjs +4 -4
- package/fesm2022/angular-fire-storage.mjs.map +1 -1
- package/fesm2022/angular-fire.mjs +4 -6
- package/fesm2022/angular-fire.mjs.map +1 -1
- package/firestore/lite/package.json +2 -1
- package/firestore/package.json +2 -1
- package/functions/package.json +2 -1
- package/messaging/package.json +2 -1
- package/package.json +73 -69
- package/performance/package.json +2 -1
- package/publish.sh +1 -1
- package/remote-config/package.json +2 -1
- package/schematics/add/index.js +1 -1
- package/schematics/deploy/actions.js +76 -85
- package/schematics/deploy/builder.js +161 -170
- package/schematics/deploy/schema.json +6 -3
- package/schematics/migration.json +4 -4
- package/schematics/setup/index.js +174 -172
- package/schematics/update/v21/index.js +1 -0
- package/schematics/update/v7/index.js +1 -1
- package/storage/package.json +2 -1
- package/{ai/index.d.ts → types/angular-fire-ai.d.ts} +4 -4
- package/{app/index.d.ts → types/angular-fire-app.d.ts} +1 -1
- package/{auth-guard/index.d.ts → types/angular-fire-auth-guard.d.ts} +2 -2
- package/{compat/analytics/index.d.ts → types/angular-fire-compat-analytics.d.ts} +2 -2
- package/{compat/auth-guard/index.d.ts → types/angular-fire-compat-auth-guard.d.ts} +2 -2
- package/{compat/auth/index.d.ts → types/angular-fire-compat-auth.d.ts} +1 -1
- package/{compat/database/index.d.ts → types/angular-fire-compat-database.d.ts} +5 -6
- package/{compat/firestore/index.d.ts → types/angular-fire-compat-firestore.d.ts} +5 -11
- package/{compat/functions/index.d.ts → types/angular-fire-compat-functions.d.ts} +1 -1
- package/{compat/messaging/index.d.ts → types/angular-fire-compat-messaging.d.ts} +2 -2
- package/{compat/performance/index.d.ts → types/angular-fire-compat-performance.d.ts} +2 -2
- package/{compat/remote-config/index.d.ts → types/angular-fire-compat-remote-config.d.ts} +3 -3
- package/{compat/storage/index.d.ts → types/angular-fire-compat-storage.d.ts} +18 -18
- package/{compat/index.d.ts → types/angular-fire-compat.d.ts} +2 -2
- package/{firestore/lite/index.d.ts → types/angular-fire-firestore-lite.d.ts} +1 -1
- package/{firestore/index.d.ts → types/angular-fire-firestore.d.ts} +6 -3
- package/{messaging/index.d.ts → types/angular-fire-messaging.d.ts} +6 -2
- package/{remote-config/index.d.ts → types/angular-fire-remote-config.d.ts} +3 -2
- package/docs/firebase.json +0 -16
- package/docs/install-angular-cli-windows10.md +0 -82
- package/docs/vertexai.md +0 -53
- package/fesm2022/angular-fire-vertexai.mjs +0 -102
- package/fesm2022/angular-fire-vertexai.mjs.map +0 -1
- package/schematics/update/index.js +0 -1
- package/vertexai/index.d.ts +0 -33
- package/vertexai/package.json +0 -3
- /package/{analytics/index.d.ts → types/angular-fire-analytics.d.ts} +0 -0
- /package/{app-check/index.d.ts → types/angular-fire-app-check.d.ts} +0 -0
- /package/{auth/index.d.ts → types/angular-fire-auth.d.ts} +0 -0
- /package/{data-connect/index.d.ts → types/angular-fire-data-connect.d.ts} +0 -0
- /package/{database/index.d.ts → types/angular-fire-database.d.ts} +0 -0
- /package/{functions/index.d.ts → types/angular-fire-functions.d.ts} +0 -0
- /package/{performance/index.d.ts → types/angular-fire-performance.d.ts} +0 -0
- /package/{storage/index.d.ts → types/angular-fire-storage.d.ts} +0 -0
- /package/{index.d.ts → types/angular-fire.d.ts} +0 -0
|
@@ -1,44 +1,62 @@
|
|
|
1
1
|
# AngularFire Quickstart
|
|
2
2
|
|
|
3
|
+
## Before you begin
|
|
4
|
+
|
|
5
|
+
- **Firebase CLI**
|
|
6
|
+
- Setup uses the Firebase CLI (`firebase-tools`). Install it with `npm install -g firebase-tools`, then run `firebase login`. If `ng add` can't find a copy, it installs the newest version for you.
|
|
7
|
+
- Run `ng add` yourself, not through an AI agent.
|
|
8
|
+
- In AngularFire 21.0.0-rc.1 and earlier, `ng add` run by an agent with firebase-tools 15.26 or later stops after you choose features, with `Cannot read properties of undefined (reading 'email')`.
|
|
9
|
+
- If it already stopped, run `ng add @angular/fire@next` again yourself. The stopped run leaves only an empty `firebase.json`, which the second run reuses.
|
|
10
|
+
- A copy older than 14 stops setup with `firebase-tools version 14.0.0+ is required, please upgrade and run again`, and `ng add` does not upgrade a copy you already have.
|
|
11
|
+
- **Harmless CLI noise.** The Firebase CLI may print a `punycode` deprecation warning or ask about enabling extra features (for example Gemini) during setup. These come from the CLI, not from AngularFire, and are safe to ignore.
|
|
12
|
+
|
|
3
13
|
### 1. Create a new project
|
|
4
14
|
|
|
5
15
|
```bash
|
|
6
16
|
# Using yarn create
|
|
7
|
-
yarn create @angular <project-name>
|
|
17
|
+
yarn create @angular@21 <project-name>
|
|
8
18
|
cd <project-name>
|
|
9
19
|
```
|
|
10
20
|
or
|
|
11
21
|
|
|
12
22
|
```bash
|
|
13
23
|
# Using npm create
|
|
14
|
-
npm create @angular <project-name>
|
|
24
|
+
npm create @angular@21 <project-name>
|
|
15
25
|
cd <project-name>
|
|
16
26
|
```
|
|
17
27
|
|
|
18
28
|
optionally installing the tooling directly:
|
|
19
29
|
```bash
|
|
20
30
|
# Installing the tooling directly
|
|
21
|
-
npm install -g @angular/cli
|
|
31
|
+
npm install -g @angular/cli@21
|
|
22
32
|
ng new <project-name>
|
|
23
33
|
cd <project-name>
|
|
24
34
|
```
|
|
25
35
|
|
|
26
|
-
|
|
36
|
+
These commands set up an Angular 21 project, the version AngularFire 21 supports.
|
|
27
37
|
|
|
28
38
|
### 2. Install AngularFire and Firebase
|
|
29
39
|
|
|
40
|
+
AngularFire 21 is currently a release candidate, published under the `next` tag:
|
|
41
|
+
|
|
30
42
|
```bash
|
|
31
|
-
ng add @angular/fire
|
|
43
|
+
ng add @angular/fire@next
|
|
32
44
|
```
|
|
33
45
|
|
|
34
|
-
|
|
46
|
+
This installs AngularFire and configures your project. `ng add` will:
|
|
35
47
|
|
|
36
|
-
1.
|
|
37
|
-
2.
|
|
48
|
+
1. Prompt you to select the features to enable and the Firebase project to use, signing you in to Firebase if needed.
|
|
49
|
+
2. Add `provideFirebaseApp(...)`, along with a provider for each feature you select, to your app configuration (for example `app.config.ts`), with your Firebase configuration inlined. No environment files are created.
|
|
50
|
+
|
|
51
|
+
`ng add` writes the version it installed into your `package.json`, and today that is a canary release such as `21.0.0-rc.1-canary.95b3de1` rather than the release candidate. To replace it with the release candidate, `21.0.0-rc.1`, run:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npm install --save-exact @angular/fire@next
|
|
55
|
+
```
|
|
38
56
|
|
|
39
57
|
### 3. Inject `Firestore`
|
|
40
58
|
|
|
41
|
-
Open `/src/app/app.
|
|
59
|
+
Open `/src/app/app.ts` and make the following changes:
|
|
42
60
|
|
|
43
61
|
```ts
|
|
44
62
|
import { Component, inject } from '@angular/core';
|
|
@@ -47,11 +65,11 @@ import { Firestore } from '@angular/fire/firestore';
|
|
|
47
65
|
|
|
48
66
|
@Component({
|
|
49
67
|
selector: 'app-root',
|
|
50
|
-
templateUrl: 'app.
|
|
51
|
-
|
|
68
|
+
templateUrl: './app.html',
|
|
69
|
+
styleUrl: './app.css',
|
|
52
70
|
imports: [AsyncPipe],
|
|
53
71
|
})
|
|
54
|
-
export class
|
|
72
|
+
export class App {
|
|
55
73
|
firestore: Firestore = inject(Firestore);
|
|
56
74
|
|
|
57
75
|
constructor() {
|
|
@@ -62,7 +80,7 @@ export class AppComponent {
|
|
|
62
80
|
|
|
63
81
|
### 4. Bind a Firestore collection to a list
|
|
64
82
|
|
|
65
|
-
In `/src/app/app.
|
|
83
|
+
In `/src/app/app.ts`:
|
|
66
84
|
|
|
67
85
|
```ts
|
|
68
86
|
import { Component, inject } from '@angular/core';
|
|
@@ -70,25 +88,28 @@ import { AsyncPipe } from '@angular/common';
|
|
|
70
88
|
import { Observable } from 'rxjs';
|
|
71
89
|
import { Firestore, collection, collectionData } from '@angular/fire/firestore';
|
|
72
90
|
|
|
91
|
+
interface Item {
|
|
92
|
+
name: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
73
95
|
@Component({
|
|
74
96
|
selector: 'app-root',
|
|
75
|
-
standalone: true,
|
|
76
97
|
imports: [AsyncPipe],
|
|
77
|
-
templateUrl: 'app.
|
|
78
|
-
|
|
98
|
+
templateUrl: './app.html',
|
|
99
|
+
styleUrl: './app.css'
|
|
79
100
|
})
|
|
80
|
-
export class
|
|
101
|
+
export class App {
|
|
81
102
|
firestore: Firestore = inject(Firestore);
|
|
82
|
-
items$: Observable<
|
|
103
|
+
items$: Observable<Item[]>;
|
|
83
104
|
|
|
84
105
|
constructor() {
|
|
85
106
|
const aCollection = collection(this.firestore, 'items')
|
|
86
|
-
this.items$ = collectionData(aCollection);
|
|
107
|
+
this.items$ = collectionData<Item>(aCollection);
|
|
87
108
|
}
|
|
88
109
|
}
|
|
89
110
|
```
|
|
90
111
|
|
|
91
|
-
Open `/src/app/app.
|
|
112
|
+
Open `/src/app/app.html`:
|
|
92
113
|
|
|
93
114
|
```html
|
|
94
115
|
<ul>
|
|
@@ -112,8 +133,8 @@ Once you've created a `items` collection and are inserting documents, you should
|
|
|
112
133
|
|
|
113
134
|
### 6. Deploy your app
|
|
114
135
|
|
|
115
|
-
|
|
136
|
+
How you deploy depends on whether your app uses server-side rendering (SSR), which the Angular CLI asks about when you create the project.
|
|
116
137
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
138
|
+
**Client-side rendered apps** (the default) build to static files, which you deploy to Firebase Hosting. Follow Firebase's [Hosting quickstart](https://firebase.google.com/docs/hosting/quickstart) to build and deploy your app.
|
|
139
|
+
|
|
140
|
+
**Server-side rendered apps** run a Node server, so deploy them to [Firebase App Hosting](app-hosting.md), Firebase's recommended path for SSR. That guide also covers a common case where an SSR app silently falls back to client-side rendering after deploying.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Firebase Tools Install and Setup
|
|
2
2
|
|
|
3
|
+
> Setting up AngularFire? Run `ng add @angular/fire` yourself, not through an AI agent. In AngularFire 21.0.0-rc.1 and earlier, `ng add` run by an agent with firebase-tools 15.26 or later stops after you choose AngularFire features, with `Cannot read properties of undefined (reading 'email')`.
|
|
4
|
+
|
|
3
5
|
### 1. Install package
|
|
4
6
|
|
|
5
7
|
```bash
|
package/docs/messaging.md
CHANGED
|
@@ -6,18 +6,16 @@
|
|
|
6
6
|
|
|
7
7
|
# Cloud Messaging
|
|
8
8
|
|
|
9
|
-
Firebase FCM allows you to register devices with unique FCM tokens, that you can later
|
|
9
|
+
Firebase Cloud Messaging (FCM) allows you to register devices with unique FCM tokens, that you can later programatically send notifications to using Firebase Cloud Functions. It is up to the application to update these tokens in Firebase if you want to use them in other layers of your application, i.e send a notification to all administrators, etc. In that case, you would likely want to store your fcm tokens on your user collection, or a sub collection or another collection with different permissions.
|
|
10
10
|
|
|
11
11
|
## Dependency Injection
|
|
12
12
|
|
|
13
|
-
As a prerequisite, ensure that `AngularFire` has been added to your project
|
|
14
|
-
```bash
|
|
15
|
-
ng add @angular/fire
|
|
16
|
-
```
|
|
13
|
+
As a prerequisite, ensure that `AngularFire` has been added to your project as described in the [Quickstart](./install-and-setup.md).
|
|
17
14
|
|
|
18
15
|
Provide a Cloud Messaging instance in the application's `app.config.ts`:
|
|
19
16
|
|
|
20
17
|
```ts
|
|
18
|
+
import { ApplicationConfig } from '@angular/core';
|
|
21
19
|
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
|
|
22
20
|
import { provideMessaging, getMessaging } from '@angular/fire/messaging';
|
|
23
21
|
|
|
@@ -28,7 +26,7 @@ export const appConfig: ApplicationConfig = {
|
|
|
28
26
|
...
|
|
29
27
|
],
|
|
30
28
|
...
|
|
31
|
-
}
|
|
29
|
+
}
|
|
32
30
|
```
|
|
33
31
|
|
|
34
32
|
Next inject `Messaging` into your component:
|
|
@@ -46,7 +44,7 @@ export class AppComponent {
|
|
|
46
44
|
|
|
47
45
|
# Create a Firebase Messaging Service Worker
|
|
48
46
|
|
|
49
|
-
There are two parts to Firebase Messaging, a Service Worker and the DOM API. Angular Fire Messaging allows you to request permission,
|
|
47
|
+
There are two parts to Firebase Messaging, a Service Worker and the DOM API. Angular Fire Messaging allows you to request permission, register this app instance, observe when it is registered or unregistered, and subscribe to messages on the DOM side. To register to receive notifications you need to set up the Service Worker. [The official Firebase documentation for setting up the details exactly how to do that](https://firebase.google.com/docs/cloud-messaging/js/client).
|
|
50
48
|
|
|
51
49
|
#### Create your firebase-messaging-sw.js file in your src/assets folder
|
|
52
50
|
|
|
@@ -54,11 +52,12 @@ There are two parts to Firebase Messaging, a Service Worker and the DOM API. Ang
|
|
|
54
52
|
|
|
55
53
|
It may be wise to use file replacements or environments here for different environments
|
|
56
54
|
|
|
57
|
-
```
|
|
58
|
-
|
|
55
|
+
```js
|
|
56
|
+
/* Replace <firebase-version> with the firebase version in your package.json. The service
|
|
57
|
+
* worker and your application have to load the same version. */
|
|
59
58
|
|
|
60
|
-
import { initializeApp } from "https://www.gstatic.com/firebasejs
|
|
61
|
-
import { getMessaging } from "https://www.gstatic.com/firebasejs
|
|
59
|
+
import { initializeApp } from "https://www.gstatic.com/firebasejs/<firebase-version>/firebase-app.js";
|
|
60
|
+
import { getMessaging } from "https://www.gstatic.com/firebasejs/<firebase-version>/firebase-messaging-sw.js";
|
|
62
61
|
|
|
63
62
|
const firebaseApp = initializeApp({
|
|
64
63
|
apiKey: "",
|
|
@@ -72,61 +71,92 @@ const firebaseApp = initializeApp({
|
|
|
72
71
|
const messaging = getMessaging(firebaseApp);
|
|
73
72
|
```
|
|
74
73
|
|
|
74
|
+
# Registering this app instance
|
|
75
|
+
|
|
76
|
+
Firebase deprecated `getToken` and `deleteToken` in firebase 12.18 and will remove them. Use `register` with `onRegistered` in place of `getToken`, and `unregister` with `onUnregistered` in place of `deleteToken`. [Firebase's client guide](https://firebase.google.com/docs/cloud-messaging/js/client) describes the model and asks that you not mix the two sets.
|
|
77
|
+
|
|
78
|
+
Three things to know before you copy the example below:
|
|
79
|
+
|
|
80
|
+
- `onRegistered` has to be listening before `register` runs, which is why the example subscribes first. Otherwise `register` throws `No onRegistered callback handler was provided or registered.`
|
|
81
|
+
- **Ask for notification permission yourself before calling `register`,** as the example does. Otherwise `register` asks for you from inside a call AngularFire wraps, which holds the client app unstable until the dialog is dismissed.
|
|
82
|
+
- That delays Angular event replay and clearing the server-rendered DOM, and logs a development-only warning after ten seconds. Asking first avoids all of it.
|
|
83
|
+
- This behavior may change in a future release.
|
|
84
|
+
- The identifier reaches you through a callback rather than as a return value, and again whenever it changes, so store it from inside the callback rather than once at startup.
|
|
85
|
+
|
|
75
86
|
# Example messaging service
|
|
76
87
|
|
|
77
|
-
```
|
|
78
|
-
import { Injectable } from "@angular/core";
|
|
79
|
-
import { Messaging,
|
|
88
|
+
```ts
|
|
89
|
+
import { EnvironmentInjector, Injectable, inject, runInInjectionContext } from "@angular/core";
|
|
90
|
+
import { Messaging, MessagePayload, onMessage, onRegistered, onUnregistered, register, unregister } from "@angular/fire/messaging";
|
|
80
91
|
import { Observable, tap } from "rxjs";
|
|
81
92
|
|
|
82
|
-
@Injectable({
|
|
83
|
-
providedIn: "root",
|
|
84
|
-
})
|
|
93
|
+
@Injectable({ providedIn: "root" })
|
|
85
94
|
export class FcmService {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
+
private readonly injector = inject(EnvironmentInjector);
|
|
96
|
+
/* `onMessage` converted to an observable. Returns the unsubscribe function returned by
|
|
97
|
+
* `onMessage` to stop the listener when the last subscriber unsubscribes. */
|
|
98
|
+
message$ = new Observable<MessagePayload>(
|
|
99
|
+
subscriber => onMessage(this.msg, (msg) => subscriber.next(msg))
|
|
100
|
+
).pipe(tap((msg) => console.log("My Firebase Cloud Message", msg)));
|
|
101
|
+
|
|
102
|
+
constructor(private msg: Messaging) {
|
|
103
|
+
// Set listeners before calling `register` to avoid throwing.
|
|
104
|
+
this.listenForRegistrationChanges();
|
|
105
|
+
this.registerForMessages();
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
private listenForRegistrationChanges() {
|
|
109
|
+
onRegistered(this.msg, (installationId) => {
|
|
110
|
+
/* This is a good place to store it in your database for each user.
|
|
111
|
+
* This callback fires whenever `installationId` changes. */
|
|
112
|
+
console.log("my installation id", installationId);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
onUnregistered(this.msg, (installationId) => {
|
|
116
|
+
// Drop it from your database. Sending messages to an unregistered ID results in a 404.
|
|
117
|
+
console.log("no longer registered", installationId);
|
|
95
118
|
});
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
// This is a good place to then store it on your database for each user
|
|
107
|
-
});
|
|
108
|
-
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
private async registerForMessages() {
|
|
122
|
+
/* Request notification permission before calling `register`, otherwise
|
|
123
|
+
* `register` holds the app unstable until the user answers. */
|
|
124
|
+
if (
|
|
125
|
+
Notification.permission === "default" &&
|
|
126
|
+
await Notification.requestPermission() !== "granted"
|
|
127
|
+
) {
|
|
128
|
+
return;
|
|
109
129
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
130
|
+
|
|
131
|
+
// Register the service worker.
|
|
132
|
+
const serviceWorkerRegistration = await navigator.serviceWorker
|
|
133
|
+
.register("/assets/firebase-messaging-sw.js", { type: "module" });
|
|
134
|
+
|
|
135
|
+
/* Run `register` inside an injection context. Outside one AngularFire cannot wrap it, and
|
|
136
|
+
* warns. See `zones.md` for what wrapping adds. */
|
|
137
|
+
runInInjectionContext(this.injector, () =>
|
|
138
|
+
register(this.msg, {
|
|
139
|
+
vapidKey: `an optional public VAPID key you generate for your Firebase project`,
|
|
140
|
+
serviceWorkerRegistration,
|
|
141
|
+
}).catch((error) => console.error("could not register for messages", error))
|
|
115
142
|
);
|
|
116
|
-
}
|
|
117
|
-
deleteToken(){
|
|
118
|
-
// We can also delete fcm tokens, make sure to also update this on your firestore db if you are storing them as well
|
|
119
|
-
await deleteToken(this.msg);
|
|
120
143
|
}
|
|
144
|
+
|
|
145
|
+
// Called from your app, for example when a user turns notifications off.
|
|
146
|
+
async unregister() {
|
|
147
|
+
// This calls the imported unregister, not this method. Class methods are not in lexical scope.
|
|
148
|
+
await unregister(this.msg);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
121
151
|
```
|
|
122
152
|
|
|
123
153
|
# Testing and Sending Notifications
|
|
124
154
|
|
|
125
155
|
Firebase will allow you to send a test notification under Engage > Messaging > New Campaign > Notifications. Here you can click send a test message. Additionally, you can send them programmatically through Firebase cloud functions.
|
|
126
156
|
|
|
127
|
-
Here is a barebones Node example
|
|
157
|
+
Here is a barebones Node example. Its `token` field still accepts a Firebase Installation ID during the migration, so it works whether you registered with `getToken` or with `register`. Firebase's [Admin SDK send guide](https://firebase.google.com/docs/cloud-messaging/send/admin-sdk) documents a dedicated `fid` field to move to.
|
|
128
158
|
|
|
129
|
-
```
|
|
159
|
+
```ts
|
|
130
160
|
export const sendTestMessage = onRequest(async (_, res) => {
|
|
131
161
|
try {
|
|
132
162
|
const message = {
|
|
@@ -147,7 +177,7 @@ export const sendTestMessage = onRequest(async (_, res) => {
|
|
|
147
177
|
|
|
148
178
|
Here is a Node example that listens for a new comment on a collection, then sends a notification, and also adds it to a cache on Firebase so users can click through them.
|
|
149
179
|
|
|
150
|
-
```
|
|
180
|
+
```ts
|
|
151
181
|
exports.onPostReply =
|
|
152
182
|
onDocumentCreated("comments/{commentId}", async (event) => {
|
|
153
183
|
if (!event) throw new Error("No event found for document creation");
|
|
@@ -222,4 +252,5 @@ async function createNotificationAndCache(
|
|
|
222
252
|
firestore.collection("notificationCache").add(notificationCacheValue));
|
|
223
253
|
|
|
224
254
|
await Promise.all(promises);
|
|
225
|
-
}
|
|
255
|
+
}
|
|
256
|
+
```
|
package/docs/performance.md
CHANGED
|
@@ -12,14 +12,12 @@ Firebase Performance Monitoring is a service that helps you to gain insight into
|
|
|
12
12
|
|
|
13
13
|
## Dependency Injection
|
|
14
14
|
|
|
15
|
-
As a prerequisite, ensure that `AngularFire` has been added to your project
|
|
16
|
-
```bash
|
|
17
|
-
ng add @angular/fire
|
|
18
|
-
```
|
|
15
|
+
As a prerequisite, ensure that `AngularFire` has been added to your project as described in the [Quickstart](./install-and-setup.md).
|
|
19
16
|
|
|
20
17
|
Provide a Performance instance in the application's `app.config.ts`:
|
|
21
18
|
|
|
22
19
|
```ts
|
|
20
|
+
import { ApplicationConfig } from '@angular/core';
|
|
23
21
|
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
|
|
24
22
|
import { providePerformance, getPerformance } from '@angular/fire/performance';
|
|
25
23
|
|
|
@@ -30,7 +28,7 @@ export const appConfig: ApplicationConfig = {
|
|
|
30
28
|
...
|
|
31
29
|
],
|
|
32
30
|
...
|
|
33
|
-
}
|
|
31
|
+
}
|
|
34
32
|
```
|
|
35
33
|
|
|
36
34
|
Next inject `Performance` into your component:
|
package/docs/remote-config.md
CHANGED
|
@@ -12,14 +12,12 @@ Firebase Remote Config is a cloud service that lets you change the behavior and
|
|
|
12
12
|
|
|
13
13
|
## Dependency Injection
|
|
14
14
|
|
|
15
|
-
As a prerequisite, ensure that `AngularFire` has been added to your project
|
|
16
|
-
```bash
|
|
17
|
-
ng add @angular/fire
|
|
18
|
-
```
|
|
15
|
+
As a prerequisite, ensure that `AngularFire` has been added to your project as described in the [Quickstart](./install-and-setup.md).
|
|
19
16
|
|
|
20
17
|
Provide a Remote Config instance in the application's `app.config.ts`:
|
|
21
18
|
|
|
22
19
|
```ts
|
|
20
|
+
import { ApplicationConfig } from '@angular/core';
|
|
23
21
|
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
|
|
24
22
|
import { provideRemoteConfig, getRemoteConfig } from '@angular/fire/remote-config';
|
|
25
23
|
|
|
@@ -30,7 +28,7 @@ export const appConfig: ApplicationConfig = {
|
|
|
30
28
|
...
|
|
31
29
|
],
|
|
32
30
|
...
|
|
33
|
-
}
|
|
31
|
+
}
|
|
34
32
|
```
|
|
35
33
|
|
|
36
34
|
Next inject `RemoteConfig` into your component:
|
package/docs/storage.md
CHANGED
|
@@ -14,14 +14,12 @@ Cloud Storage allows developers to upload and share user generated content such
|
|
|
14
14
|
|
|
15
15
|
AngularFire allows you to work with Firebase Storage via Angular's Dependency Injection.
|
|
16
16
|
|
|
17
|
-
As a prerequisite, ensure that `AngularFire` has been added to your project
|
|
18
|
-
```bash
|
|
19
|
-
ng add @angular/fire
|
|
20
|
-
```
|
|
17
|
+
As a prerequisite, ensure that `AngularFire` has been added to your project as described in the [Quickstart](./install-and-setup.md).
|
|
21
18
|
|
|
22
19
|
Provide a Cloud Storage instance in the application's `app.config.ts`:
|
|
23
20
|
|
|
24
21
|
```ts
|
|
22
|
+
import { ApplicationConfig } from '@angular/core';
|
|
25
23
|
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
|
|
26
24
|
import { provideStorage, getStorage } from '@angular/fire/storage';
|
|
27
25
|
|
|
@@ -32,7 +30,7 @@ export const appConfig: ApplicationConfig = {
|
|
|
32
30
|
...
|
|
33
31
|
],
|
|
34
32
|
...
|
|
35
|
-
}
|
|
33
|
+
}
|
|
36
34
|
```
|
|
37
35
|
|
|
38
36
|
Next inject `Storage` into your component:
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Upgrading to the AngularFire 21 Release Candidate
|
|
2
|
+
|
|
3
|
+
AngularFire 21 targets **Angular 21** and the **Firebase JS SDK v12**. Most of the upgrade is handled for you by `ng update`.
|
|
4
|
+
|
|
5
|
+
## Run the update
|
|
6
|
+
|
|
7
|
+
The release candidate is published under the `next` tag. From an app on Angular 20 and AngularFire 20, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ng update @angular/core@21 @angular/cli@21 @angular/fire@next
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
`ng update` writes the range `^21.0.0-rc.1` into your `package.json`. That range also matches canary releases, and npm currently installs one of them, such as `21.0.0-rc.1-canary.95b3de1`, instead of the release candidate. To install the release candidate itself, and stop npm from picking a canary release on a later install, change the entry to the exact version `21.0.0-rc.1` by running:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install --save-exact @angular/fire@next
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The AngularFire update runs a migration that:
|
|
20
|
+
|
|
21
|
+
- **Aligns your `firebase` dependency to `^12.18.0`.** AngularFire 21 requires Firebase JS SDK 12, at 12.18 or later. If your app requested an older `firebase`, whether that is 11 or an earlier 12, npm would install both that copy and the one AngularFire needs side by side, and the two copies reject each other's objects at runtime. The migration updates the dependency and reinstalls so you end up with a single copy. Verify with `npm ls firebase`.
|
|
22
|
+
- **Rewrites Vertex AI imports to AI Logic** (see below).
|
|
23
|
+
|
|
24
|
+
## Vertex AI is now Firebase AI Logic
|
|
25
|
+
|
|
26
|
+
The Vertex AI module has been renamed to Firebase AI Logic. The `@angular/fire/vertexai` entry point (and the older `@angular/fire/vertexai-preview`) are removed in favor of `@angular/fire/ai`:
|
|
27
|
+
|
|
28
|
+
| Before (`@angular/fire/vertexai`) | After (`@angular/fire/ai`) |
|
|
29
|
+
|---|---|
|
|
30
|
+
| `getVertexAI(app?, { location? })` | `getAI(app, { backend: new AgentPlatformBackend(location?) })` |
|
|
31
|
+
| `provideVertexAI` | `provideAI` |
|
|
32
|
+
| `VertexAI` | `AI` |
|
|
33
|
+
| `VertexAIError` | `AIError` |
|
|
34
|
+
| `VertexAIErrorCode` | `AIErrorCode` |
|
|
35
|
+
| `VertexAIModel` | `AIModel` |
|
|
36
|
+
| `VertexAIInstances` | `AIInstances` |
|
|
37
|
+
| `vertexAIInstance$` | `AIInstance$` |
|
|
38
|
+
| `VertexAIModule` | `AIModule` |
|
|
39
|
+
|
|
40
|
+
### `getVertexAI` is not a plain rename
|
|
41
|
+
|
|
42
|
+
`getAI` already existed alongside it, and a plain `getAI()` call talks to the Gemini Developer API backend, not to the Agent Platform Gemini API (formerly Vertex AI). The equivalent of `getVertexAI()` is `getAI(app, { backend: new AgentPlatformBackend() })`, which is what the migration writes, so your app keeps calling the backend it was configured, enabled, and billed for. A `location` option moves into the `AgentPlatformBackend` constructor.
|
|
43
|
+
|
|
44
|
+
### The default region changes
|
|
45
|
+
|
|
46
|
+
`getVertexAI()` with no `location` resolved to `us-central1`. `AgentPlatformBackend` with no argument resolves to `global`. Firebase suggests `global` when your model supports it, and the Gemini 3.x models are only available there, which is why the migration writes it. To keep the region you had instead, write `new AgentPlatformBackend('us-central1')`.
|
|
47
|
+
|
|
48
|
+
Review this before deploying if your project has a data residency requirement.
|
|
49
|
+
|
|
50
|
+
#### Which calls move, and what the migration tells you
|
|
51
|
+
|
|
52
|
+
- A call that passed a non-empty `location` string keeps it, so its region does not move.
|
|
53
|
+
- A call that passed no `location`, or an empty one, moves to `global`. `getVertexAI` treated an empty value as `us-central1`, and `AgentPlatformBackend` treats it as `global`. The migration drops the empty value rather than writing it through, and warns.
|
|
54
|
+
- A call whose `location` is an expression the migration cannot read gets its own warning, because only your runtime knows whether that value is empty.
|
|
55
|
+
- A call whose options the migration cannot rewrite at all, such as a quoted `{ 'location': ... }` key, is left as written and warned about separately. Its import still moves, so it stops compiling until you migrate it by hand.
|
|
56
|
+
|
|
57
|
+
Each of those warnings is emitted once per file, so a file that has both a moved region and an unreadable `location` produces two.
|
|
58
|
+
|
|
59
|
+
#### If your app uses the Live API, do not stay on `global`
|
|
60
|
+
|
|
61
|
+
Firebase does not support the `global` location for the Live API models, so `getLiveGenerativeModel` and `startAudioConversation` stop working there. When the migration sees either of them anywhere in your workspace it says so in the region warning. Pass `'us-central1'`, or another supported location, to `AgentPlatformBackend`.
|
|
62
|
+
|
|
63
|
+
### What the migration rewrites for you
|
|
64
|
+
|
|
65
|
+
The AngularFire update rewrites these imports and identifiers for you and logs every `getVertexAI` call it rewrites. `getGenerativeModel` keeps its name.
|
|
66
|
+
|
|
67
|
+
Imports straight from the Firebase SDK (`firebase/vertexai`, gone in SDK 12) are rewritten to `firebase/ai` under the same rules. The rewrite parses your sources with the `typescript` package (an optional peer dependency of `@angular/fire`). Every Angular workspace already has it, but if the migration warns that it could not be resolved, install `typescript` and re-run. See [ai.md](./ai.md) for current usage.
|
|
68
|
+
|
|
69
|
+
### What the migration will not rewrite
|
|
70
|
+
|
|
71
|
+
Code the migration cannot rewrite safely is left in place with a warning. The import path itself still moves to the new entry point, so the leftover code fails to compile there. Nothing changes backends silently. It plays safe like this in four situations:
|
|
72
|
+
|
|
73
|
+
- **Options it cannot read:** when the `getVertexAI` call's options are not a literal `{ location }` object, or that literal references other symbols the migration is also rewriting.
|
|
74
|
+
- **The function used as a value:** when `getVertexAI` is stored or passed around rather than called directly.
|
|
75
|
+
- **Name collisions:** when a local declaration in the file reuses an imported symbol's name, or the file already gets `getAI` or `AgentPlatformBackend` from a source other than AI Logic.
|
|
76
|
+
- **Wildcard re-exports:** when a file has `export * from '@angular/fire/vertexai'`, that line stays as written, because rewriting it would silently rename your re-exported public symbols. Replace it with named re-exports by hand.
|
|
77
|
+
|
|
78
|
+
A file where a named `getVertexAI` import is used in a way that cannot be rewritten keeps every use of its named `getVertexAI` imports in place (namespace-style `ns.getVertexAI(...)` calls are judged per call), and each skipped call is logged.
|
|
79
|
+
|
|
80
|
+
### Removed symbols
|
|
81
|
+
|
|
82
|
+
Two symbols were removed rather than renamed. The migration leaves their imports in place, which breaks loudly, and warns with guidance:
|
|
83
|
+
|
|
84
|
+
- `VertexAIOptions`: the new `AIOptions` takes a `backend` instead of a `location`, so rebuild the options by hand using the table above.
|
|
85
|
+
- `getImagenModel`: Firebase shut the Imagen models down in August 2026 and removed the API in firebase 12.18 (`@firebase/ai` 2.15), so move image generation to the Gemini image models through [`getGenerativeModel`](https://firebase.google.com/docs/ai-logic/generate-images-gemini).
|
|
86
|
+
|
|
87
|
+
## Other notes
|
|
88
|
+
|
|
89
|
+
- **Angular 21.2 is required.** AngularFire 21 peers `@angular/* ^21.2.0` and does not support Angular 22 (a future AngularFire 22 will).
|
|
90
|
+
- The obsolete `@angular/platform-browser-dynamic` peer dependency was removed. No action is needed.
|
package/docs/zones.md
CHANGED
|
@@ -18,6 +18,50 @@ When an application is unstable change-detection, two-way binding, and rehydrati
|
|
|
18
18
|
|
|
19
19
|
There are a number of situations where AngularFire's Zone wrapping is inconsequential such adding/deleting/updating a document in response to user-input, signing a user in, calling a Cloud Function, etc. So long as no long-lived side-effects are kicked off, your application should be ok. Most Promise based APIs are fairly safe without zone wrapping.
|
|
20
20
|
|
|
21
|
+
## Keeping calls inside an injection context
|
|
22
|
+
|
|
23
|
+
A common way to trip the warning is calling an AngularFire API from inside an asynchronous callback, for example building a Firestore query inside a `switchMap` on the signed-in user. The surrounding service is created inside an injection context, but the callback runs *later*, after that context is gone, so AngularFire can no longer wrap the call.
|
|
24
|
+
|
|
25
|
+
Capture an `EnvironmentInjector` while the context is still active (any field initializer or constructor), then re-establish it inside the callback with [`runInInjectionContext`](https://angular.dev/api/core/runInInjectionContext):
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
private readonly injector = inject(EnvironmentInjector);
|
|
29
|
+
|
|
30
|
+
readonly todos$ = this.user$.pipe(
|
|
31
|
+
switchMap((user) =>
|
|
32
|
+
runInInjectionContext(this.injector, () =>
|
|
33
|
+
collectionData(collection(this.firestore, `users/${user.uid}/todos`)),
|
|
34
|
+
),
|
|
35
|
+
),
|
|
36
|
+
);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Inside `runInInjectionContext`, AngularFire can wrap the call again, so the SSR/change-detection guarantees are restored and the warning goes away.
|
|
40
|
+
|
|
41
|
+
If a call doesn't depend on the async value, prefer hoisting it out of the callback entirely and running it once where the injection context is still active:
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
// Built once where the context is live, then reused, so no wrapping is needed:
|
|
45
|
+
private readonly items$ = collectionData(collection(this.firestore, "items"));
|
|
46
|
+
|
|
47
|
+
readonly refreshed$ = this.refresh$.pipe(switchMap(() => this.items$));
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Reach for `runInInjectionContext` only when the call genuinely must run inside the callback, as the per-user query above does (it needs the signed-in user's `uid`).
|
|
51
|
+
|
|
52
|
+
### Why the injection context is required
|
|
53
|
+
|
|
54
|
+
AngularFire cannot create an injection context, only borrow the one you are already in.
|
|
55
|
+
|
|
56
|
+
When you call a wrapped API, the first thing AngularFire does is ask Angular for three things with `inject()`: its own scheduler service, Angular's `PendingTasks` register, and an `EnvironmentInjector`. `inject()` only works inside an injection context, so outside of one the first of them throws and the rest are never reached. AngularFire catches that, warns while in dev-mode as described under Logging below, and calls the Firebase API directly with nothing added.
|
|
57
|
+
|
|
58
|
+
That division is worth knowing, because it explains what you are and are not responsible for:
|
|
59
|
+
|
|
60
|
+
* **You** supply the context at the call site, from a field initializer, a constructor, or an explicit `runInInjectionContext`.
|
|
61
|
+
* **AngularFire** re-enters the environment injector inside a callback you hand to the call itself, which is why you never wrap an `onSnapshot` handler yourself. That reaches anything provided at the application level, but not providers declared on a component, and it does not extend to subscribers of a returned Observable, which is what the `switchMap` and `runInInjectionContext` example above is for.
|
|
62
|
+
|
|
63
|
+
What you lose depends on the call. A call that does asynchronous work, such as `onSnapshot`, `getDoc` or `collectionData`, is normally added to Angular's `PendingTasks` register, which is what server-side rendering waits on before it serializes the page. Called outside a context, it never is. A call that returns immediately, such as `getFirestore`, was never registered anyway, so it loses only the zone handling.
|
|
64
|
+
|
|
21
65
|
## Logging
|
|
22
66
|
|
|
23
67
|
You may see a log warning, `Calling Firebase APIs outside of an Injection context may destabilize your application leading to subtle change-detection and hydration bugs. Find more at https://github.com/angular/angularfire/blob/main/docs/zones.md` when developing your application.
|
|
@@ -27,7 +71,7 @@ Instability can be difficult to track down. To help with debugging, AngularFire
|
|
|
27
71
|
There are three logging levels in AngularFire:
|
|
28
72
|
|
|
29
73
|
* **Silent**: when the logging level is set to silent only the above banner is displayed when AngularFire APIs are called outside of an injection context, this is the default when using Zoneless change-detection.
|
|
30
|
-
* **Warn**: when the logging level is set to warn, only blocking reads, long-lived tasks, and APIs with high risk of destabilizing your application are
|
|
74
|
+
* **Warn**: when the logging level is set to warn, only blocking reads, long-lived tasks, and APIs with high risk of destabilizing your application are logged, this is the default when using ZoneJS.
|
|
31
75
|
* **Verbose**: when the logging level is set to verbose, all AngularFire APIs called outside of an injection context are logged—helping you track down APIs that may be destabilizing your application
|
|
32
76
|
|
|
33
77
|
You can change the log-level like so:
|
|
@@ -6,7 +6,7 @@ import { InjectionToken, Optional, NgModule, makeEnvironmentProviders, NgZone, I
|
|
|
6
6
|
import { FirebaseApp, FirebaseApps } from '@angular/fire/app';
|
|
7
7
|
import { AppCheckInstances } from '@angular/fire/app-check';
|
|
8
8
|
import { registerVersion } from 'firebase/app';
|
|
9
|
-
import { getAI as getAI$1, getGenerativeModel as getGenerativeModel$1,
|
|
9
|
+
import { getAI as getAI$1, getGenerativeModel as getGenerativeModel$1, getLiveGenerativeModel as getLiveGenerativeModel$1, startAudioConversation as startAudioConversation$1 } from 'firebase/ai';
|
|
10
10
|
export * from 'firebase/ai';
|
|
11
11
|
|
|
12
12
|
class AI {
|
|
@@ -51,14 +51,14 @@ class AIModule {
|
|
|
51
51
|
constructor() {
|
|
52
52
|
registerVersion('angularfire', VERSION.full, 'ai');
|
|
53
53
|
}
|
|
54
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
55
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
56
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
54
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: AIModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
55
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.22", ngImport: i0, type: AIModule });
|
|
56
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: AIModule, providers: [
|
|
57
57
|
DEFAULT_AI_INSTANCE_PROVIDER,
|
|
58
58
|
AI_INSTANCES_PROVIDER,
|
|
59
59
|
] });
|
|
60
60
|
}
|
|
61
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
61
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: AIModule, decorators: [{
|
|
62
62
|
type: NgModule,
|
|
63
63
|
args: [{
|
|
64
64
|
providers: [
|
|
@@ -91,12 +91,12 @@ function provideAI(fn, ...deps) {
|
|
|
91
91
|
// DO NOT MODIFY, this file is autogenerated by tools/build.ts
|
|
92
92
|
const getAI = _zoneWrap(getAI$1, true);
|
|
93
93
|
const getGenerativeModel = _zoneWrap(getGenerativeModel$1, true);
|
|
94
|
-
const
|
|
95
|
-
const
|
|
94
|
+
const getLiveGenerativeModel = _zoneWrap(getLiveGenerativeModel$1, true);
|
|
95
|
+
const startAudioConversation = _zoneWrap(startAudioConversation$1, true);
|
|
96
96
|
|
|
97
97
|
/**
|
|
98
98
|
* Generated bundle index. Do not edit.
|
|
99
99
|
*/
|
|
100
100
|
|
|
101
|
-
export { AI, AIInstance$, AIInstances, AIModule, getAI, getGenerativeModel,
|
|
101
|
+
export { AI, AIInstance$, AIInstances, AIModule, getAI, getGenerativeModel, getLiveGenerativeModel, provideAI, startAudioConversation };
|
|
102
102
|
//# sourceMappingURL=angular-fire-ai.mjs.map
|