@angular/fire 7.5.0 → 7.6.0-canary.60943d6
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 +93 -72
- package/bundles/angular-fire.umd.js +1 -1
- package/bundles/angular-fire.umd.js.map +1 -1
- package/compat/firestore/interfaces.d.ts +4 -4
- package/docs/analytics.md +67 -0
- package/docs/app-check.md +53 -0
- package/docs/auth.md +165 -0
- package/docs/{analytics → compat/analytics}/getting-started.md +2 -0
- package/docs/{auth → compat/auth}/getting-started.md +2 -0
- package/docs/{auth → compat/auth}/router-guards.md +2 -0
- package/docs/{emulators → compat/emulators}/emulators.md +2 -0
- package/docs/{firestore → compat/firestore}/collections.md +2 -0
- package/docs/{firestore → compat/firestore}/documents.md +2 -0
- package/docs/{firestore → compat/firestore}/offline-data.md +2 -0
- package/docs/{firestore → compat/firestore}/querying-collections.md +2 -0
- package/docs/{functions → compat/functions}/functions.md +2 -0
- package/docs/{messaging → compat/messaging}/messaging.md +2 -0
- package/docs/{performance → compat/performance}/getting-started.md +2 -0
- package/docs/{remote-config → compat/remote-config}/getting-started.md +2 -0
- package/docs/{rtdb → compat/rtdb}/lists.md +2 -0
- package/docs/{rtdb → compat/rtdb}/objects.md +2 -0
- package/docs/{rtdb → compat/rtdb}/querying-lists.md +2 -0
- package/docs/{storage → compat/storage}/storage.md +2 -0
- package/docs/compat.md +70 -0
- package/docs/database.md +175 -0
- package/docs/firestore.md +148 -0
- package/docs/functions.md +52 -0
- package/docs/images/analytics-illo_1x.png +0 -0
- package/docs/images/auth-illo_1x.png +0 -0
- package/docs/images/cloud-messaging-illo_1x.png +0 -0
- package/docs/images/database-illo_1x.png +0 -0
- package/docs/images/firestore-illo_1x.png +0 -0
- package/docs/images/functions-illo_1x.png +0 -0
- package/docs/images/hosting-illo_1x.png +0 -0
- package/docs/images/performance-illo_1x.png +0 -0
- package/docs/images/reCAPTCHA-logo@1x.png +0 -0
- package/docs/images/remote-config-illo_1x.png +0 -0
- package/docs/images/storage-illo_1x.png +0 -0
- package/docs/install-and-setup.md +39 -86
- package/docs/install-firebase-tools.md +78 -0
- package/docs/messaging.md +25 -0
- package/docs/performance.md +57 -0
- package/docs/remote-config.md +53 -0
- package/docs/storage.md +90 -0
- package/docs/universal/cloud-functions.md +27 -6
- package/docs/universal/getting-started.md +9 -134
- package/esm2015/compat/firestore/interfaces.js +1 -1
- package/esm2015/core.js +1 -1
- package/fesm2015/angular-fire.js +1 -1
- package/fesm2015/angular-fire.js.map +1 -1
- package/package.json +9 -10
- package/schematics/deploy/actions.js +8 -3
- package/schematics/deploy/builder.js +2 -2
- package/schematics/firebaseTools.js +4 -2
- package/schematics/setup/index.js +58 -29
- package/schematics/setup/prompts.js +18 -46
- package/schematics/utils.js +32 -28
- package/docs/ionic/authentication.md +0 -104
- package/docs/ionic/cli.md +0 -218
- package/docs/ionic/v2.md +0 -531
- package/docs/ionic/v3.md +0 -705
- package/schematics/setup/ssr.js +0 -100
- package/schematics/setup/static.js +0 -78
package/README.md
CHANGED
|
@@ -3,7 +3,13 @@ The official [Angular](https://angular.io/) library for [Firebase](https://fireb
|
|
|
3
3
|
|
|
4
4
|
<strong><pre>ng add @angular/fire</pre></strong>
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
_Note: If you want to ng add AngularFire and will be using Hosting/Cloud Functions, you need to configure the
|
|
7
|
+
Firebase CLI first so that you are logged in for the schematics that are run as part of `ng add @angular/fire`.
|
|
8
|
+
Follow [this guide](docs/install-firebase-tools.md) to have the Firebase CLI walk you through the setup._
|
|
9
|
+
|
|
10
|
+
AngularFire smooths over the rough edges an Angular developer might encounter when implementing the framework-agnostic
|
|
11
|
+
[Firebase JS SDK](https://github.com/firebase/firebase-js-sdk) & aims to provide a more natural developer experience
|
|
12
|
+
by conforming to Angular conventions.
|
|
7
13
|
|
|
8
14
|
- **Dependency injection** - Provide and Inject Firebase services in your components
|
|
9
15
|
- **Zone.js wrappers** - Stable zones allow proper functionality of service workers, forms, SSR, and pre-rendering
|
|
@@ -31,6 +37,7 @@ export class AppModule { }
|
|
|
31
37
|
```
|
|
32
38
|
|
|
33
39
|
```ts
|
|
40
|
+
import { inject } from '@angular/core';
|
|
34
41
|
import { Firestore, collectionData, collection } from '@angular/fire/firestore';
|
|
35
42
|
import { Observable } from 'rxjs';
|
|
36
43
|
|
|
@@ -51,9 +58,11 @@ interface Item {
|
|
|
51
58
|
})
|
|
52
59
|
export class AppComponent {
|
|
53
60
|
item$: Observable<Item[]>;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
61
|
+
firestore: Firestore = inject(Firestore);
|
|
62
|
+
|
|
63
|
+
constructor() {
|
|
64
|
+
const itemCollection = collection(this.firestore, 'items');
|
|
65
|
+
this.item$ = collectionData(itemCollection);
|
|
57
66
|
}
|
|
58
67
|
}
|
|
59
68
|
```
|
|
@@ -66,6 +75,7 @@ AngularFire doesn't follow Angular's versioning as Firebase also has breaking ch
|
|
|
66
75
|
|
|
67
76
|
| Angular | Firebase | AngularFire |
|
|
68
77
|
| --------|----------|--------------|
|
|
78
|
+
| 16 | 9 | ^7.6 |
|
|
69
79
|
| 15 | 9 | ^7.5 |
|
|
70
80
|
| 14 | 9 | ^7.4 |
|
|
71
81
|
| 13 | 9 | ^7.2 |
|
|
@@ -116,86 +126,97 @@ Get help on our [Q&A board](https://github.com/angular/angularfire/discussions?d
|
|
|
116
126
|
|
|
117
127
|
## Developer Guide
|
|
118
128
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
This developer guide assumes you're using the Compatiability API (`@angular/fire/compat/*`).
|
|
122
|
-
|
|
123
|
-
### Monitor usage of your application in production
|
|
124
|
-
|
|
125
|
-
> `AngularFireAnalytics` provides a convenient method of interacting with Google Analytics in your Angular application. The provided `ScreenTrackingService` and `UserTrackingService` automatically log events when you're using the Angular Router or Firebase Authentication respectively. [Learn more about Google Analytics](https://firebase.google.com/docs/analytics).
|
|
126
|
-
|
|
127
|
-
- [Getting started with Google Analytics](docs/analytics/getting-started.md)
|
|
128
|
-
|
|
129
|
-
### Interacting with your database(s)
|
|
130
|
-
|
|
131
|
-
Firebase offers two cloud-based, client-accessible database solutions that support realtime data syncing. [Learn about the differences between them in the Firebase Documentation](https://firebase.google.com/docs/firestore/rtdb-vs-firestore).
|
|
132
|
-
|
|
133
|
-
#### Cloud Firestore
|
|
134
|
-
|
|
135
|
-
> `AngularFirestore` allows you to work with Cloud Firestore, the new flagship database for mobile app development. It improves on the successes of Realtime Database with a new, more intuitive data model. Cloud Firestore also features richer, faster queries and scales better than Realtime Database.
|
|
136
|
-
|
|
137
|
-
- [Documents](docs/firestore/documents.md)
|
|
138
|
-
- [Collections](docs/firestore/collections.md)
|
|
139
|
-
- [Querying Collections](docs/firestore/querying-collections.md)
|
|
140
|
-
- [Offline data](docs/firestore/offline-data.md)
|
|
141
|
-
|
|
142
|
-
#### Realtime Database
|
|
143
|
-
|
|
144
|
-
> `AngularFireDatabase` allows you to work with the Realtime Database, Firebase's original database. It's an efficient, low-latency solution for mobile apps that require synced states across clients in realtime.
|
|
145
|
-
|
|
146
|
-
- [Objects](docs/rtdb/objects.md)
|
|
147
|
-
- [Lists](docs/rtdb/lists.md)
|
|
148
|
-
- [Querying lists](docs/rtdb/querying-lists.md)
|
|
149
|
-
|
|
150
|
-
### Authenticate users
|
|
151
|
-
|
|
152
|
-
- [Getting started with Firebase Authentication](docs/auth/getting-started.md)
|
|
153
|
-
- [Route users with AngularFire guards](docs/auth/router-guards.md)
|
|
154
|
-
|
|
155
|
-
### Local Emulator Suite
|
|
156
|
-
|
|
157
|
-
- [Getting started with Firebase Emulator Suite](docs/emulators/emulators.md)
|
|
158
|
-
|
|
159
|
-
### Upload files
|
|
160
|
-
|
|
161
|
-
- [Getting started with Cloud Storage](docs/storage/storage.md)
|
|
162
|
-
|
|
163
|
-
### Receive push notifications
|
|
164
|
-
|
|
165
|
-
- [Getting started with Firebase Messaging](docs/messaging/messaging.md)
|
|
129
|
+
This developer guide assimes you're using the new tree-shakable AngularFire API, [if you're looking for the compatability API you can find the documentation here](docs/compat.md).
|
|
166
130
|
|
|
167
|
-
|
|
131
|
+
[See the v7 upgrade guide for more information on this change.](docs/version-7-upgrade.md).
|
|
168
132
|
|
|
169
|
-
|
|
133
|
+
### Firebase product integrations
|
|
170
134
|
|
|
171
|
-
|
|
135
|
+
<table>
|
|
136
|
+
<tr>
|
|
137
|
+
<td>
|
|
172
138
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
139
|
+
#### [Analytics](docs/analytics.md#analytics)
|
|
140
|
+
```ts
|
|
141
|
+
import { } from '@angular/fire/analytics';
|
|
142
|
+
```
|
|
143
|
+
</td>
|
|
144
|
+
<td>
|
|
176
145
|
|
|
177
|
-
|
|
146
|
+
#### [Authentication](docs/auth.md#authentication)
|
|
147
|
+
```ts
|
|
148
|
+
import { } from '@angular/fire/auth';
|
|
149
|
+
```
|
|
150
|
+
</td>
|
|
151
|
+
</tr>
|
|
152
|
+
<tr>
|
|
153
|
+
<td>
|
|
178
154
|
|
|
179
|
-
|
|
155
|
+
#### [Cloud Firestore](docs/firestore.md#cloud-firestore)
|
|
156
|
+
```ts
|
|
157
|
+
import { } from '@angular/fire/firestore';
|
|
158
|
+
```
|
|
159
|
+
</td>
|
|
160
|
+
<td>
|
|
180
161
|
|
|
181
|
-
|
|
162
|
+
#### [Cloud Functions](docs/functions.md#cloud-functions)
|
|
163
|
+
```ts
|
|
164
|
+
import { } from '@angular/fire/functions';
|
|
165
|
+
```
|
|
166
|
+
</td>
|
|
167
|
+
</tr>
|
|
168
|
+
<tr>
|
|
169
|
+
<td>
|
|
182
170
|
|
|
183
|
-
|
|
171
|
+
#### [Cloud Messaging](docs/messaging.md#cloud-messaging)
|
|
172
|
+
```ts
|
|
173
|
+
import { } from '@angular/fire/messaging';
|
|
174
|
+
```
|
|
175
|
+
</td>
|
|
176
|
+
<td>
|
|
184
177
|
|
|
185
|
-
|
|
178
|
+
#### [Cloud Storage](docs/storage.md#cloud-storage)
|
|
179
|
+
```ts
|
|
180
|
+
import { } from '@angular/fire/storage';
|
|
181
|
+
```
|
|
182
|
+
</td>
|
|
183
|
+
</tr>
|
|
184
|
+
<tr>
|
|
185
|
+
<td>
|
|
186
186
|
|
|
187
|
-
|
|
187
|
+
#### [Performance Monitoring](docs/performance.md#performance-monitoring)
|
|
188
|
+
```ts
|
|
189
|
+
import { } from '@angular/fire/performance';
|
|
190
|
+
```
|
|
191
|
+
</td>
|
|
192
|
+
<td>
|
|
188
193
|
|
|
189
|
-
####
|
|
194
|
+
#### [Realtime Database](docs/database.md#realtime-database)
|
|
195
|
+
```ts
|
|
196
|
+
import { } from '@angular/fire/database';
|
|
197
|
+
```
|
|
198
|
+
</td>
|
|
199
|
+
</tr>
|
|
200
|
+
<tr>
|
|
201
|
+
<td>
|
|
190
202
|
|
|
191
|
-
|
|
203
|
+
#### [Remote Config](docs/remote-config.md#remote-config)
|
|
204
|
+
```ts
|
|
205
|
+
import { } from '@angular/fire/remote-config';
|
|
206
|
+
```
|
|
207
|
+
</td>
|
|
208
|
+
<td>
|
|
192
209
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
210
|
+
#### [App Check](docs/app-check.md#app-check)
|
|
211
|
+
```ts
|
|
212
|
+
import { } from '@angular/fire/app-check';
|
|
213
|
+
```
|
|
214
|
+
</td>
|
|
215
|
+
</tr>
|
|
216
|
+
</table>
|
|
196
217
|
|
|
197
|
-
###
|
|
218
|
+
### Deploying your site
|
|
198
219
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
220
|
+
* Deploy to Firebase Hosting
|
|
221
|
+
* Angular Universal: Deploy to Cloud Functions
|
|
222
|
+
* Angular Universal: Deploy to Cloud Run
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
28
28
|
|
|
29
|
-
var VERSION = new i0.Version('7.
|
|
29
|
+
var VERSION = new i0.Version('7.6.0-canary.60943d6');
|
|
30
30
|
var isAnalyticsSupportedValueSymbol = '__angularfire_symbol__analyticsIsSupportedValue';
|
|
31
31
|
var isAnalyticsSupportedPromiseSymbol = '__angularfire_symbol__analyticsIsSupported';
|
|
32
32
|
var isRemoteConfigSupportedValueSymbol = '__angularfire_symbol__remoteConfigIsSupportedValue';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"angular-fire.umd.js","sources":["../../../src/core.ts","../../../src/zones.ts","../../../src/angular-fire.ts"],"sourcesContent":["import { Version } from '@angular/core';\nimport { FirebaseApp, getApps } from 'firebase/app';\nimport { ComponentContainer } from '@firebase/component';\nimport { isSupported as isRemoteConfigSupported } from 'firebase/remote-config';\nimport { isSupported as isMessagingSupported } from 'firebase/messaging';\nimport { isSupported as isAnalyticsSupported } from 'firebase/analytics';\n\nexport const VERSION = new Version('7.5.0');\n\nconst isAnalyticsSupportedValueSymbol = '__angularfire_symbol__analyticsIsSupportedValue';\nconst isAnalyticsSupportedPromiseSymbol = '__angularfire_symbol__analyticsIsSupported';\nconst isRemoteConfigSupportedValueSymbol = '__angularfire_symbol__remoteConfigIsSupportedValue';\nconst isRemoteConfigSupportedPromiseSymbol = '__angularfire_symbol__remoteConfigIsSupported';\nconst isMessagingSupportedValueSymbol = '__angularfire_symbol__messagingIsSupportedValue';\nconst isMessagingSupportedPromiseSymbol = '__angularfire_symbol__messagingIsSupported';\n\nglobalThis[isAnalyticsSupportedPromiseSymbol] ||= isAnalyticsSupported().then(it =>\n globalThis[isAnalyticsSupportedValueSymbol] = it\n).catch(() =>\n globalThis[isAnalyticsSupportedValueSymbol] = false\n);\n\nglobalThis[isMessagingSupportedPromiseSymbol] ||= isMessagingSupported().then(it =>\n globalThis[isMessagingSupportedValueSymbol] = it\n).catch(() =>\n globalThis[isMessagingSupportedValueSymbol] = false\n);\n\nglobalThis[isRemoteConfigSupportedPromiseSymbol] ||= isRemoteConfigSupported().then(it =>\n globalThis[isRemoteConfigSupportedValueSymbol] = it\n).catch(() =>\n globalThis[isRemoteConfigSupportedValueSymbol] = false\n);\n\nconst isSupportedError = (module: string) =>\n `The APP_INITIALIZER that is \"making\" isSupported() sync for the sake of convenient DI has not resolved in this\ncontext. Rather than injecting ${module} in the constructor, first ensure that ${module} is supported by calling\n\\`await isSupported()\\`, then retrieve the instance from the injector manually \\`injector.get(${module})\\`.`;\n\nexport const ɵisMessagingSupportedFactory = {\n async: () => globalThis[isMessagingSupportedPromiseSymbol],\n sync: () => {\n const ret = globalThis[isMessagingSupportedValueSymbol];\n if (ret === undefined) { throw new Error(isSupportedError('Messaging')); }\n return ret;\n }\n};\n\nexport const ɵisRemoteConfigSupportedFactory = {\n async: () => globalThis[isRemoteConfigSupportedPromiseSymbol],\n sync: () => {\n const ret = globalThis[isRemoteConfigSupportedValueSymbol];\n if (ret === undefined) { throw new Error(isSupportedError('RemoteConfig')); }\n return ret;\n }\n};\n\nexport const ɵisAnalyticsSupportedFactory = {\n async: () => globalThis[isAnalyticsSupportedPromiseSymbol],\n sync: () => {\n const ret = globalThis[isAnalyticsSupportedValueSymbol];\n if (ret === undefined) { throw new Error(isSupportedError('Analytics')); }\n return ret;\n }\n};\n\n// TODO is there a better way to get at the internal types?\ninterface FirebaseAppWithContainer extends FirebaseApp {\n container: ComponentContainer;\n}\n\nexport function ɵgetDefaultInstanceOf<T= unknown>(identifier: string, provided: T[]|undefined, defaultApp: FirebaseApp): T|undefined {\n if (provided) {\n // Was provide* only called once? If so grab that\n if (provided.length === 1) { return provided[0]; }\n const providedUsingDefaultApp = provided.filter((it: any) => it.app === defaultApp);\n // Was provide* only called once, using the default app? If so use that\n if (providedUsingDefaultApp.length === 1) { return providedUsingDefaultApp[0]; }\n }\n // Grab the default instance from the defaultApp\n const defaultAppWithContainer: FirebaseAppWithContainer = defaultApp as any;\n const provider = defaultAppWithContainer.container.getProvider(identifier as never);\n return provider.getImmediate({ optional: true });\n}\n\nexport const ɵgetAllInstancesOf = <T= unknown>(identifier: string, app?: FirebaseApp): Array<T> => {\n const apps = app ? [app] : getApps();\n const instances: Array<any> = [];\n apps.forEach((app: FirebaseAppWithContainer) => {\n const provider: any = app.container.getProvider(identifier as never);\n provider.instances.forEach((instance: any) => {\n if (!instances.includes(instance)) {\n instances.push(instance);\n }\n });\n });\n return instances;\n};\n","import { Injectable, NgZone } from '@angular/core';\nimport {\n asyncScheduler,\n Observable,\n Operator,\n queueScheduler,\n SchedulerAction,\n SchedulerLike,\n Subscriber,\n Subscription,\n TeardownLogic\n} from 'rxjs';\nimport { observeOn, subscribeOn, tap } from 'rxjs/operators';\n\nfunction noop() {\n}\n\n/**\n * Schedules tasks so that they are invoked inside the Zone that is passed in the constructor.\n */\n// tslint:disable-next-line:class-name\nexport class ɵZoneScheduler implements SchedulerLike {\n constructor(private zone: any, private delegate: any = queueScheduler) {\n }\n\n now() {\n return this.delegate.now();\n }\n\n schedule(work: (this: SchedulerAction<any>, state?: any) => void, delay?: number, state?: any): Subscription {\n const targetZone = this.zone;\n // Wrap the specified work function to make sure that if nested scheduling takes place the\n // work is executed in the correct zone\n const workInZone = function(this: SchedulerAction<any>, state: any) {\n targetZone.runGuarded(() => {\n work.apply(this, [state]);\n });\n };\n\n // Scheduling itself needs to be run in zone to ensure setInterval calls for async scheduling are done\n // inside the correct zone. This scheduler needs to schedule asynchronously always to ensure that\n // firebase emissions are never synchronous. Specifying a delay causes issues with the queueScheduler delegate.\n return this.delegate.schedule(workInZone, delay, state);\n }\n}\n\nclass BlockUntilFirstOperator<T> implements Operator<T, T> {\n private task: MacroTask | null = null;\n\n constructor(private zone: any) {\n }\n\n call(subscriber: Subscriber<T>, source: Observable<T>): TeardownLogic {\n const unscheduleTask = this.unscheduleTask.bind(this);\n this.task = this.zone.run(() => Zone.current.scheduleMacroTask('firebaseZoneBlock', noop, {}, noop, noop));\n\n return source.pipe(\n tap({ next: unscheduleTask, complete: unscheduleTask, error: unscheduleTask })\n ).subscribe(subscriber).add(unscheduleTask);\n }\n\n private unscheduleTask() {\n // maybe this is a race condition, invoke in a timeout\n // hold for 10ms while I try to figure out what is going on\n setTimeout(() => {\n if (this.task != null && this.task.state === 'scheduled') {\n this.task.invoke();\n this.task = null;\n }\n }, 10);\n }\n}\n\n@Injectable({\n providedIn: 'root',\n})\n// tslint:disable-next-line:class-name\nexport class ɵAngularFireSchedulers {\n public readonly outsideAngular: ɵZoneScheduler;\n public readonly insideAngular: ɵZoneScheduler;\n\n constructor(public ngZone: NgZone) {\n this.outsideAngular = ngZone.runOutsideAngular(() => new ɵZoneScheduler(Zone.current));\n this.insideAngular = ngZone.run(() => new ɵZoneScheduler(Zone.current, asyncScheduler));\n globalThis.ɵAngularFireScheduler ||= this;\n }\n}\n\nfunction getSchedulers() {\n const schedulers = globalThis.ɵAngularFireScheduler as ɵAngularFireSchedulers|undefined;\n if (!schedulers) {\n throw new Error(\n`Either AngularFireModule has not been provided in your AppModule (this can be done manually or implictly using\nprovideFirebaseApp) or you're calling an AngularFire method outside of an NgModule (which is not supported).`);\n }\n return schedulers;\n}\n\nfunction runOutsideAngular<T>(fn: (...args: any[]) => T): T {\n return getSchedulers().ngZone.runOutsideAngular(() => fn());\n}\n\nfunction run<T>(fn: (...args: any[]) => T): T {\n return getSchedulers().ngZone.run(() => fn());\n}\n\nexport function observeOutsideAngular<T>(obs$: Observable<T>): Observable<T> {\n return obs$.pipe(observeOn(getSchedulers().outsideAngular));\n}\n\nexport function observeInsideAngular<T>(obs$: Observable<T>): Observable<T> {\n return obs$.pipe(observeOn(getSchedulers().insideAngular));\n}\n\nexport function keepUnstableUntilFirst<T>(obs$: Observable<T>): Observable<T> {\n const scheduler = getSchedulers();\n return ɵkeepUnstableUntilFirstFactory(getSchedulers())(obs$);\n}\n\n/**\n * Operator to block the zone until the first value has been emitted or the observable\n * has completed/errored. This is used to make sure that universal waits until the first\n * value from firebase but doesn't block the zone forever since the firebase subscription\n * is still alive.\n */\nexport function ɵkeepUnstableUntilFirstFactory(schedulers: ɵAngularFireSchedulers) {\n return function keepUnstableUntilFirst<T>(obs$: Observable<T>): Observable<T> {\n obs$ = obs$.lift(\n new BlockUntilFirstOperator(schedulers.ngZone)\n );\n\n return obs$.pipe(\n // Run the subscribe body outside of Angular (e.g. calling Firebase SDK to add a listener to a change event)\n subscribeOn(schedulers.outsideAngular),\n // Run operators inside the angular zone (e.g. side effects via tap())\n observeOn(schedulers.insideAngular)\n // INVESTIGATE https://github.com/angular/angularfire/pull/2315\n // share()\n );\n };\n}\n\nconst zoneWrapFn = (it: (...args: any[]) => any, macrotask: MacroTask|undefined) => {\n const _this = this;\n // function() is needed for the arguments object\n // tslint:disable-next-line:only-arrow-functions\n return function() {\n const _arguments = arguments;\n if (macrotask) {\n setTimeout(() => {\n if (macrotask.state === 'scheduled') {\n macrotask.invoke();\n }\n }, 10);\n }\n return run(() => it.apply(_this, _arguments));\n };\n};\n\nexport const ɵzoneWrap = <T= unknown>(it: T, blockUntilFirst: boolean): T => {\n // function() is needed for the arguments object\n // tslint:disable-next-line:only-arrow-functions\n return function() {\n let macrotask: MacroTask | undefined;\n const _arguments = arguments;\n // if this is a callback function, e.g, onSnapshot, we should create a microtask and invoke it\n // only once one of the callback functions is tripped.\n for (let i = 0; i < arguments.length; i++) {\n if (typeof _arguments[i] === 'function') {\n if (blockUntilFirst) {\n macrotask ||= run(() => Zone.current.scheduleMacroTask('firebaseZoneBlock', noop, {}, noop, noop));\n }\n // TODO create a microtask to track callback functions\n _arguments[i] = zoneWrapFn(_arguments[i], macrotask);\n }\n }\n const ret = runOutsideAngular(() => (it as any).apply(this, _arguments));\n if (!blockUntilFirst) {\n if (ret instanceof Observable) {\n const schedulers = getSchedulers();\n return ret.pipe(\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n );\n } else {\n return run(() => ret);\n }\n }\n if (ret instanceof Observable) {\n return ret.pipe(keepUnstableUntilFirst) as any;\n } else if (ret instanceof Promise) {\n return run(() => new Promise((resolve, reject) => ret.then(it => run(() => resolve(it)), reason => run(() => reject(reason)))));\n } else if (typeof ret === 'function' && macrotask) {\n // Handle unsubscribe\n // function() is needed for the arguments object\n // tslint:disable-next-line:only-arrow-functions\n return function() {\n setTimeout(() => {\n if (macrotask && macrotask.state === 'scheduled') {\n macrotask.invoke();\n }\n }, 10);\n return ret.apply(this, arguments);\n };\n } else {\n // TODO how do we handle storage uploads in Zone? and other stuff with cancel() etc?\n return run(() => ret);\n }\n } as any;\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["Version","isAnalyticsSupported","isMessagingSupported","isRemoteConfigSupported","app","getApps","tap","asyncScheduler","Injectable","observeOn","subscribeOn","Observable"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;QAOa,OAAO,GAAG,IAAIA,UAAO,CAAC,sBAAsB,EAAE;IAE3D,IAAM,+BAA+B,GAAG,iDAAiD,CAAC;IAC1F,IAAM,iCAAiC,GAAG,4CAA4C,CAAC;IACvF,IAAM,kCAAkC,GAAG,oDAAoD,CAAC;IAChG,IAAM,oCAAoC,GAAG,+CAA+C,CAAC;IAC7F,IAAM,+BAA+B,GAAG,iDAAiD,CAAC;IAC1F,IAAM,iCAAiC,GAAG,4CAA4C,CAAC;IAEvF,UAAU,CAAC,iCAAiC,MAA5C,UAAU,CAAC,iCAAiC,IAAMC,qBAAoB,EAAE,CAAC,IAAI,CAAC,UAAA,EAAE,IAC9E,OAAA,UAAU,CAAC,+BAA+B,CAAC,GAAG,EAAE,GAAA,CACjD,CAAC,KAAK,CAAC,cACN,OAAA,UAAU,CAAC,+BAA+B,CAAC,GAAG,KAAK,GAAA,CACpD,EAAC;IAEF,UAAU,CAAC,iCAAiC,MAA5C,UAAU,CAAC,iCAAiC,IAAMC,qBAAoB,EAAE,CAAC,IAAI,CAAC,UAAA,EAAE,IAC9E,OAAA,UAAU,CAAC,+BAA+B,CAAC,GAAG,EAAE,GAAA,CACjD,CAAC,KAAK,CAAC,cACN,OAAA,UAAU,CAAC,+B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,YAAYE,eAAU,EAAE;gBAC7B,OAAO,GAAG,CAAC,IAAI,CAAC,sBAAsB,CAAQ,CAAC;aAChD;iBAAM,IAAI,GAAG,YAAY,OAAO,EAAE;gBACjC,OAAO,GAAG,CAAC,cAAM,OAAA,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM,IAAK,OAAA,GAAG,CAAC,IAAI,CAAC,UAAA,EAAE,IAAI,OAAA,GAAG,CAAC,cAAM,OAAA,OAAO,CAAC,EAAE,CAAC,GAAA,CAAC,GAAA,EAAE,UAAA,MAAM,IAAI,OAAA,GAAG,CAAC,cAAM,OAAA,MAAM,CAAC,MAAM,CAAC,GAAA,CAAC,GAAA,CAAC,GAAA,CAAC,GAAA,CAAC,CAAC;aACjI;iBAAM,IAAI,OAAO,GAAG,KAAK,UAAU,IAAI,SAAS,EAAE;;;;gBAIjD,OAAO;oBACL,UAAU,CAAC;wBACT,IAAI,SAAS,IAAI,SAAS,CAAC,KAAK,KAAK,WAAW,EAAE;4BAChD,SAAS,CAAC,MAAM,EAAE,CAAC;yBACpB;qBACF,EAAE,EAAE,CAAC,CAAC;oBACP,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;iBACnC,CAAC;aACH;iBAAM;;gBAEL,OAAO,GAAG,CAAC,cAAM,OAAA,GAAG,GAAA,CAAC,CAAC;aACvB;SACK,CAAC;IACX;;ICjNA;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"angular-fire.umd.js","sources":["../../../src/core.ts","../../../src/zones.ts","../../../src/angular-fire.ts"],"sourcesContent":["import { Version } from '@angular/core';\nimport { FirebaseApp, getApps } from 'firebase/app';\nimport { ComponentContainer } from '@firebase/component';\nimport { isSupported as isRemoteConfigSupported } from 'firebase/remote-config';\nimport { isSupported as isMessagingSupported } from 'firebase/messaging';\nimport { isSupported as isAnalyticsSupported } from 'firebase/analytics';\n\nexport const VERSION = new Version('7.6.0-canary.60943d6');\n\nconst isAnalyticsSupportedValueSymbol = '__angularfire_symbol__analyticsIsSupportedValue';\nconst isAnalyticsSupportedPromiseSymbol = '__angularfire_symbol__analyticsIsSupported';\nconst isRemoteConfigSupportedValueSymbol = '__angularfire_symbol__remoteConfigIsSupportedValue';\nconst isRemoteConfigSupportedPromiseSymbol = '__angularfire_symbol__remoteConfigIsSupported';\nconst isMessagingSupportedValueSymbol = '__angularfire_symbol__messagingIsSupportedValue';\nconst isMessagingSupportedPromiseSymbol = '__angularfire_symbol__messagingIsSupported';\n\nglobalThis[isAnalyticsSupportedPromiseSymbol] ||= isAnalyticsSupported().then(it =>\n globalThis[isAnalyticsSupportedValueSymbol] = it\n).catch(() =>\n globalThis[isAnalyticsSupportedValueSymbol] = false\n);\n\nglobalThis[isMessagingSupportedPromiseSymbol] ||= isMessagingSupported().then(it =>\n globalThis[isMessagingSupportedValueSymbol] = it\n).catch(() =>\n globalThis[isMessagingSupportedValueSymbol] = false\n);\n\nglobalThis[isRemoteConfigSupportedPromiseSymbol] ||= isRemoteConfigSupported().then(it =>\n globalThis[isRemoteConfigSupportedValueSymbol] = it\n).catch(() =>\n globalThis[isRemoteConfigSupportedValueSymbol] = false\n);\n\nconst isSupportedError = (module: string) =>\n `The APP_INITIALIZER that is \"making\" isSupported() sync for the sake of convenient DI has not resolved in this\ncontext. Rather than injecting ${module} in the constructor, first ensure that ${module} is supported by calling\n\\`await isSupported()\\`, then retrieve the instance from the injector manually \\`injector.get(${module})\\`.`;\n\nexport const ɵisMessagingSupportedFactory = {\n async: () => globalThis[isMessagingSupportedPromiseSymbol],\n sync: () => {\n const ret = globalThis[isMessagingSupportedValueSymbol];\n if (ret === undefined) { throw new Error(isSupportedError('Messaging')); }\n return ret;\n }\n};\n\nexport const ɵisRemoteConfigSupportedFactory = {\n async: () => globalThis[isRemoteConfigSupportedPromiseSymbol],\n sync: () => {\n const ret = globalThis[isRemoteConfigSupportedValueSymbol];\n if (ret === undefined) { throw new Error(isSupportedError('RemoteConfig')); }\n return ret;\n }\n};\n\nexport const ɵisAnalyticsSupportedFactory = {\n async: () => globalThis[isAnalyticsSupportedPromiseSymbol],\n sync: () => {\n const ret = globalThis[isAnalyticsSupportedValueSymbol];\n if (ret === undefined) { throw new Error(isSupportedError('Analytics')); }\n return ret;\n }\n};\n\n// TODO is there a better way to get at the internal types?\ninterface FirebaseAppWithContainer extends FirebaseApp {\n container: ComponentContainer;\n}\n\nexport function ɵgetDefaultInstanceOf<T= unknown>(identifier: string, provided: T[]|undefined, defaultApp: FirebaseApp): T|undefined {\n if (provided) {\n // Was provide* only called once? If so grab that\n if (provided.length === 1) { return provided[0]; }\n const providedUsingDefaultApp = provided.filter((it: any) => it.app === defaultApp);\n // Was provide* only called once, using the default app? If so use that\n if (providedUsingDefaultApp.length === 1) { return providedUsingDefaultApp[0]; }\n }\n // Grab the default instance from the defaultApp\n const defaultAppWithContainer: FirebaseAppWithContainer = defaultApp as any;\n const provider = defaultAppWithContainer.container.getProvider(identifier as never);\n return provider.getImmediate({ optional: true });\n}\n\nexport const ɵgetAllInstancesOf = <T= unknown>(identifier: string, app?: FirebaseApp): Array<T> => {\n const apps = app ? [app] : getApps();\n const instances: Array<any> = [];\n apps.forEach((app: FirebaseAppWithContainer) => {\n const provider: any = app.container.getProvider(identifier as never);\n provider.instances.forEach((instance: any) => {\n if (!instances.includes(instance)) {\n instances.push(instance);\n }\n });\n });\n return instances;\n};\n","import { Injectable, NgZone } from '@angular/core';\nimport {\n asyncScheduler,\n Observable,\n Operator,\n queueScheduler,\n SchedulerAction,\n SchedulerLike,\n Subscriber,\n Subscription,\n TeardownLogic\n} from 'rxjs';\nimport { observeOn, subscribeOn, tap } from 'rxjs/operators';\n\nfunction noop() {\n}\n\n/**\n * Schedules tasks so that they are invoked inside the Zone that is passed in the constructor.\n */\n// tslint:disable-next-line:class-name\nexport class ɵZoneScheduler implements SchedulerLike {\n constructor(private zone: any, private delegate: any = queueScheduler) {\n }\n\n now() {\n return this.delegate.now();\n }\n\n schedule(work: (this: SchedulerAction<any>, state?: any) => void, delay?: number, state?: any): Subscription {\n const targetZone = this.zone;\n // Wrap the specified work function to make sure that if nested scheduling takes place the\n // work is executed in the correct zone\n const workInZone = function(this: SchedulerAction<any>, state: any) {\n targetZone.runGuarded(() => {\n work.apply(this, [state]);\n });\n };\n\n // Scheduling itself needs to be run in zone to ensure setInterval calls for async scheduling are done\n // inside the correct zone. This scheduler needs to schedule asynchronously always to ensure that\n // firebase emissions are never synchronous. Specifying a delay causes issues with the queueScheduler delegate.\n return this.delegate.schedule(workInZone, delay, state);\n }\n}\n\nclass BlockUntilFirstOperator<T> implements Operator<T, T> {\n private task: MacroTask | null = null;\n\n constructor(private zone: any) {\n }\n\n call(subscriber: Subscriber<T>, source: Observable<T>): TeardownLogic {\n const unscheduleTask = this.unscheduleTask.bind(this);\n this.task = this.zone.run(() => Zone.current.scheduleMacroTask('firebaseZoneBlock', noop, {}, noop, noop));\n\n return source.pipe(\n tap({ next: unscheduleTask, complete: unscheduleTask, error: unscheduleTask })\n ).subscribe(subscriber).add(unscheduleTask);\n }\n\n private unscheduleTask() {\n // maybe this is a race condition, invoke in a timeout\n // hold for 10ms while I try to figure out what is going on\n setTimeout(() => {\n if (this.task != null && this.task.state === 'scheduled') {\n this.task.invoke();\n this.task = null;\n }\n }, 10);\n }\n}\n\n@Injectable({\n providedIn: 'root',\n})\n// tslint:disable-next-line:class-name\nexport class ɵAngularFireSchedulers {\n public readonly outsideAngular: ɵZoneScheduler;\n public readonly insideAngular: ɵZoneScheduler;\n\n constructor(public ngZone: NgZone) {\n this.outsideAngular = ngZone.runOutsideAngular(() => new ɵZoneScheduler(Zone.current));\n this.insideAngular = ngZone.run(() => new ɵZoneScheduler(Zone.current, asyncScheduler));\n globalThis.ɵAngularFireScheduler ||= this;\n }\n}\n\nfunction getSchedulers() {\n const schedulers = globalThis.ɵAngularFireScheduler as ɵAngularFireSchedulers|undefined;\n if (!schedulers) {\n throw new Error(\n`Either AngularFireModule has not been provided in your AppModule (this can be done manually or implictly using\nprovideFirebaseApp) or you're calling an AngularFire method outside of an NgModule (which is not supported).`);\n }\n return schedulers;\n}\n\nfunction runOutsideAngular<T>(fn: (...args: any[]) => T): T {\n return getSchedulers().ngZone.runOutsideAngular(() => fn());\n}\n\nfunction run<T>(fn: (...args: any[]) => T): T {\n return getSchedulers().ngZone.run(() => fn());\n}\n\nexport function observeOutsideAngular<T>(obs$: Observable<T>): Observable<T> {\n return obs$.pipe(observeOn(getSchedulers().outsideAngular));\n}\n\nexport function observeInsideAngular<T>(obs$: Observable<T>): Observable<T> {\n return obs$.pipe(observeOn(getSchedulers().insideAngular));\n}\n\nexport function keepUnstableUntilFirst<T>(obs$: Observable<T>): Observable<T> {\n const scheduler = getSchedulers();\n return ɵkeepUnstableUntilFirstFactory(getSchedulers())(obs$);\n}\n\n/**\n * Operator to block the zone until the first value has been emitted or the observable\n * has completed/errored. This is used to make sure that universal waits until the first\n * value from firebase but doesn't block the zone forever since the firebase subscription\n * is still alive.\n */\nexport function ɵkeepUnstableUntilFirstFactory(schedulers: ɵAngularFireSchedulers) {\n return function keepUnstableUntilFirst<T>(obs$: Observable<T>): Observable<T> {\n obs$ = obs$.lift(\n new BlockUntilFirstOperator(schedulers.ngZone)\n );\n\n return obs$.pipe(\n // Run the subscribe body outside of Angular (e.g. calling Firebase SDK to add a listener to a change event)\n subscribeOn(schedulers.outsideAngular),\n // Run operators inside the angular zone (e.g. side effects via tap())\n observeOn(schedulers.insideAngular)\n // INVESTIGATE https://github.com/angular/angularfire/pull/2315\n // share()\n );\n };\n}\n\nconst zoneWrapFn = (it: (...args: any[]) => any, macrotask: MacroTask|undefined) => {\n const _this = this;\n // function() is needed for the arguments object\n // tslint:disable-next-line:only-arrow-functions\n return function() {\n const _arguments = arguments;\n if (macrotask) {\n setTimeout(() => {\n if (macrotask.state === 'scheduled') {\n macrotask.invoke();\n }\n }, 10);\n }\n return run(() => it.apply(_this, _arguments));\n };\n};\n\nexport const ɵzoneWrap = <T= unknown>(it: T, blockUntilFirst: boolean): T => {\n // function() is needed for the arguments object\n // tslint:disable-next-line:only-arrow-functions\n return function() {\n let macrotask: MacroTask | undefined;\n const _arguments = arguments;\n // if this is a callback function, e.g, onSnapshot, we should create a microtask and invoke it\n // only once one of the callback functions is tripped.\n for (let i = 0; i < arguments.length; i++) {\n if (typeof _arguments[i] === 'function') {\n if (blockUntilFirst) {\n macrotask ||= run(() => Zone.current.scheduleMacroTask('firebaseZoneBlock', noop, {}, noop, noop));\n }\n // TODO create a microtask to track callback functions\n _arguments[i] = zoneWrapFn(_arguments[i], macrotask);\n }\n }\n const ret = runOutsideAngular(() => (it as any).apply(this, _arguments));\n if (!blockUntilFirst) {\n if (ret instanceof Observable) {\n const schedulers = getSchedulers();\n return ret.pipe(\n subscribeOn(schedulers.outsideAngular),\n observeOn(schedulers.insideAngular),\n );\n } else {\n return run(() => ret);\n }\n }\n if (ret instanceof Observable) {\n return ret.pipe(keepUnstableUntilFirst) as any;\n } else if (ret instanceof Promise) {\n return run(() => new Promise((resolve, reject) => ret.then(it => run(() => resolve(it)), reason => run(() => reject(reason)))));\n } else if (typeof ret === 'function' && macrotask) {\n // Handle unsubscribe\n // function() is needed for the arguments object\n // tslint:disable-next-line:only-arrow-functions\n return function() {\n setTimeout(() => {\n if (macrotask && macrotask.state === 'scheduled') {\n macrotask.invoke();\n }\n }, 10);\n return ret.apply(this, arguments);\n };\n } else {\n // TODO how do we handle storage uploads in Zone? and other stuff with cancel() etc?\n return run(() => ret);\n }\n } as any;\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["Version","isAnalyticsSupported","isMessagingSupported","isRemoteConfigSupported","app","getApps","tap","asyncScheduler","Injectable","observeOn","subscribeOn","Observable"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;QAOa,OAAO,GAAG,IAAIA,UAAO,CAAC,sBAAsB,EAAE;IAE3D,IAAM,+BAA+B,GAAG,iDAAiD,CAAC;I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AC;wBACT,IAAI,SAAS,IAAI,SAAS,CAAC,KAAK,KAAK,WAAW,EAAE;4BAChD,SAAS,CAAC,MAAM,EAAE,CAAC;yBACpB;qBACF,EAAE,EAAE,CAAC,CAAC;oBACP,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;iBACnC,CAAC;aACH;iBAAM;;gBAEL,OAAO,GAAG,CAAC,cAAM,OAAA,GAAG,GAAA,CAAC,CAAC;aACvB;SACK,CAAC;IACX;;ICjNA;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -10,7 +10,7 @@ export declare type FieldPath = firebase.firestore.FieldPath;
|
|
|
10
10
|
export declare type Query<T = DocumentData> = firebase.firestore.Query<T>;
|
|
11
11
|
export declare type SetOptions = firebase.firestore.SetOptions;
|
|
12
12
|
export declare type DocumentData = firebase.firestore.DocumentData;
|
|
13
|
-
export interface DocumentSnapshotExists<T> extends firebase.firestore.DocumentSnapshot {
|
|
13
|
+
export interface DocumentSnapshotExists<T> extends firebase.firestore.DocumentSnapshot<T> {
|
|
14
14
|
readonly exists: true;
|
|
15
15
|
data(options?: SnapshotOptions): T;
|
|
16
16
|
}
|
|
@@ -20,13 +20,13 @@ export interface DocumentSnapshotDoesNotExist extends firebase.firestore.Documen
|
|
|
20
20
|
get(fieldPath: string | FieldPath, options?: SnapshotOptions): undefined;
|
|
21
21
|
}
|
|
22
22
|
export declare type DocumentSnapshot<T> = DocumentSnapshotExists<T> | DocumentSnapshotDoesNotExist;
|
|
23
|
-
export interface QueryDocumentSnapshot<T> extends firebase.firestore.QueryDocumentSnapshot {
|
|
23
|
+
export interface QueryDocumentSnapshot<T> extends firebase.firestore.QueryDocumentSnapshot<T> {
|
|
24
24
|
data(options?: SnapshotOptions): T;
|
|
25
25
|
}
|
|
26
|
-
export interface QuerySnapshot<T> extends firebase.firestore.QuerySnapshot {
|
|
26
|
+
export interface QuerySnapshot<T> extends firebase.firestore.QuerySnapshot<T> {
|
|
27
27
|
readonly docs: QueryDocumentSnapshot<T>[];
|
|
28
28
|
}
|
|
29
|
-
export interface DocumentChange<T> extends firebase.firestore.DocumentChange {
|
|
29
|
+
export interface DocumentChange<T> extends firebase.firestore.DocumentChange<T> {
|
|
30
30
|
readonly doc: QueryDocumentSnapshot<T>;
|
|
31
31
|
}
|
|
32
32
|
export interface DocumentChangeAction<T> {
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<img align="right" width="30%" src="images/analytics-illo_1x.png">
|
|
2
|
+
|
|
3
|
+
<small>
|
|
4
|
+
<a href="https://github.com/angular/angularfire">AngularFire</a> ❱ <a href="../README.md#developer-guide">Developer Guide</a> ❱ Analytics
|
|
5
|
+
</small>
|
|
6
|
+
|
|
7
|
+
# Analytics
|
|
8
|
+
|
|
9
|
+
Google Analytics is an app measurement solution, available at no charge, that provides insight on app usage and user engagement.
|
|
10
|
+
|
|
11
|
+
[Learn more](https://firebase.google.com/docs/analytics)
|
|
12
|
+
## Dependency Injection
|
|
13
|
+
|
|
14
|
+
As a prerequisite, ensure that `AngularFire` has been added to your project via
|
|
15
|
+
```bash
|
|
16
|
+
ng add @angular/fire
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Provide a Google Analytics instance in the application's `NgModule` (`app.module.ts`):
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
@NgModule({
|
|
23
|
+
declarations: [
|
|
24
|
+
...
|
|
25
|
+
],
|
|
26
|
+
imports: [
|
|
27
|
+
...
|
|
28
|
+
// App initialization
|
|
29
|
+
provideFirebaseApp(() => initializeApp(environment.firebase)),
|
|
30
|
+
provideAnalytics(() => getAnalytics())
|
|
31
|
+
],
|
|
32
|
+
providers: [],
|
|
33
|
+
bootstrap: [AppComponent]
|
|
34
|
+
})
|
|
35
|
+
export class AppModule { }
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
In your component class, for example `user-profile.component.ts` import and inject `Firestore`:
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { Component, inject } from '@angular/core';
|
|
42
|
+
import { Analytics } from '@angular/fire/analytics';
|
|
43
|
+
|
|
44
|
+
@Component({
|
|
45
|
+
standalone: true,
|
|
46
|
+
selector: 'app-user-profile',
|
|
47
|
+
...
|
|
48
|
+
})
|
|
49
|
+
export class UserProfileComponent {
|
|
50
|
+
private analytics: Analytics = inject(Analytics);
|
|
51
|
+
...
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Firebase API
|
|
56
|
+
|
|
57
|
+
The [Firebase API for Google Analytics documentation](https://firebase.google.com/docs/reference/js/analytics.md#analytics_package) is available on the Firebase website.
|
|
58
|
+
|
|
59
|
+
## Services
|
|
60
|
+
|
|
61
|
+
### ScreenTrackingService
|
|
62
|
+
|
|
63
|
+
Coming soon, for now [please review the documentation](https://firebase.google.com/docs/analytics/screenviews)
|
|
64
|
+
|
|
65
|
+
### UserTrackingService
|
|
66
|
+
Coming soon
|
|
67
|
+
|
|
@@ -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> ❱ Realtime App Check
|
|
3
|
+
</small>
|
|
4
|
+
|
|
5
|
+
<img align="right" width="30%" src="images/reCAPTCHA-logo@1x.png">
|
|
6
|
+
|
|
7
|
+
# App Check
|
|
8
|
+
|
|
9
|
+
App Check helps protect your API resources from abuse by preventing unauthorized clients from accessing your backend resources. It works with both Firebase services, Google Cloud services, and your own APIs to keep your resources safe.
|
|
10
|
+
|
|
11
|
+
[Learn More](https://firebase.google.com/docs/app-check)
|
|
12
|
+
|
|
13
|
+
## Dependency Injection
|
|
14
|
+
As a prerequisite, ensure that `AngularFire` has been added to your project via
|
|
15
|
+
```bash
|
|
16
|
+
ng add @angular/fire
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Provide an App Check instance and configuration in the application's `NgModule` (`app.module.ts`):
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
|
|
23
|
+
import { provideAppCheck } from '@angular/fire/app-check';
|
|
24
|
+
|
|
25
|
+
@NgModule({
|
|
26
|
+
imports: [
|
|
27
|
+
provideFirebaseApp(() => initializeApp(environment.firebase)),
|
|
28
|
+
provideAppCheck(() => initializeAppCheck(getApp(), {
|
|
29
|
+
provider: new ReCaptchaV3Provider(/* configuration */),
|
|
30
|
+
})),
|
|
31
|
+
]
|
|
32
|
+
})
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Next inject it into your component:
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import { Component, inject} from '@angular/core';
|
|
39
|
+
import { AppCheck } from '@angular/fire/app-check';
|
|
40
|
+
|
|
41
|
+
@Component({ ... })
|
|
42
|
+
export class AppCheckComponent {
|
|
43
|
+
private appCheck: AppCheck = inject(AppCheck);
|
|
44
|
+
...
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Firebase API
|
|
49
|
+
|
|
50
|
+
The [AppCheck documentation](https://firebase.google.com/docs/reference/js/app-check) is available on the Firebase website.
|
|
51
|
+
|
|
52
|
+
## Convenience observables
|
|
53
|
+
Coming soon.
|
package/docs/auth.md
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
<img align="right" width="30%" src="images/auth-illo_1x.png">
|
|
2
|
+
|
|
3
|
+
<small>
|
|
4
|
+
<a href="https://github.com/angular/angularfire">AngularFire</a> ❱ <a href="../README.md#developer-guide">Developer Guide</a> ❱ Authentication
|
|
5
|
+
</small>
|
|
6
|
+
|
|
7
|
+
# Authentication
|
|
8
|
+
|
|
9
|
+
Most apps need to know the identity of a user. Knowing a user's identity allows an app to securely save user data in the cloud and provide the same personalized experience across all of the user's devices.
|
|
10
|
+
Firebase Authentication provides backend services, easy-to-use SDKs, and ready-made UI libraries to authenticate users to your app. It supports authentication using passwords, phone numbers, popular federated identity providers like Google, Facebook and Twitter, and more.
|
|
11
|
+
|
|
12
|
+
Firebase Authentication integrates tightly with other Firebase services, and it leverages industry standards like OAuth 2.0 and OpenID Connect, so it can be easily integrated with your custom backend.
|
|
13
|
+
|
|
14
|
+
[Learn more about Firebase Authentication](https://firebase.google.com/docs/auth)
|
|
15
|
+
|
|
16
|
+
## Dependency Injection
|
|
17
|
+
|
|
18
|
+
As a prerequisite, ensure that `AngularFire` has been added to your project via
|
|
19
|
+
```bash
|
|
20
|
+
ng add @angular/fire
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Provide an auth instance in the application's `NgModule` (`app.module.ts`):
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
|
|
27
|
+
import { getAuth, provideAuth } from '@angular/fire/auth';
|
|
28
|
+
|
|
29
|
+
@NgModule({
|
|
30
|
+
imports: [
|
|
31
|
+
provideFirebaseApp(() => initializeApp(environment.firebase)),
|
|
32
|
+
provideAuth(() => getAuth()),
|
|
33
|
+
]
|
|
34
|
+
})
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Next inject it into your component:
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
import { Component, inject} from '@angular/core';
|
|
41
|
+
import { Auth } from '@angular/fire/auth';
|
|
42
|
+
|
|
43
|
+
@Component({ ... })
|
|
44
|
+
export class LoginComponent {
|
|
45
|
+
private auth: Auth = inject(Auth);
|
|
46
|
+
...
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Firebase API
|
|
51
|
+
|
|
52
|
+
AngularFire wraps the Firebase JS SDK to ensure proper functionality in Angular, while providing the same API.
|
|
53
|
+
|
|
54
|
+
Update the imports from `import { ... } from 'firebase/auth'` to `import { ... } from '@angular/fire/auth'` and follow the offical documentation.
|
|
55
|
+
|
|
56
|
+
[Getting Started](https://firebase.google.com/docs/auth/web/start) | [API Reference](https://firebase.google.com/docs/reference/js/auth)
|
|
57
|
+
|
|
58
|
+
## Convenience observables
|
|
59
|
+
|
|
60
|
+
AngularFire provides observables to allow convenient use of the Firebase Authentication with RXJS.
|
|
61
|
+
|
|
62
|
+
### user
|
|
63
|
+
|
|
64
|
+
The `user` observable streams events triggered by sign-in, sign-out, and token refresh events.
|
|
65
|
+
|
|
66
|
+
Example code:
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
import { Auth, User, user } from '@angular/fire/auth';
|
|
70
|
+
...
|
|
71
|
+
|
|
72
|
+
export class UserComponent implements OnDestroy {
|
|
73
|
+
private auth: Auth = inject(Auth);
|
|
74
|
+
user$ = user(auth);
|
|
75
|
+
userSubscription: Subscription;
|
|
76
|
+
...
|
|
77
|
+
|
|
78
|
+
constructor() {
|
|
79
|
+
this.userSubscription = this.user$.subscribe((aUser: User | null) => {
|
|
80
|
+
//handle user state changes here. Note, that user will be null if there is no currently logged in user.
|
|
81
|
+
console.log(aUser);
|
|
82
|
+
})
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
ngOnDestroy() {
|
|
86
|
+
// when manually subscribing to an observable remember to unsubscribe in ngOnDestroy
|
|
87
|
+
this.userSubscription.unsubscribe();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### authState
|
|
94
|
+
|
|
95
|
+
The `authState` observable streams events triggered by sign-in and sign-out events.
|
|
96
|
+
|
|
97
|
+
Example code:
|
|
98
|
+
```ts
|
|
99
|
+
import { Auth, authState } from '@angular/fire/auth';
|
|
100
|
+
...
|
|
101
|
+
|
|
102
|
+
export class UserComponent implements OnDestroy {
|
|
103
|
+
private auth: Auth = inject(Auth);
|
|
104
|
+
authState$ = authState(auth);
|
|
105
|
+
authStateSubscription: Subscription;
|
|
106
|
+
...
|
|
107
|
+
|
|
108
|
+
constructor() {
|
|
109
|
+
this.authStateSubscription = this.authState$.subscribe((aUser: User | null) => {
|
|
110
|
+
//handle auth state changes here. Note, that user will be null if there is no currently logged in user.
|
|
111
|
+
console.log(aUser);
|
|
112
|
+
})
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
ngOnDestroy() {
|
|
116
|
+
// when manually subscribing to an observable remember to unsubscribe in ngOnDestroy
|
|
117
|
+
this.authStateSubscription.unsubscribe();
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### idToken
|
|
123
|
+
|
|
124
|
+
The `idToken` observable streams events triggered by sign-in, sign-out and token refresh events.
|
|
125
|
+
|
|
126
|
+
Example code:
|
|
127
|
+
```ts
|
|
128
|
+
import { Auth, idToken } from '@angular/fire/auth';
|
|
129
|
+
...
|
|
130
|
+
|
|
131
|
+
export class UserComponent implements OnDestroy {
|
|
132
|
+
private auth: Auth = inject(Auth);
|
|
133
|
+
idToken$ = idToken(auth);
|
|
134
|
+
idTokenSubscription: Subscription;
|
|
135
|
+
...
|
|
136
|
+
|
|
137
|
+
constructor() {
|
|
138
|
+
this.idTokenSubscription = this.idToken$.subscribe((token: string | null) => {
|
|
139
|
+
//handle idToken changes here. Note, that user will be null if there is no currently logged in user.
|
|
140
|
+
console.log(string);
|
|
141
|
+
})
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
ngOnDestroy() {
|
|
145
|
+
// when manually subscribing to an observable remember to unsubscribe in ngOnDestroy
|
|
146
|
+
this.idTokenSubscription.unsubscribe();
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Connecting the emulator suite
|
|
152
|
+
|
|
153
|
+
```ts
|
|
154
|
+
import { connectAuthEmulator, getAuth, provideAuth } from '@angular/fire/auth';
|
|
155
|
+
|
|
156
|
+
@NgModule({
|
|
157
|
+
imports: [
|
|
158
|
+
provideAuth(() => {
|
|
159
|
+
const auth = getAuth();
|
|
160
|
+
connectAuthEmulator(auth, 'http://localhost:9099', { disableWarnings: true });
|
|
161
|
+
return auth;
|
|
162
|
+
}),
|
|
163
|
+
]
|
|
164
|
+
})
|
|
165
|
+
```
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
`AngularFireAnalytics` dynamically imports the `firebase/analytics` library and provides a promisified version of the [Firebase Analytics SDK (`firebase.analytics.Analytics`)](https://firebase.google.com/docs/reference/js/firebase.analytics.Analytics.html).
|
|
4
4
|
|
|
5
|
+
> **NOTE**: [AngularFire has a new tree-shakable API](../../../README.md#developer-guide), you're looking at the documentation for the compatability version of the library. [See the v7 upgrade guide for more information on this change.](../../version-7-upgrade.md).
|
|
6
|
+
|
|
5
7
|
### API:
|
|
6
8
|
|
|
7
9
|
```ts
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
`firebase.auth.Auth` instance, allowing you to log users in, out, etc. [See
|
|
7
7
|
the Firebase docs for more information on what methods are available.](https://firebase.google.com/docs/reference/js/firebase.auth.Auth)
|
|
8
8
|
|
|
9
|
+
> **NOTE**: [AngularFire has a new tree-shakable API](../../../README.md#developer-guide), you're looking at the documentation for the compatability version of the library. [See the v7 upgrade guide for more information on this change.](../../version-7-upgrade.md).
|
|
10
|
+
|
|
9
11
|
**Example app:**
|
|
10
12
|
|
|
11
13
|
```ts
|