@angular/fire 17.1.0 → 18.0.0-canary.c866d08
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 +10 -0
- package/compat/proxy.d.ts +2 -2
- package/compat/storage/pipes/storageUrl.pipe.d.ts +1 -2
- package/docs/analytics.md +14 -20
- package/docs/app-check.md +12 -9
- package/docs/auth.md +44 -9
- package/docs/database.md +12 -12
- package/docs/firestore.md +15 -23
- package/docs/functions.md +11 -9
- package/docs/messaging.md +30 -8
- package/docs/performance.md +11 -9
- package/docs/remote-config.md +11 -9
- package/docs/storage.md +11 -10
- package/docs/vertexai.md +53 -0
- package/esm2022/analytics/analytics.module.mjs +5 -5
- package/esm2022/analytics/is-analytics-supported-factory.mjs +1 -1
- package/esm2022/analytics/screen-tracking.service.mjs +4 -4
- package/esm2022/analytics/user-tracking.service.mjs +4 -4
- package/esm2022/app/app.module.mjs +5 -5
- package/esm2022/app-check/app-check.module.mjs +5 -5
- package/esm2022/auth/auth.module.mjs +5 -5
- package/esm2022/auth-guard/auth-guard.mjs +4 -4
- package/esm2022/auth-guard/auth-guard.module.mjs +5 -5
- package/esm2022/compat/analytics/analytics.mjs +4 -4
- package/esm2022/compat/analytics/analytics.module.mjs +5 -5
- package/esm2022/compat/analytics/screen-tracking.service.mjs +4 -4
- package/esm2022/compat/analytics/user-tracking.service.mjs +4 -4
- package/esm2022/compat/auth/auth.mjs +4 -4
- package/esm2022/compat/auth/auth.module.mjs +5 -5
- package/esm2022/compat/auth-guard/auth-guard.mjs +4 -4
- package/esm2022/compat/auth-guard/auth-guard.module.mjs +5 -5
- package/esm2022/compat/cache.mjs +1 -1
- package/esm2022/compat/database/database.mjs +4 -4
- package/esm2022/compat/database/database.module.mjs +5 -5
- package/esm2022/compat/database/list/changes.mjs +1 -1
- package/esm2022/compat/database/list/create-reference.mjs +1 -1
- package/esm2022/compat/database/list/remove.mjs +1 -1
- package/esm2022/compat/database/list/utils.mjs +1 -1
- package/esm2022/compat/database/observable/fromRef.mjs +1 -1
- package/esm2022/compat/database/utils.mjs +1 -1
- package/esm2022/compat/firebase.app.module.mjs +5 -5
- package/esm2022/compat/firestore/collection/changes.mjs +1 -1
- package/esm2022/compat/firestore/collection/collection.mjs +1 -1
- package/esm2022/compat/firestore/collection-group/collection-group.mjs +1 -1
- package/esm2022/compat/firestore/firestore.mjs +4 -4
- package/esm2022/compat/firestore/firestore.module.mjs +5 -5
- package/esm2022/compat/firestore/observable/fromRef.mjs +1 -1
- package/esm2022/compat/functions/functions.mjs +4 -4
- package/esm2022/compat/functions/functions.module.mjs +5 -5
- package/esm2022/compat/messaging/messaging.mjs +4 -4
- package/esm2022/compat/messaging/messaging.module.mjs +5 -5
- package/esm2022/compat/performance/performance.mjs +4 -4
- package/esm2022/compat/performance/performance.module.mjs +5 -5
- package/esm2022/compat/performance/performance.service.mjs +4 -4
- package/esm2022/compat/proxy.mjs +1 -1
- package/esm2022/compat/remote-config/remote-config.mjs +4 -4
- package/esm2022/compat/remote-config/remote-config.module.mjs +5 -5
- package/esm2022/compat/storage/pipes/storageUrl.pipe.mjs +10 -12
- package/esm2022/compat/storage/storage.mjs +4 -4
- package/esm2022/compat/storage/storage.module.mjs +5 -5
- package/esm2022/core.mjs +1 -1
- package/esm2022/database/database.module.mjs +5 -5
- package/esm2022/firestore/firestore.module.mjs +5 -5
- package/esm2022/firestore/lite/lite.module.mjs +5 -5
- package/esm2022/functions/functions.module.mjs +5 -5
- package/esm2022/messaging/is-messaging-supported-factory.mjs +1 -1
- package/esm2022/messaging/messaging.module.mjs +5 -5
- package/esm2022/performance/performance.module.mjs +5 -5
- package/esm2022/remote-config/is-remote-config-supported-factory.mjs +1 -1
- package/esm2022/remote-config/remote-config.module.mjs +5 -5
- package/esm2022/storage/storage.module.mjs +5 -5
- package/esm2022/vertexai-preview/vertexai.module.mjs +5 -5
- package/esm2022/zones.mjs +4 -4
- package/fesm2022/angular-fire-analytics.mjs +410 -297
- package/fesm2022/angular-fire-analytics.mjs.map +7 -1
- package/fesm2022/angular-fire-app-check.mjs +162 -91
- package/fesm2022/angular-fire-app-check.mjs.map +7 -1
- package/fesm2022/angular-fire-app.mjs +181 -108
- package/fesm2022/angular-fire-app.mjs.map +7 -1
- package/fesm2022/angular-fire-auth-guard.mjs +83 -73
- package/fesm2022/angular-fire-auth-guard.mjs.map +7 -1
- package/fesm2022/angular-fire-auth.mjs +421 -142
- package/fesm2022/angular-fire-auth.mjs.map +7 -1
- package/fesm2022/angular-fire-compat-analytics.mjs +261 -270
- package/fesm2022/angular-fire-compat-analytics.mjs.map +7 -1
- package/fesm2022/angular-fire-compat-auth-guard.mjs +83 -72
- package/fesm2022/angular-fire-compat-auth-guard.mjs.map +7 -1
- package/fesm2022/angular-fire-compat-auth.mjs +214 -213
- package/fesm2022/angular-fire-compat-auth.mjs.map +7 -1
- package/fesm2022/angular-fire-compat-database.mjs +375 -378
- package/fesm2022/angular-fire-compat-database.mjs.map +7 -1
- package/fesm2022/angular-fire-compat-firestore.mjs +537 -677
- package/fesm2022/angular-fire-compat-firestore.mjs.map +7 -1
- package/fesm2022/angular-fire-compat-functions.mjs +97 -93
- package/fesm2022/angular-fire-compat-functions.mjs.map +7 -1
- package/fesm2022/angular-fire-compat-messaging.mjs +106 -106
- package/fesm2022/angular-fire-compat-messaging.mjs.map +7 -1
- package/fesm2022/angular-fire-compat-performance.mjs +157 -151
- package/fesm2022/angular-fire-compat-performance.mjs.map +7 -1
- package/fesm2022/angular-fire-compat-remote-config.mjs +215 -231
- package/fesm2022/angular-fire-compat-remote-config.mjs.map +7 -1
- package/fesm2022/angular-fire-compat-storage.mjs +226 -233
- package/fesm2022/angular-fire-compat-storage.mjs.map +7 -1
- package/fesm2022/angular-fire-compat.mjs +140 -153
- package/fesm2022/angular-fire-compat.mjs.map +7 -1
- package/fesm2022/angular-fire-database.mjs +376 -136
- package/fesm2022/angular-fire-database.mjs.map +7 -1
- package/fesm2022/angular-fire-firestore-lite.mjs +388 -139
- package/fesm2022/angular-fire-firestore-lite.mjs.map +7 -1
- package/fesm2022/angular-fire-firestore.mjs +526 -167
- package/fesm2022/angular-fire-firestore.mjs.map +7 -1
- package/fesm2022/angular-fire-functions.mjs +166 -93
- package/fesm2022/angular-fire-functions.mjs.map +7 -1
- package/fesm2022/angular-fire-messaging.mjs +196 -118
- package/fesm2022/angular-fire-messaging.mjs.map +7 -1
- package/fesm2022/angular-fire-performance.mjs +178 -104
- package/fesm2022/angular-fire-performance.mjs.map +7 -1
- package/fesm2022/angular-fire-remote-config.mjs +254 -132
- package/fesm2022/angular-fire-remote-config.mjs.map +7 -1
- package/fesm2022/angular-fire-storage.mjs +225 -105
- package/fesm2022/angular-fire-storage.mjs.map +7 -1
- package/fesm2022/angular-fire-vertexai-preview.mjs +146 -85
- package/fesm2022/angular-fire-vertexai-preview.mjs.map +7 -1
- package/fesm2022/angular-fire.mjs +183 -213
- package/fesm2022/angular-fire.mjs.map +7 -1
- package/package.json +7 -7
- package/schematics/deploy/actions.js +2 -2
- package/schematics/setup/prompts.js +1 -1
package/README.md
CHANGED
|
@@ -190,4 +190,14 @@ import { } from '@angular/fire/app-check';
|
|
|
190
190
|
```
|
|
191
191
|
</td>
|
|
192
192
|
</tr>
|
|
193
|
+
<tr>
|
|
194
|
+
<td>
|
|
195
|
+
|
|
196
|
+
#### [Vertex AI](docs/vertexai.md#vertex-ai-preview)
|
|
197
|
+
```ts
|
|
198
|
+
import { } from '@angular/fire/vertexai-preview';
|
|
199
|
+
```
|
|
200
|
+
</td>
|
|
201
|
+
|
|
202
|
+
</tr>
|
|
193
203
|
</table>
|
package/compat/proxy.d.ts
CHANGED
|
@@ -24,8 +24,8 @@ export type ɵPromiseProxy<T> = {
|
|
|
24
24
|
};
|
|
25
25
|
export declare const ɵlazySDKProxy: (klass: any, observable: Observable<any>, zone: NgZone, options?: {
|
|
26
26
|
spy?: {
|
|
27
|
-
get?: (name: string, it: any) => void;
|
|
28
|
-
apply?: (name: string, args: any[], it: any) => void;
|
|
27
|
+
get?: ((name: string, it: any) => void);
|
|
28
|
+
apply?: ((name: string, args: any[], it: any) => void);
|
|
29
29
|
};
|
|
30
30
|
}) => any;
|
|
31
31
|
export declare const ɵapplyMixins: (derivedCtor: any, constructors: any[]) => void;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { ChangeDetectorRef, OnDestroy, PipeTransform } from '@angular/core';
|
|
2
|
-
import { TransferState } from '@angular/platform-browser';
|
|
1
|
+
import { ChangeDetectorRef, OnDestroy, PipeTransform, TransferState } from '@angular/core';
|
|
3
2
|
import { AngularFireStorage } from '../storage';
|
|
4
3
|
import * as i0 from "@angular/core";
|
|
5
4
|
/** to be used with in combination with | async */
|
package/docs/analytics.md
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
Google Analytics is an app measurement solution, available at no charge, that provides insight on app usage and user engagement.
|
|
10
10
|
|
|
11
11
|
[Learn more](https://firebase.google.com/docs/analytics)
|
|
12
|
+
|
|
12
13
|
## Dependency Injection
|
|
13
14
|
|
|
14
15
|
As a prerequisite, ensure that `AngularFire` has been added to your project via
|
|
@@ -16,38 +17,31 @@ As a prerequisite, ensure that `AngularFire` has been added to your project via
|
|
|
16
17
|
ng add @angular/fire
|
|
17
18
|
```
|
|
18
19
|
|
|
19
|
-
Provide a
|
|
20
|
+
Provide a Analytics instance in the application's `app.config.ts`:
|
|
20
21
|
|
|
21
22
|
```ts
|
|
22
|
-
@
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
|
|
24
|
+
import { provideAnalytics, getAnalytics } from '@angular/fire/analytics';
|
|
25
|
+
|
|
26
|
+
export const appConfig: ApplicationConfig = {
|
|
27
|
+
providers: [
|
|
28
|
+
provideFirebaseApp(() => initializeApp({ ... })),
|
|
29
|
+
provideAnalytics(() => getAnalytics()),
|
|
27
30
|
...
|
|
28
|
-
// App initialization
|
|
29
|
-
provideFirebaseApp(() => initializeApp(environment.firebase)),
|
|
30
|
-
provideAnalytics(() => getAnalytics())
|
|
31
31
|
],
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
})
|
|
35
|
-
export class AppModule { }
|
|
32
|
+
...,
|
|
33
|
+
}
|
|
36
34
|
```
|
|
37
35
|
|
|
38
|
-
|
|
36
|
+
Next inject `Analytics` into your component:
|
|
39
37
|
|
|
40
38
|
```typescript
|
|
41
39
|
import { Component, inject } from '@angular/core';
|
|
42
40
|
import { Analytics } from '@angular/fire/analytics';
|
|
43
41
|
|
|
44
|
-
@Component({
|
|
45
|
-
standalone: true,
|
|
46
|
-
selector: 'app-user-profile',
|
|
47
|
-
...
|
|
48
|
-
})
|
|
42
|
+
@Component({ ... })
|
|
49
43
|
export class UserProfileComponent {
|
|
50
|
-
private analytics
|
|
44
|
+
private analytics = inject(Analytics);
|
|
51
45
|
...
|
|
52
46
|
}
|
|
53
47
|
```
|
package/docs/app-check.md
CHANGED
|
@@ -11,28 +11,31 @@ App Check helps protect your API resources from abuse by preventing unauthorized
|
|
|
11
11
|
[Learn More](https://firebase.google.com/docs/app-check)
|
|
12
12
|
|
|
13
13
|
## Dependency Injection
|
|
14
|
+
|
|
14
15
|
As a prerequisite, ensure that `AngularFire` has been added to your project via
|
|
15
16
|
```bash
|
|
16
17
|
ng add @angular/fire
|
|
17
18
|
```
|
|
18
19
|
|
|
19
|
-
Provide
|
|
20
|
+
Provide a App Check instance in the application's `app.config.ts`:
|
|
20
21
|
|
|
21
22
|
```ts
|
|
22
23
|
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
|
|
23
|
-
import { provideAppCheck } from '@angular/fire/app-check';
|
|
24
|
+
import { provideAppCheck, initializeAppCheck, ReCaptchaV3Provider } from '@angular/fire/app-check';
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
provideFirebaseApp(() => initializeApp(
|
|
26
|
+
export const appConfig: ApplicationConfig = {
|
|
27
|
+
providers: [
|
|
28
|
+
provideFirebaseApp(() => initializeApp({ ... })),
|
|
28
29
|
provideAppCheck(() => initializeAppCheck(getApp(), {
|
|
29
30
|
provider: new ReCaptchaV3Provider(/* configuration */),
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
})),
|
|
32
|
+
...
|
|
33
|
+
],
|
|
34
|
+
...
|
|
32
35
|
})
|
|
33
36
|
```
|
|
34
37
|
|
|
35
|
-
Next inject it into your component:
|
|
38
|
+
Next inject `AppCheck` it into your component:
|
|
36
39
|
|
|
37
40
|
```ts
|
|
38
41
|
import { Component, inject} from '@angular/core';
|
|
@@ -40,7 +43,7 @@ import { AppCheck } from '@angular/fire/app-check';
|
|
|
40
43
|
|
|
41
44
|
@Component({ ... })
|
|
42
45
|
export class AppCheckComponent {
|
|
43
|
-
private appCheck
|
|
46
|
+
private appCheck = inject(AppCheck);
|
|
44
47
|
...
|
|
45
48
|
}
|
|
46
49
|
```
|
package/docs/auth.md
CHANGED
|
@@ -20,21 +20,23 @@ As a prerequisite, ensure that `AngularFire` has been added to your project via
|
|
|
20
20
|
ng add @angular/fire
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Provide
|
|
23
|
+
Provide a Auth instance in the application's `app.config.ts`:
|
|
24
24
|
|
|
25
25
|
```ts
|
|
26
26
|
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
|
|
27
|
-
import {
|
|
27
|
+
import { provideAuth, getAuth } from '@angular/fire/auth';
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
provideFirebaseApp(() => initializeApp(
|
|
29
|
+
export const appConfig: ApplicationConfig = {
|
|
30
|
+
providers: [
|
|
31
|
+
provideFirebaseApp(() => initializeApp({ ... })),
|
|
32
32
|
provideAuth(() => getAuth()),
|
|
33
|
-
|
|
33
|
+
...
|
|
34
|
+
],
|
|
35
|
+
...
|
|
34
36
|
})
|
|
35
37
|
```
|
|
36
38
|
|
|
37
|
-
Next inject
|
|
39
|
+
Next inject `Auth` into your component:
|
|
38
40
|
|
|
39
41
|
```ts
|
|
40
42
|
import { Component, inject} from '@angular/core';
|
|
@@ -42,7 +44,7 @@ import { Auth } from '@angular/fire/auth';
|
|
|
42
44
|
|
|
43
45
|
@Component({ ... })
|
|
44
46
|
export class LoginComponent {
|
|
45
|
-
private auth
|
|
47
|
+
private auth = inject(Auth);
|
|
46
48
|
...
|
|
47
49
|
}
|
|
48
50
|
```
|
|
@@ -51,10 +53,43 @@ export class LoginComponent {
|
|
|
51
53
|
|
|
52
54
|
AngularFire wraps the Firebase JS SDK to ensure proper functionality in Angular, while providing the same API.
|
|
53
55
|
|
|
54
|
-
Update the imports from `import { ... } from 'firebase/auth'` to `import { ... } from '@angular/fire/auth'` and follow the
|
|
56
|
+
Update the imports from `import { ... } from 'firebase/auth'` to `import { ... } from '@angular/fire/auth'` and follow the official documentation.
|
|
55
57
|
|
|
56
58
|
[Getting Started](https://firebase.google.com/docs/auth/web/start) | [API Reference](https://firebase.google.com/docs/reference/js/auth)
|
|
57
59
|
|
|
60
|
+
## Server-side Rendering
|
|
61
|
+
|
|
62
|
+
To support Auth context in server-side rendering, you can provide `FirebaseServerApp`:
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
import { ApplicationConfig, PLATFORM_ID, inject } from '@angular/core';
|
|
66
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
67
|
+
import { provideFirebaseApp, initializeApp, initializeServeApp, initializeServerApp } from '@angular/fire/app';
|
|
68
|
+
import { provideAuth, getAuth } from '@angular/fire/auth';
|
|
69
|
+
|
|
70
|
+
export const appConfig: ApplicationConfig = {
|
|
71
|
+
providers: [
|
|
72
|
+
provideFirebaseApp(() => {
|
|
73
|
+
if (isPlatformBrowser(inject(PLATFORM_ID))) {
|
|
74
|
+
return initializeApp(firebaseConfig);
|
|
75
|
+
}
|
|
76
|
+
// Optional, since it's null in dev-mode and SSG
|
|
77
|
+
const request = inject(REQUEST, { optional: true });
|
|
78
|
+
const authIdToken = request?.headers.authorization?.split("Bearer ")[1];
|
|
79
|
+
return initializeServerApp(firebaseConfig, {
|
|
80
|
+
authIdToken,
|
|
81
|
+
releaseOnDeref: request || undefined
|
|
82
|
+
});
|
|
83
|
+
}),
|
|
84
|
+
provideAuth(() => getAuth(inject(FirebaseApp)),
|
|
85
|
+
...
|
|
86
|
+
],
|
|
87
|
+
...
|
|
88
|
+
})
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Follow Firebase's [ Session Management with Service Workers documentation](https://firebase.google.com/docs/auth/web/service-worker-sessions) to learn how to pass the `idToken` to the server. __Note: this will not currently work in dev-mode as Angular SSR does not provide a method to get the Request headers.__
|
|
92
|
+
|
|
58
93
|
## Convenience observables
|
|
59
94
|
|
|
60
95
|
AngularFire provides observables to allow convenient use of the Firebase Authentication with RXJS.
|
package/docs/database.md
CHANGED
|
@@ -17,32 +17,32 @@ As a prerequisite, ensure that `AngularFire` has been added to your project via
|
|
|
17
17
|
ng add @angular/fire
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
Provide
|
|
20
|
+
Provide a Database instance in the application's `app.config.ts`:
|
|
21
21
|
|
|
22
22
|
```ts
|
|
23
23
|
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
|
|
24
|
-
import {
|
|
24
|
+
import { provideDatabase, getDatabase } from '@angular/fire/database';
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
provideFirebaseApp(() => initializeApp(
|
|
26
|
+
export const appConfig: ApplicationConfig = {
|
|
27
|
+
providers: [
|
|
28
|
+
provideFirebaseApp(() => initializeApp({ ... })),
|
|
29
29
|
provideDatabase(() => getDatabase()),
|
|
30
|
-
|
|
30
|
+
...
|
|
31
|
+
],
|
|
32
|
+
...
|
|
31
33
|
})
|
|
32
34
|
```
|
|
33
35
|
|
|
34
|
-
Next inject
|
|
36
|
+
Next inject `Database` into your component:
|
|
35
37
|
|
|
36
38
|
```ts
|
|
37
39
|
import { Component, inject } from '@angular/core';
|
|
38
40
|
import { Database } from '@angular/fire/database';
|
|
39
41
|
|
|
40
42
|
@Component({...})
|
|
41
|
-
|
|
42
|
-
private database
|
|
43
|
-
|
|
44
|
-
constructor() {
|
|
45
|
-
}
|
|
43
|
+
export class DepartmentComponent {
|
|
44
|
+
private database = inject(Database);
|
|
45
|
+
...
|
|
46
46
|
}
|
|
47
47
|
```
|
|
48
48
|
|
package/docs/firestore.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<img align="right" width="30%" src="images/firestore-illo_1x.png">
|
|
2
2
|
|
|
3
3
|
<small>
|
|
4
|
-
<a href="https://github.com/angular/angularfire">AngularFire</a> ❱ <a href="../README.md#developer-guide">Developer Guide</a> ❱
|
|
4
|
+
<a href="https://github.com/angular/angularfire">AngularFire</a> ❱ <a href="../README.md#developer-guide">Developer Guide</a> ❱ Cloud Firestore
|
|
5
5
|
</small>
|
|
6
6
|
|
|
7
7
|
# Cloud Firestore
|
|
@@ -18,39 +18,31 @@ As a prerequisite, ensure that `AngularFire` has been added to your project via
|
|
|
18
18
|
```bash
|
|
19
19
|
ng add @angular/fire
|
|
20
20
|
```
|
|
21
|
-
Provide a Firestore instance in the application's `
|
|
21
|
+
Provide a Firestore instance in the application's `app.config.ts`:
|
|
22
22
|
|
|
23
|
-
```
|
|
24
|
-
@
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
```ts
|
|
24
|
+
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
|
|
25
|
+
import { provideFirestore, getFirestore } from '@angular/fire/firestore';
|
|
26
|
+
|
|
27
|
+
export const appConfig: ApplicationConfig = {
|
|
28
|
+
providers: [
|
|
29
|
+
provideFirebaseApp(() => initializeApp({ ... })),
|
|
30
|
+
provideFirestore(() => getFirestore()),
|
|
29
31
|
...
|
|
30
|
-
// App initialization
|
|
31
|
-
provideFirebaseApp(() => initializeApp(environment.firebase)),
|
|
32
|
-
provideFirestore(() => getFirestore())
|
|
33
32
|
],
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
})
|
|
37
|
-
export class AppModule { }
|
|
33
|
+
...
|
|
34
|
+
}
|
|
38
35
|
```
|
|
39
36
|
|
|
40
|
-
|
|
41
|
-
In your component class, for example `user-profile.component.ts` import and inject `Firestore`:
|
|
37
|
+
Next inject `Firestore` into your component:
|
|
42
38
|
|
|
43
39
|
```typescript
|
|
44
40
|
import { Component, inject } from '@angular/core';
|
|
45
41
|
import { Firestore } from '@angular/fire/firestore';
|
|
46
42
|
|
|
47
|
-
@Component({
|
|
48
|
-
standalone: true,
|
|
49
|
-
selector: 'app-user-profile',
|
|
50
|
-
...
|
|
51
|
-
})
|
|
43
|
+
@Component({ ... })
|
|
52
44
|
export class UserProfileComponent {
|
|
53
|
-
private firestore
|
|
45
|
+
private firestore = inject(Firestore);
|
|
54
46
|
...
|
|
55
47
|
}
|
|
56
48
|
```
|
package/docs/functions.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<img align="right" width="30%" src="images/functions-illo_1x.png">
|
|
2
2
|
|
|
3
3
|
<small>
|
|
4
|
-
<a href="https://github.com/angular/angularfire">AngularFire</a> ❱ <a href="../README.md#developer-guide">Developer Guide</a> ❱
|
|
4
|
+
<a href="https://github.com/angular/angularfire">AngularFire</a> ❱ <a href="../README.md#developer-guide">Developer Guide</a> ❱ Cloud Functions
|
|
5
5
|
</small>
|
|
6
6
|
|
|
7
7
|
# Cloud Functions
|
|
@@ -17,21 +17,23 @@ As a prerequisite, ensure that `AngularFire` has been added to your project via
|
|
|
17
17
|
ng add @angular/fire
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
Provide a Cloud Functions instance in the application's `
|
|
20
|
+
Provide a Cloud Functions instance in the application's `app.config.ts`:
|
|
21
21
|
|
|
22
22
|
```ts
|
|
23
23
|
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
|
|
24
|
-
import {
|
|
24
|
+
import { provideFunctions, getFunctions } from '@angular/fire/functions';
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
provideFirebaseApp(() => initializeApp(
|
|
26
|
+
export const appConfig: ApplicationConfig = {
|
|
27
|
+
providers: [
|
|
28
|
+
provideFirebaseApp(() => initializeApp({ ... })),
|
|
29
29
|
provideFunctions(() => getFunctions()),
|
|
30
|
-
|
|
30
|
+
...
|
|
31
|
+
],
|
|
32
|
+
...
|
|
31
33
|
})
|
|
32
34
|
```
|
|
33
35
|
|
|
34
|
-
Next inject
|
|
36
|
+
Next inject `Functions` into your component:
|
|
35
37
|
|
|
36
38
|
```ts
|
|
37
39
|
import { Component, inject} from '@angular/core';
|
|
@@ -39,7 +41,7 @@ import { Functions } from '@angular/fire/functions';
|
|
|
39
41
|
|
|
40
42
|
@Component({ ... })
|
|
41
43
|
export class AppComponent {
|
|
42
|
-
private functions
|
|
44
|
+
private functions = inject(Functions);
|
|
43
45
|
...
|
|
44
46
|
}
|
|
45
47
|
```
|
package/docs/messaging.md
CHANGED
|
@@ -1,25 +1,47 @@
|
|
|
1
1
|
<img align="right" width="30%" src="images/cloud-messaging-illo_1x.png">
|
|
2
2
|
|
|
3
3
|
<small>
|
|
4
|
-
<a href="https://github.com/angular/angularfire">AngularFire</a> ❱ <a href="../README.md#developer-guide">Developer Guide</a> ❱
|
|
4
|
+
<a href="https://github.com/angular/angularfire">AngularFire</a> ❱ <a href="../README.md#developer-guide">Developer Guide</a> ❱ Cloud Messaging
|
|
5
5
|
</small>
|
|
6
6
|
|
|
7
7
|
# Cloud Messaging
|
|
8
8
|
|
|
9
9
|
Firebase FCM allows you to register devices with unique FCM tokens, that you can later programtically 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 via
|
|
14
|
+
```bash
|
|
15
|
+
ng add @angular/fire
|
|
13
16
|
```
|
|
14
|
-
import { getMessaging, provideMessaging } from "@angular/fire/messaging";
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
Provide a Cloud Messaging instance in the application's `app.config.ts`:
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
|
|
22
|
+
import { provideMessaging, getMessaging } from '@angular/fire/messaging';
|
|
23
|
+
|
|
24
|
+
export const appConfig: ApplicationConfig = {
|
|
17
25
|
providers: [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
provideFirebaseApp(() => initializeApp({ ... })),
|
|
27
|
+
provideMessaging(() => getMessaging()),
|
|
28
|
+
...
|
|
21
29
|
],
|
|
22
|
-
|
|
30
|
+
...
|
|
31
|
+
})
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Next inject `Messaging` into your component:
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
import { Component, inject} from '@angular/core';
|
|
38
|
+
import { Messaging } from '@angular/fire/messaging';
|
|
39
|
+
|
|
40
|
+
@Component({ ... })
|
|
41
|
+
export class AppComponent {
|
|
42
|
+
private messaging = inject(Messaging);
|
|
43
|
+
...
|
|
44
|
+
}
|
|
23
45
|
```
|
|
24
46
|
|
|
25
47
|
# Create a Firebase Messaging Service Worker
|
package/docs/performance.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<img align="right" width="30%" src="images/performance-illo_1x.png">
|
|
2
2
|
|
|
3
3
|
<small>
|
|
4
|
-
<a href="https://github.com/angular/angularfire">AngularFire</a> ❱ <a href="../README.md#developer-guide">Developer Guide</a> ❱
|
|
4
|
+
<a href="https://github.com/angular/angularfire">AngularFire</a> ❱ <a href="../README.md#developer-guide">Developer Guide</a> ❱ Performance Monitoring
|
|
5
5
|
</small>
|
|
6
6
|
|
|
7
7
|
# Performance Monitoring
|
|
@@ -17,21 +17,23 @@ As a prerequisite, ensure that `AngularFire` has been added to your project via
|
|
|
17
17
|
ng add @angular/fire
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
Provide a Performance instance
|
|
20
|
+
Provide a Performance instance in the application's `app.config.ts`:
|
|
21
21
|
|
|
22
22
|
```ts
|
|
23
23
|
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
|
|
24
|
-
import {
|
|
24
|
+
import { providePerformance, getPerformance } from '@angular/fire/performance';
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
provideFirebaseApp(() => initializeApp(
|
|
26
|
+
export const appConfig: ApplicationConfig = {
|
|
27
|
+
providers: [
|
|
28
|
+
provideFirebaseApp(() => initializeApp({ ... })),
|
|
29
29
|
providePerformance(() => getPerformance()),
|
|
30
|
-
|
|
30
|
+
...
|
|
31
|
+
],
|
|
32
|
+
...
|
|
31
33
|
})
|
|
32
34
|
```
|
|
33
35
|
|
|
34
|
-
Next inject
|
|
36
|
+
Next inject `Performance` into your component:
|
|
35
37
|
|
|
36
38
|
```ts
|
|
37
39
|
import { Component, inject} from '@angular/core';
|
|
@@ -39,7 +41,7 @@ import { Performance } from '@angular/fire/performance';
|
|
|
39
41
|
|
|
40
42
|
@Component({ ... })
|
|
41
43
|
export class PerformanceComponent {
|
|
42
|
-
private performance
|
|
44
|
+
private performance = inject(Performance);
|
|
43
45
|
...
|
|
44
46
|
}
|
|
45
47
|
```
|
package/docs/remote-config.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<img align="right" width="30%" src="images/remote-config-illo_1x.png">
|
|
2
2
|
|
|
3
3
|
<small>
|
|
4
|
-
<a href="https://github.com/angular/angularfire">AngularFire</a> ❱ <a href="../README.md#developer-guide">Developer Guide</a> ❱
|
|
4
|
+
<a href="https://github.com/angular/angularfire">AngularFire</a> ❱ <a href="../README.md#developer-guide">Developer Guide</a> ❱ Remote Config
|
|
5
5
|
</small>
|
|
6
6
|
|
|
7
7
|
# Remote Config
|
|
@@ -17,21 +17,23 @@ As a prerequisite, ensure that `AngularFire` has been added to your project via
|
|
|
17
17
|
ng add @angular/fire
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
Provide a
|
|
20
|
+
Provide a Remote Config instance in the application's `app.config.ts`:
|
|
21
21
|
|
|
22
22
|
```ts
|
|
23
23
|
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
|
|
24
|
-
import {
|
|
24
|
+
import { provideRemoteConfig, getRemoteConfig } from '@angular/fire/remote-config';
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
provideFirebaseApp(() => initializeApp(
|
|
26
|
+
export const appConfig: ApplicationConfig = {
|
|
27
|
+
providers: [
|
|
28
|
+
provideFirebaseApp(() => initializeApp({ ... })),
|
|
29
29
|
provideRemoteConfig(() => getRemoteConfig()),
|
|
30
|
-
|
|
30
|
+
...
|
|
31
|
+
],
|
|
32
|
+
...
|
|
31
33
|
})
|
|
32
34
|
```
|
|
33
35
|
|
|
34
|
-
Next inject
|
|
36
|
+
Next inject `RemoteConfig` into your component:
|
|
35
37
|
|
|
36
38
|
```ts
|
|
37
39
|
import { Component, inject} from '@angular/core';
|
|
@@ -39,7 +41,7 @@ import { RemoteConfig } from '@angular/fire/remote-config';
|
|
|
39
41
|
|
|
40
42
|
@Component({ ... })
|
|
41
43
|
export class RemoteConfigComponent {
|
|
42
|
-
private remoteConfig
|
|
44
|
+
private remoteConfig = inject(RemoteConfig);
|
|
43
45
|
...
|
|
44
46
|
}
|
|
45
47
|
```
|
package/docs/storage.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<img align="right" width="30%" src="images/storage-illo_1x.png">
|
|
2
2
|
|
|
3
3
|
<small>
|
|
4
|
-
<a href="https://github.com/angular/angularfire">AngularFire</a> ❱ <a href="../README.md#developer-guide">Developer Guide</a> ❱
|
|
4
|
+
<a href="https://github.com/angular/angularfire">AngularFire</a> ❱ <a href="../README.md#developer-guide">Developer Guide</a> ❱ Cloud Storage
|
|
5
5
|
</small>
|
|
6
6
|
|
|
7
7
|
# Cloud Storage
|
|
@@ -19,21 +19,23 @@ As a prerequisite, ensure that `AngularFire` has been added to your project via
|
|
|
19
19
|
ng add @angular/fire
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
Provide a
|
|
22
|
+
Provide a Cloud Storage instance in the application's `app.config.ts`:
|
|
23
23
|
|
|
24
24
|
```ts
|
|
25
25
|
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
|
|
26
|
-
import {
|
|
26
|
+
import { provideStorage, getStorage } from '@angular/fire/storage';
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
provideFirebaseApp(() => initializeApp(
|
|
28
|
+
export const appConfig: ApplicationConfig = {
|
|
29
|
+
providers: [
|
|
30
|
+
provideFirebaseApp(() => initializeApp({ ... })),
|
|
31
31
|
provideStorage(() => getStorage()),
|
|
32
|
-
|
|
32
|
+
...
|
|
33
|
+
],
|
|
34
|
+
...
|
|
33
35
|
})
|
|
34
36
|
```
|
|
35
37
|
|
|
36
|
-
Next inject
|
|
38
|
+
Next inject `Storage` into your component:
|
|
37
39
|
|
|
38
40
|
```ts
|
|
39
41
|
import { Component, inject} from '@angular/core';
|
|
@@ -41,12 +43,11 @@ import { Storage } from '@angular/fire/storage';
|
|
|
41
43
|
|
|
42
44
|
@Component({ ... })
|
|
43
45
|
export class StorageComponent {
|
|
44
|
-
private storage
|
|
46
|
+
private storage = inject(Storage);
|
|
45
47
|
...
|
|
46
48
|
}
|
|
47
49
|
```
|
|
48
50
|
|
|
49
|
-
|
|
50
51
|
## Firebase API
|
|
51
52
|
|
|
52
53
|
AngularFire wraps the Firebase JS SDK to ensure proper functionality in Angular, while providing the same API.
|
package/docs/vertexai.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<small>
|
|
2
|
+
<a href="https://github.com/angular/angularfire">AngularFire</a> ❱ <a href="../README.md#developer-guide">Developer Guide</a> ❱ Vertex AI
|
|
3
|
+
</small>
|
|
4
|
+
|
|
5
|
+
# Vertex AI (preview)
|
|
6
|
+
|
|
7
|
+
The Vertex AI Gemini API gives you access to the latest generative AI models from Google: the Gemini models.
|
|
8
|
+
|
|
9
|
+
[Learn more](https://firebase.google.com/docs/vertex-ai)
|
|
10
|
+
|
|
11
|
+
## Dependency Injection
|
|
12
|
+
|
|
13
|
+
As a prerequisite, ensure that `AngularFire` has been added to your project via
|
|
14
|
+
```bash
|
|
15
|
+
ng add @angular/fire
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Provide a Vertex AI instance in the application's `app.config.ts`:
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
|
|
22
|
+
import { provideVertexAI, getVertexAI } from '@angular/fire/vertexai-preview';
|
|
23
|
+
|
|
24
|
+
export const appConfig: ApplicationConfig = {
|
|
25
|
+
providers: [
|
|
26
|
+
provideFirebaseApp(() => initializeApp({ ... })),
|
|
27
|
+
provideVertexAI(() => getVertexAI()),
|
|
28
|
+
...
|
|
29
|
+
],
|
|
30
|
+
...,
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Next inject `VertexAI` into your component:
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import { Component, inject } from '@angular/core';
|
|
38
|
+
import { VertexAI } from '@angular/fire/vertexai-preview';
|
|
39
|
+
|
|
40
|
+
@Component({ ... })
|
|
41
|
+
export class MyComponent {
|
|
42
|
+
private vertexAI = inject(VertexAI);
|
|
43
|
+
...
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Firebase API
|
|
48
|
+
|
|
49
|
+
AngularFire wraps the Firebase JS SDK to ensure proper functionality in Angular, while providing the same API.
|
|
50
|
+
|
|
51
|
+
Update the imports from `import { ... } from 'firebase/vertexai-preview'` to `import { ... } from '@angular/fire/vertexai-preview'` and follow the official documentation.
|
|
52
|
+
|
|
53
|
+
[Getting Started](https://firebase.google.com/docs/vertex-ai/get-started?platform=web) | [API Reference](https://firebase.google.com/docs/reference/js/vertexai-preview)
|