@angular/fire 7.6.0 → 16.0.0-canary.596e208
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/analytics/is-analytics-supported-factory.d.ts +4 -0
- package/app-check/app-check.d.ts +0 -6
- package/app-check/app-check.module.d.ts +0 -1
- package/app-check/public_api.d.ts +2 -1
- package/auth-guard/auth-guard.d.ts +4 -4
- package/compat/auth/auth.d.ts +1 -1
- package/compat/auth-guard/auth-guard.d.ts +6 -4
- package/compat/database/interfaces.d.ts +12 -12
- package/compat/firestore/interfaces.d.ts +17 -17
- package/compat/proxy.d.ts +8 -8
- package/compat/remote-config/interfaces.d.ts +1 -1
- package/compat/storage/interfaces.d.ts +8 -8
- package/compat/storage/pipes/storageUrl.pipe.d.ts +1 -1
- package/core.d.ts +8 -12
- package/esm2022/analytics/analytics.module.mjs +94 -0
- package/esm2022/analytics/is-analytics-supported-factory.mjs +16 -0
- package/esm2022/analytics/overrides.mjs +3 -0
- package/esm2022/analytics/screen-tracking.service.mjs +147 -0
- package/esm2022/analytics/user-tracking.service.mjs +44 -0
- package/esm2022/app/app.module.mjs +84 -0
- package/esm2022/app-check/app-check.mjs +10 -0
- package/esm2022/app-check/app-check.module.mjs +79 -0
- package/esm2022/app-check/public_api.mjs +5 -0
- package/esm2022/auth/auth.module.mjs +71 -0
- package/esm2022/auth-guard/auth-guard.mjs +51 -0
- package/{esm2015/auth-guard/auth-guard.module.js → esm2022/auth-guard/auth-guard.module.mjs} +5 -5
- package/esm2022/compat/analytics/analytics.mjs +161 -0
- package/{esm2015/compat/analytics/analytics.module.js → esm2022/compat/analytics/analytics.module.mjs} +5 -5
- package/esm2022/compat/analytics/screen-tracking.service.mjs +49 -0
- package/esm2022/compat/analytics/user-tracking.service.mjs +53 -0
- package/esm2022/compat/auth/auth.mjs +161 -0
- package/{esm2015/compat/auth/auth.module.js → esm2022/compat/auth/auth.module.mjs} +5 -5
- package/{esm2015/compat/auth/public_api.js → esm2022/compat/auth/public_api.mjs} +1 -1
- package/esm2022/compat/auth-guard/auth-guard.mjs +51 -0
- package/{esm2015/compat/auth-guard/auth-guard.module.js → esm2022/compat/auth-guard/auth-guard.module.mjs} +5 -5
- package/{esm2015/compat/cache.js → esm2022/compat/cache.mjs} +3 -3
- package/esm2022/compat/database/database.mjs +119 -0
- package/{esm2015/compat/database/database.module.js → esm2022/compat/database/database.module.mjs} +5 -5
- package/esm2022/compat/database/list/create-reference.mjs +44 -0
- package/{esm2015/compat/firebase.app.module.js → esm2022/compat/firebase.app.module.mjs} +11 -11
- package/esm2022/compat/firestore/collection/changes.mjs +108 -0
- package/esm2022/compat/firestore/collection/collection.mjs +123 -0
- package/esm2022/compat/firestore/collection-group/collection-group.mjs +86 -0
- package/esm2022/compat/firestore/document/document.mjs +87 -0
- package/esm2022/compat/firestore/firestore.mjs +257 -0
- package/{esm2015/compat/firestore/firestore.module.js → esm2022/compat/firestore/firestore.module.mjs} +5 -5
- package/esm2022/compat/firestore/interfaces.mjs +2 -0
- package/esm2022/compat/firestore/observable/fromRef.mjs +40 -0
- package/esm2022/compat/functions/functions.mjs +69 -0
- package/{esm2015/compat/functions/functions.module.js → esm2022/compat/functions/functions.module.mjs} +5 -5
- package/{esm2015/compat/functions/public_api.js → esm2022/compat/functions/public_api.mjs} +1 -1
- package/esm2022/compat/messaging/messaging.mjs +80 -0
- package/{esm2015/compat/messaging/messaging.module.js → esm2022/compat/messaging/messaging.module.mjs} +5 -5
- package/{esm2015/compat/performance/performance.js → esm2022/compat/performance/performance.mjs} +7 -6
- package/{esm2015/compat/performance/performance.module.js → esm2022/compat/performance/performance.module.mjs} +5 -5
- package/esm2022/compat/performance/performance.service.mjs +27 -0
- package/esm2022/compat/proxy.mjs +59 -0
- package/esm2022/compat/remote-config/remote-config.mjs +207 -0
- package/{esm2015/compat/remote-config/remote-config.module.js → esm2022/compat/remote-config/remote-config.module.mjs} +5 -5
- package/esm2022/compat/storage/pipes/storageUrl.pipe.mjs +58 -0
- package/esm2022/compat/storage/storage.mjs +95 -0
- package/{esm2015/compat/storage/storage.module.js → esm2022/compat/storage/storage.module.mjs} +5 -5
- package/esm2022/core.mjs +45 -0
- package/esm2022/database/database.module.mjs +74 -0
- package/esm2022/firestore/firestore.module.mjs +74 -0
- package/esm2022/firestore/lite/lite.module.mjs +73 -0
- package/esm2022/firestore/rxfire.mjs +15 -0
- package/esm2022/functions/functions.module.mjs +74 -0
- package/esm2022/messaging/is-messaging-supported-factory.mjs +16 -0
- package/esm2022/messaging/messaging.module.mjs +86 -0
- package/esm2022/messaging/overrides.mjs +3 -0
- package/{esm2015/performance/performance.module.js → esm2022/performance/performance.module.mjs} +8 -8
- package/esm2022/remote-config/is-remote-config-supported-factory.mjs +16 -0
- package/esm2022/remote-config/overrides.mjs +3 -0
- package/esm2022/remote-config/remote-config.module.mjs +86 -0
- package/esm2022/storage/storage.module.mjs +74 -0
- package/esm2022/zones.mjs +196 -0
- package/{fesm2015/angular-fire-analytics.js → fesm2022/angular-fire-analytics.mjs} +61 -38
- package/fesm2022/angular-fire-analytics.mjs.map +1 -0
- package/{fesm2015/angular-fire-app-check.js → fesm2022/angular-fire-app-check.mjs} +15 -22
- package/fesm2022/angular-fire-app-check.mjs.map +1 -0
- package/{fesm2015/angular-fire-app.js → fesm2022/angular-fire-app.mjs} +8 -8
- package/fesm2022/angular-fire-app.mjs.map +1 -0
- package/{fesm2015/angular-fire-auth-guard.js → fesm2022/angular-fire-auth-guard.mjs} +25 -23
- package/fesm2022/angular-fire-auth-guard.mjs.map +1 -0
- package/{fesm2015/angular-fire-auth.js → fesm2022/angular-fire-auth.mjs} +10 -11
- package/fesm2022/angular-fire-auth.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-analytics.js → fesm2022/angular-fire-compat-analytics.mjs} +28 -28
- package/fesm2022/angular-fire-compat-analytics.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-auth-guard.js → fesm2022/angular-fire-compat-auth-guard.mjs} +25 -23
- package/fesm2022/angular-fire-compat-auth-guard.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-auth.js → fesm2022/angular-fire-compat-auth.mjs} +32 -10
- package/fesm2022/angular-fire-compat-auth.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-database.js → fesm2022/angular-fire-compat-database.mjs} +17 -12
- package/fesm2022/angular-fire-compat-database.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-firestore.js → fesm2022/angular-fire-compat-firestore.mjs} +37 -16
- package/fesm2022/angular-fire-compat-firestore.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-functions.js → fesm2022/angular-fire-compat-functions.mjs} +10 -9
- package/fesm2022/angular-fire-compat-functions.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-messaging.js → fesm2022/angular-fire-compat-messaging.mjs} +20 -15
- package/fesm2022/angular-fire-compat-messaging.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-performance.js → fesm2022/angular-fire-compat-performance.mjs} +16 -15
- package/fesm2022/angular-fire-compat-performance.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-remote-config.js → fesm2022/angular-fire-compat-remote-config.mjs} +33 -19
- package/fesm2022/angular-fire-compat-remote-config.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat-storage.js → fesm2022/angular-fire-compat-storage.mjs} +23 -18
- package/fesm2022/angular-fire-compat-storage.mjs.map +1 -0
- package/{fesm2015/angular-fire-compat.js → fesm2022/angular-fire-compat.mjs} +15 -17
- package/fesm2022/angular-fire-compat.mjs.map +1 -0
- package/{fesm2015/angular-fire-database.js → fesm2022/angular-fire-database.mjs} +10 -11
- package/fesm2022/angular-fire-database.mjs.map +1 -0
- package/{fesm2015/angular-fire-firestore-lite.js → fesm2022/angular-fire-firestore-lite.mjs} +10 -11
- package/fesm2022/angular-fire-firestore-lite.mjs.map +1 -0
- package/{fesm2015/angular-fire-firestore.js → fesm2022/angular-fire-firestore.mjs} +14 -13
- package/fesm2022/angular-fire-firestore.mjs.map +1 -0
- package/{fesm2015/angular-fire-functions.js → fesm2022/angular-fire-functions.mjs} +10 -11
- package/fesm2022/angular-fire-functions.mjs.map +1 -0
- package/{fesm2015/angular-fire-messaging.js → fesm2022/angular-fire-messaging.mjs} +33 -19
- package/fesm2022/angular-fire-messaging.mjs.map +1 -0
- package/{fesm2015/angular-fire-performance.js → fesm2022/angular-fire-performance.mjs} +8 -8
- package/fesm2022/angular-fire-performance.mjs.map +1 -0
- package/{fesm2015/angular-fire-remote-config.js → fesm2022/angular-fire-remote-config.mjs} +34 -20
- package/fesm2022/angular-fire-remote-config.mjs.map +1 -0
- package/{fesm2015/angular-fire-storage.js → fesm2022/angular-fire-storage.mjs} +10 -11
- package/fesm2022/angular-fire-storage.mjs.map +1 -0
- package/{fesm2015/angular-fire.js → fesm2022/angular-fire.mjs} +31 -52
- package/fesm2022/angular-fire.mjs.map +1 -0
- package/firestore/rxfire.d.ts +3 -1
- package/messaging/is-messaging-supported-factory.d.ts +4 -0
- package/package.json +159 -9
- package/publish.sh +1 -0
- package/remote-config/is-remote-config-supported-factory.d.ts +4 -0
- package/schematics/add/index.js +1 -1
- package/schematics/common.js +8 -4
- package/schematics/deploy/actions.js +59 -59
- package/schematics/deploy/builder.js +5 -5
- package/schematics/firebaseTools.js +9 -5
- package/schematics/setup/index.js +24 -23
- package/schematics/setup/prompts.js +20 -15
- package/schematics/update/v7/index.js +5 -5
- package/schematics/utils.js +30 -30
- package/README.md +0 -216
- package/analytics/package.json +0 -11
- package/app/package.json +0 -11
- package/app-check/package.json +0 -11
- package/auth/package.json +0 -11
- package/auth-guard/package.json +0 -11
- package/bundles/angular-fire-analytics.umd.js +0 -673
- package/bundles/angular-fire-analytics.umd.js.map +0 -1
- package/bundles/angular-fire-app-check.umd.js +0 -465
- package/bundles/angular-fire-app-check.umd.js.map +0 -1
- package/bundles/angular-fire-app.umd.js +0 -477
- package/bundles/angular-fire-app.umd.js.map +0 -1
- package/bundles/angular-fire-auth-guard.umd.js +0 -109
- package/bundles/angular-fire-auth-guard.umd.js.map +0 -1
- package/bundles/angular-fire-auth.umd.js +0 -557
- package/bundles/angular-fire-auth.umd.js.map +0 -1
- package/bundles/angular-fire-compat-analytics.umd.js +0 -672
- package/bundles/angular-fire-compat-analytics.umd.js.map +0 -1
- package/bundles/angular-fire-compat-auth-guard.umd.js +0 -112
- package/bundles/angular-fire-compat-auth-guard.umd.js.map +0 -1
- package/bundles/angular-fire-compat-auth.umd.js +0 -559
- package/bundles/angular-fire-compat-auth.umd.js.map +0 -1
- package/bundles/angular-fire-compat-database.umd.js +0 -799
- package/bundles/angular-fire-compat-database.umd.js.map +0 -1
- package/bundles/angular-fire-compat-firestore.umd.js +0 -1073
- package/bundles/angular-fire-compat-firestore.umd.js.map +0 -1
- package/bundles/angular-fire-compat-functions.umd.js +0 -443
- package/bundles/angular-fire-compat-functions.umd.js.map +0 -1
- package/bundles/angular-fire-compat-messaging.umd.js +0 -465
- package/bundles/angular-fire-compat-messaging.umd.js.map +0 -1
- package/bundles/angular-fire-compat-performance.umd.js +0 -212
- package/bundles/angular-fire-compat-performance.umd.js.map +0 -1
- package/bundles/angular-fire-compat-remote-config.umd.js +0 -605
- package/bundles/angular-fire-compat-remote-config.umd.js.map +0 -1
- package/bundles/angular-fire-compat-storage.umd.js +0 -598
- package/bundles/angular-fire-compat-storage.umd.js.map +0 -1
- package/bundles/angular-fire-compat.umd.js +0 -535
- package/bundles/angular-fire-compat.umd.js.map +0 -1
- package/bundles/angular-fire-database.umd.js +0 -557
- package/bundles/angular-fire-database.umd.js.map +0 -1
- package/bundles/angular-fire-firestore-lite.umd.js +0 -531
- package/bundles/angular-fire-firestore-lite.umd.js.map +0 -1
- package/bundles/angular-fire-firestore.umd.js +0 -565
- package/bundles/angular-fire-firestore.umd.js.map +0 -1
- package/bundles/angular-fire-functions.umd.js +0 -461
- package/bundles/angular-fire-functions.umd.js.map +0 -1
- package/bundles/angular-fire-messaging.umd.js +0 -473
- package/bundles/angular-fire-messaging.umd.js.map +0 -1
- package/bundles/angular-fire-performance.umd.js +0 -473
- package/bundles/angular-fire-performance.umd.js.map +0 -1
- package/bundles/angular-fire-remote-config.umd.js +0 -499
- package/bundles/angular-fire-remote-config.umd.js.map +0 -1
- package/bundles/angular-fire-storage.umd.js +0 -485
- package/bundles/angular-fire-storage.umd.js.map +0 -1
- package/bundles/angular-fire.umd.js +0 -308
- package/bundles/angular-fire.umd.js.map +0 -1
- package/compat/analytics/package.json +0 -11
- package/compat/auth/package.json +0 -11
- package/compat/auth-guard/package.json +0 -11
- package/compat/database/package.json +0 -11
- package/compat/firestore/package.json +0 -11
- package/compat/functions/package.json +0 -11
- package/compat/messaging/package.json +0 -11
- package/compat/package.json +0 -11
- package/compat/performance/package.json +0 -11
- package/compat/remote-config/package.json +0 -11
- package/compat/storage/package.json +0 -11
- package/database/package.json +0 -11
- package/docs/analytics.md +0 -67
- package/docs/app-check.md +0 -53
- package/docs/auth.md +0 -165
- package/docs/compat/analytics/getting-started.md +0 -137
- package/docs/compat/auth/getting-started.md +0 -162
- package/docs/compat/auth/router-guards.md +0 -104
- package/docs/compat/emulators/emulators.md +0 -134
- package/docs/compat/firestore/collections.md +0 -326
- package/docs/compat/firestore/documents.md +0 -115
- package/docs/compat/firestore/offline-data.md +0 -39
- package/docs/compat/firestore/querying-collections.md +0 -204
- package/docs/compat/functions/functions.md +0 -166
- package/docs/compat/messaging/messaging.md +0 -232
- package/docs/compat/performance/getting-started.md +0 -132
- package/docs/compat/remote-config/getting-started.md +0 -134
- package/docs/compat/rtdb/lists.md +0 -257
- package/docs/compat/rtdb/objects.md +0 -182
- package/docs/compat/rtdb/querying-lists.md +0 -155
- package/docs/compat/storage/storage.md +0 -257
- package/docs/compat.md +0 -70
- package/docs/database.md +0 -175
- package/docs/deploy/getting-started.md +0 -204
- package/docs/firebase.json +0 -16
- package/docs/firestore.md +0 -148
- package/docs/functions.md +0 -52
- 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 +0 -114
- package/docs/install-angular-cli-windows10.md +0 -82
- package/docs/messaging.md +0 -25
- package/docs/performance.md +0 -57
- package/docs/remote-config.md +0 -53
- package/docs/storage.md +0 -90
- package/docs/universal/cloud-functions.md +0 -75
- package/docs/universal/getting-started.md +0 -153
- package/docs/universal/prerendering.md +0 -72
- package/docs/version-4-upgrade.md +0 -119
- package/docs/version-5-upgrade.md +0 -82
- package/docs/version-6-upgrade.md +0 -16
- package/docs/version-7-upgrade.md +0 -298
- package/esm2015/analytics/analytics.module.js +0 -93
- package/esm2015/analytics/overrides.js +0 -3
- package/esm2015/analytics/screen-tracking.service.js +0 -139
- package/esm2015/analytics/user-tracking.service.js +0 -43
- package/esm2015/app/app.module.js +0 -84
- package/esm2015/app-check/app-check.js +0 -16
- package/esm2015/app-check/app-check.module.js +0 -81
- package/esm2015/app-check/public_api.js +0 -4
- package/esm2015/auth/auth.module.js +0 -71
- package/esm2015/auth-guard/auth-guard.js +0 -49
- package/esm2015/compat/analytics/analytics.js +0 -163
- package/esm2015/compat/analytics/screen-tracking.service.js +0 -49
- package/esm2015/compat/analytics/user-tracking.service.js +0 -52
- package/esm2015/compat/auth/auth.js +0 -139
- package/esm2015/compat/auth-guard/auth-guard.js +0 -49
- package/esm2015/compat/database/database.js +0 -117
- package/esm2015/compat/database/list/create-reference.js +0 -41
- package/esm2015/compat/firestore/collection/changes.js +0 -107
- package/esm2015/compat/firestore/collection/collection.js +0 -117
- package/esm2015/compat/firestore/collection-group/collection-group.js +0 -81
- package/esm2015/compat/firestore/document/document.js +0 -82
- package/esm2015/compat/firestore/firestore.js +0 -254
- package/esm2015/compat/firestore/interfaces.js +0 -2
- package/esm2015/compat/firestore/observable/fromRef.js +0 -39
- package/esm2015/compat/functions/functions.js +0 -68
- package/esm2015/compat/messaging/messaging.js +0 -75
- package/esm2015/compat/performance/performance.service.js +0 -27
- package/esm2015/compat/proxy.js +0 -61
- package/esm2015/compat/remote-config/remote-config.js +0 -193
- package/esm2015/compat/storage/pipes/storageUrl.pipe.js +0 -54
- package/esm2015/compat/storage/storage.js +0 -94
- package/esm2015/core.js +0 -79
- package/esm2015/database/database.module.js +0 -74
- package/esm2015/firestore/firestore.module.js +0 -74
- package/esm2015/firestore/lite/lite.module.js +0 -74
- package/esm2015/firestore/rxfire.js +0 -13
- package/esm2015/functions/functions.module.js +0 -74
- package/esm2015/messaging/messaging.module.js +0 -85
- package/esm2015/messaging/overrides.js +0 -3
- package/esm2015/remote-config/overrides.js +0 -3
- package/esm2015/remote-config/remote-config.module.js +0 -85
- package/esm2015/storage/storage.module.js +0 -74
- package/esm2015/zones.js +0 -183
- package/fesm2015/angular-fire-analytics.js.map +0 -1
- package/fesm2015/angular-fire-app-check.js.map +0 -1
- package/fesm2015/angular-fire-app.js.map +0 -1
- package/fesm2015/angular-fire-auth-guard.js.map +0 -1
- package/fesm2015/angular-fire-auth.js.map +0 -1
- package/fesm2015/angular-fire-compat-analytics.js.map +0 -1
- package/fesm2015/angular-fire-compat-auth-guard.js.map +0 -1
- package/fesm2015/angular-fire-compat-auth.js.map +0 -1
- package/fesm2015/angular-fire-compat-database.js.map +0 -1
- package/fesm2015/angular-fire-compat-firestore.js.map +0 -1
- package/fesm2015/angular-fire-compat-functions.js.map +0 -1
- package/fesm2015/angular-fire-compat-messaging.js.map +0 -1
- package/fesm2015/angular-fire-compat-performance.js.map +0 -1
- package/fesm2015/angular-fire-compat-remote-config.js.map +0 -1
- package/fesm2015/angular-fire-compat-storage.js.map +0 -1
- package/fesm2015/angular-fire-compat.js.map +0 -1
- package/fesm2015/angular-fire-database.js.map +0 -1
- package/fesm2015/angular-fire-firestore-lite.js.map +0 -1
- package/fesm2015/angular-fire-firestore.js.map +0 -1
- package/fesm2015/angular-fire-functions.js.map +0 -1
- package/fesm2015/angular-fire-messaging.js.map +0 -1
- package/fesm2015/angular-fire-performance.js.map +0 -1
- package/fesm2015/angular-fire-remote-config.js.map +0 -1
- package/fesm2015/angular-fire-storage.js.map +0 -1
- package/fesm2015/angular-fire.js.map +0 -1
- package/firestore/lite/package.json +0 -11
- package/firestore/package.json +0 -11
- package/firestore-protos.js +0 -4
- package/functions/package.json +0 -11
- package/messaging/package.json +0 -11
- package/performance/package.json +0 -11
- package/remote-config/package.json +0 -11
- package/schematics/add/schema.json +0 -16
- package/schematics/builders.json +0 -10
- package/schematics/collection.json +0 -15
- package/schematics/deploy/schema.json +0 -119
- package/schematics/migration.json +0 -15
- package/schematics/setup/schema.json +0 -16
- package/storage/package.json +0 -11
- /package/analytics/{angular-fire-analytics.d.ts → index.d.ts} +0 -0
- /package/app/{angular-fire-app.d.ts → index.d.ts} +0 -0
- /package/app-check/{angular-fire-app-check.d.ts → index.d.ts} +0 -0
- /package/auth/{angular-fire-auth.d.ts → index.d.ts} +0 -0
- /package/auth-guard/{angular-fire-auth-guard.d.ts → index.d.ts} +0 -0
- /package/compat/analytics/{angular-fire-compat-analytics.d.ts → index.d.ts} +0 -0
- /package/compat/auth/{angular-fire-compat-auth.d.ts → index.d.ts} +0 -0
- /package/compat/auth-guard/{angular-fire-compat-auth-guard.d.ts → index.d.ts} +0 -0
- /package/compat/database/{angular-fire-compat-database.d.ts → index.d.ts} +0 -0
- /package/compat/firestore/{angular-fire-compat-firestore.d.ts → index.d.ts} +0 -0
- /package/compat/functions/{angular-fire-compat-functions.d.ts → index.d.ts} +0 -0
- /package/compat/{angular-fire-compat.d.ts → index.d.ts} +0 -0
- /package/compat/messaging/{angular-fire-compat-messaging.d.ts → index.d.ts} +0 -0
- /package/compat/performance/{angular-fire-compat-performance.d.ts → index.d.ts} +0 -0
- /package/compat/remote-config/{angular-fire-compat-remote-config.d.ts → index.d.ts} +0 -0
- /package/compat/storage/{angular-fire-compat-storage.d.ts → index.d.ts} +0 -0
- /package/database/{angular-fire-database.d.ts → index.d.ts} +0 -0
- /package/{esm2015/analytics/analytics.js → esm2022/analytics/analytics.mjs} +0 -0
- /package/{esm2015/analytics/angular-fire-analytics.js → esm2022/analytics/angular-fire-analytics.mjs} +0 -0
- /package/{esm2015/analytics/firebase.js → esm2022/analytics/firebase.mjs} +0 -0
- /package/{esm2015/analytics/public_api.js → esm2022/analytics/public_api.mjs} +0 -0
- /package/{esm2015/angular-fire.js → esm2022/angular-fire.mjs} +0 -0
- /package/{esm2015/app/angular-fire-app.js → esm2022/app/angular-fire-app.mjs} +0 -0
- /package/{esm2015/app/app.js → esm2022/app/app.mjs} +0 -0
- /package/{esm2015/app/firebase.js → esm2022/app/firebase.mjs} +0 -0
- /package/{esm2015/app/public_api.js → esm2022/app/public_api.mjs} +0 -0
- /package/{esm2015/app-check/angular-fire-app-check.js → esm2022/app-check/angular-fire-app-check.mjs} +0 -0
- /package/{esm2015/app-check/firebase.js → esm2022/app-check/firebase.mjs} +0 -0
- /package/{esm2015/auth/angular-fire-auth.js → esm2022/auth/angular-fire-auth.mjs} +0 -0
- /package/{esm2015/auth/auth.js → esm2022/auth/auth.mjs} +0 -0
- /package/{esm2015/auth/firebase.js → esm2022/auth/firebase.mjs} +0 -0
- /package/{esm2015/auth/public_api.js → esm2022/auth/public_api.mjs} +0 -0
- /package/{esm2015/auth/rxfire.js → esm2022/auth/rxfire.mjs} +0 -0
- /package/{esm2015/auth-guard/angular-fire-auth-guard.js → esm2022/auth-guard/angular-fire-auth-guard.mjs} +0 -0
- /package/{esm2015/auth-guard/public_api.js → esm2022/auth-guard/public_api.mjs} +0 -0
- /package/{esm2015/compat/analytics/angular-fire-compat-analytics.js → esm2022/compat/analytics/angular-fire-compat-analytics.mjs} +0 -0
- /package/{esm2015/compat/analytics/base.js → esm2022/compat/analytics/base.mjs} +0 -0
- /package/{esm2015/compat/analytics/public_api.js → esm2022/compat/analytics/public_api.mjs} +0 -0
- /package/{esm2015/compat/angular-fire-compat.js → esm2022/compat/angular-fire-compat.mjs} +0 -0
- /package/{esm2015/compat/auth/angular-fire-compat-auth.js → esm2022/compat/auth/angular-fire-compat-auth.mjs} +0 -0
- /package/{esm2015/compat/auth/base.js → esm2022/compat/auth/base.mjs} +0 -0
- /package/{esm2015/compat/auth-guard/angular-fire-compat-auth-guard.js → esm2022/compat/auth-guard/angular-fire-compat-auth-guard.mjs} +0 -0
- /package/{esm2015/compat/auth-guard/public_api.js → esm2022/compat/auth-guard/public_api.mjs} +0 -0
- /package/{esm2015/compat/database/angular-fire-compat-database.js → esm2022/compat/database/angular-fire-compat-database.mjs} +0 -0
- /package/{esm2015/compat/database/interfaces.js → esm2022/compat/database/interfaces.mjs} +0 -0
- /package/{esm2015/compat/database/list/audit-trail.js → esm2022/compat/database/list/audit-trail.mjs} +0 -0
- /package/{esm2015/compat/database/list/changes.js → esm2022/compat/database/list/changes.mjs} +0 -0
- /package/{esm2015/compat/database/list/data-operation.js → esm2022/compat/database/list/data-operation.mjs} +0 -0
- /package/{esm2015/compat/database/list/remove.js → esm2022/compat/database/list/remove.mjs} +0 -0
- /package/{esm2015/compat/database/list/snapshot-changes.js → esm2022/compat/database/list/snapshot-changes.mjs} +0 -0
- /package/{esm2015/compat/database/list/state-changes.js → esm2022/compat/database/list/state-changes.mjs} +0 -0
- /package/{esm2015/compat/database/list/utils.js → esm2022/compat/database/list/utils.mjs} +0 -0
- /package/{esm2015/compat/database/object/create-reference.js → esm2022/compat/database/object/create-reference.mjs} +0 -0
- /package/{esm2015/compat/database/object/snapshot-changes.js → esm2022/compat/database/object/snapshot-changes.mjs} +0 -0
- /package/{esm2015/compat/database/observable/fromRef.js → esm2022/compat/database/observable/fromRef.mjs} +0 -0
- /package/{esm2015/compat/database/public_api.js → esm2022/compat/database/public_api.mjs} +0 -0
- /package/{esm2015/compat/database/utils.js → esm2022/compat/database/utils.mjs} +0 -0
- /package/{esm2015/compat/firebase.app.js → esm2022/compat/firebase.app.mjs} +0 -0
- /package/{esm2015/compat/firestore/angular-fire-compat-firestore.js → esm2022/compat/firestore/angular-fire-compat-firestore.mjs} +0 -0
- /package/{esm2015/compat/firestore/public_api.js → esm2022/compat/firestore/public_api.mjs} +0 -0
- /package/{esm2015/compat/functions/angular-fire-compat-functions.js → esm2022/compat/functions/angular-fire-compat-functions.mjs} +0 -0
- /package/{esm2015/compat/functions/base.js → esm2022/compat/functions/base.mjs} +0 -0
- /package/{esm2015/compat/messaging/angular-fire-compat-messaging.js → esm2022/compat/messaging/angular-fire-compat-messaging.mjs} +0 -0
- /package/{esm2015/compat/messaging/base.js → esm2022/compat/messaging/base.mjs} +0 -0
- /package/{esm2015/compat/messaging/public_api.js → esm2022/compat/messaging/public_api.mjs} +0 -0
- /package/{esm2015/compat/performance/angular-fire-compat-performance.js → esm2022/compat/performance/angular-fire-compat-performance.mjs} +0 -0
- /package/{esm2015/compat/performance/base.js → esm2022/compat/performance/base.mjs} +0 -0
- /package/{esm2015/compat/performance/public_api.js → esm2022/compat/performance/public_api.mjs} +0 -0
- /package/{esm2015/compat/public_api.js → esm2022/compat/public_api.mjs} +0 -0
- /package/{esm2015/compat/remote-config/angular-fire-compat-remote-config.js → esm2022/compat/remote-config/angular-fire-compat-remote-config.mjs} +0 -0
- /package/{esm2015/compat/remote-config/base.js → esm2022/compat/remote-config/base.mjs} +0 -0
- /package/{esm2015/compat/remote-config/interfaces.js → esm2022/compat/remote-config/interfaces.mjs} +0 -0
- /package/{esm2015/compat/remote-config/public_api.js → esm2022/compat/remote-config/public_api.mjs} +0 -0
- /package/{esm2015/compat/storage/angular-fire-compat-storage.js → esm2022/compat/storage/angular-fire-compat-storage.mjs} +0 -0
- /package/{esm2015/compat/storage/interfaces.js → esm2022/compat/storage/interfaces.mjs} +0 -0
- /package/{esm2015/compat/storage/observable/fromTask.js → esm2022/compat/storage/observable/fromTask.mjs} +0 -0
- /package/{esm2015/compat/storage/public_api.js → esm2022/compat/storage/public_api.mjs} +0 -0
- /package/{esm2015/compat/storage/ref.js → esm2022/compat/storage/ref.mjs} +0 -0
- /package/{esm2015/compat/storage/task.js → esm2022/compat/storage/task.mjs} +0 -0
- /package/{esm2015/database/angular-fire-database.js → esm2022/database/angular-fire-database.mjs} +0 -0
- /package/{esm2015/database/database.js → esm2022/database/database.mjs} +0 -0
- /package/{esm2015/database/firebase.js → esm2022/database/firebase.mjs} +0 -0
- /package/{esm2015/database/public_api.js → esm2022/database/public_api.mjs} +0 -0
- /package/{esm2015/database/rxfire.js → esm2022/database/rxfire.mjs} +0 -0
- /package/{esm2015/firestore/angular-fire-firestore.js → esm2022/firestore/angular-fire-firestore.mjs} +0 -0
- /package/{esm2015/firestore/firebase.js → esm2022/firestore/firebase.mjs} +0 -0
- /package/{esm2015/firestore/firestore.js → esm2022/firestore/firestore.mjs} +0 -0
- /package/{esm2015/firestore/lite/angular-fire-firestore-lite.js → esm2022/firestore/lite/angular-fire-firestore-lite.mjs} +0 -0
- /package/{esm2015/firestore/lite/firebase.js → esm2022/firestore/lite/firebase.mjs} +0 -0
- /package/{esm2015/firestore/lite/lite.js → esm2022/firestore/lite/lite.mjs} +0 -0
- /package/{esm2015/firestore/lite/public_api.js → esm2022/firestore/lite/public_api.mjs} +0 -0
- /package/{esm2015/firestore/lite/rxfire.js → esm2022/firestore/lite/rxfire.mjs} +0 -0
- /package/{esm2015/firestore/public_api.js → esm2022/firestore/public_api.mjs} +0 -0
- /package/{esm2015/functions/angular-fire-functions.js → esm2022/functions/angular-fire-functions.mjs} +0 -0
- /package/{esm2015/functions/firebase.js → esm2022/functions/firebase.mjs} +0 -0
- /package/{esm2015/functions/functions.js → esm2022/functions/functions.mjs} +0 -0
- /package/{esm2015/functions/public_api.js → esm2022/functions/public_api.mjs} +0 -0
- /package/{esm2015/functions/rxfire.js → esm2022/functions/rxfire.mjs} +0 -0
- /package/{esm2015/messaging/angular-fire-messaging.js → esm2022/messaging/angular-fire-messaging.mjs} +0 -0
- /package/{esm2015/messaging/firebase.js → esm2022/messaging/firebase.mjs} +0 -0
- /package/{esm2015/messaging/messaging.js → esm2022/messaging/messaging.mjs} +0 -0
- /package/{esm2015/messaging/public_api.js → esm2022/messaging/public_api.mjs} +0 -0
- /package/{esm2015/performance/angular-fire-performance.js → esm2022/performance/angular-fire-performance.mjs} +0 -0
- /package/{esm2015/performance/firebase.js → esm2022/performance/firebase.mjs} +0 -0
- /package/{esm2015/performance/performance.js → esm2022/performance/performance.mjs} +0 -0
- /package/{esm2015/performance/public_api.js → esm2022/performance/public_api.mjs} +0 -0
- /package/{esm2015/performance/rxfire.js → esm2022/performance/rxfire.mjs} +0 -0
- /package/{esm2015/public_api.js → esm2022/public_api.mjs} +0 -0
- /package/{esm2015/remote-config/angular-fire-remote-config.js → esm2022/remote-config/angular-fire-remote-config.mjs} +0 -0
- /package/{esm2015/remote-config/firebase.js → esm2022/remote-config/firebase.mjs} +0 -0
- /package/{esm2015/remote-config/public_api.js → esm2022/remote-config/public_api.mjs} +0 -0
- /package/{esm2015/remote-config/remote-config.js → esm2022/remote-config/remote-config.mjs} +0 -0
- /package/{esm2015/remote-config/rxfire.js → esm2022/remote-config/rxfire.mjs} +0 -0
- /package/{esm2015/storage/angular-fire-storage.js → esm2022/storage/angular-fire-storage.mjs} +0 -0
- /package/{esm2015/storage/firebase.js → esm2022/storage/firebase.mjs} +0 -0
- /package/{esm2015/storage/public_api.js → esm2022/storage/public_api.mjs} +0 -0
- /package/{esm2015/storage/rxfire.js → esm2022/storage/rxfire.mjs} +0 -0
- /package/{esm2015/storage/storage.js → esm2022/storage/storage.mjs} +0 -0
- /package/firestore/{angular-fire-firestore.d.ts → index.d.ts} +0 -0
- /package/firestore/lite/{angular-fire-firestore-lite.d.ts → index.d.ts} +0 -0
- /package/functions/{angular-fire-functions.d.ts → index.d.ts} +0 -0
- /package/{angular-fire.d.ts → index.d.ts} +0 -0
- /package/messaging/{angular-fire-messaging.d.ts → index.d.ts} +0 -0
- /package/performance/{angular-fire-performance.d.ts → index.d.ts} +0 -0
- /package/remote-config/{angular-fire-remote-config.d.ts → index.d.ts} +0 -0
- /package/storage/{angular-fire-storage.d.ts → index.d.ts} +0 -0
package/docs/auth.md
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
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 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
|
-
```
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
# Getting started with Google Analytics
|
|
2
|
-
|
|
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
|
-
|
|
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
|
-
|
|
7
|
-
### API:
|
|
8
|
-
|
|
9
|
-
```ts
|
|
10
|
-
class AngularFireAnalytics {
|
|
11
|
-
updateConfig(options: {[key:string]: any}): Promise<void>;
|
|
12
|
-
|
|
13
|
-
// from firebase.analytics() proxy:
|
|
14
|
-
logEvent(eventName: string, eventParams?: {[key: string]: any}, options?: analytics.AnalyticsCallOptions): Promise<void>;
|
|
15
|
-
setCurrentScreen(screenName: string, options?: analytics.AnalyticsCallOptions): Promise<void>;
|
|
16
|
-
setUserId(id: string, options?: analytics.AnalyticsCallOptions): Promise<void>;
|
|
17
|
-
setUserProperties(properties: analytics.CustomParams, options?: analytics.AnalyticsCallOptions): Promise<void>;
|
|
18
|
-
setAnalyticsCollectionEnabled(enabled: boolean): Promise<void>;
|
|
19
|
-
app: Promise<app.App>;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
COLLECTION_ENABLED = InjectionToken<boolean>;
|
|
23
|
-
APP_VERSION = InjectionToken<string>;
|
|
24
|
-
APP_NAME = InjectionToken<string>;
|
|
25
|
-
DEBUG_MODE = InjectionToken<boolean>;
|
|
26
|
-
CONFIG = InjectionToken<Config>;
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
### Usage:
|
|
30
|
-
|
|
31
|
-
```ts
|
|
32
|
-
import { AngularFireAnalyticsModule } from '@angular/fire/compat/analytics';
|
|
33
|
-
|
|
34
|
-
@NgModule({
|
|
35
|
-
imports: [
|
|
36
|
-
AngularFireModule.initializeApp(environment.firebase),
|
|
37
|
-
AngularFireAnalyticsModule
|
|
38
|
-
]
|
|
39
|
-
})
|
|
40
|
-
export class AppModule { }
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
`AngularFireAnalyticsModule` will dynamically import and configure `firebase/analytics`. A `page_view` event will automatically be logged (see `CONFIG` below if you wish to disable this behavior.)
|
|
44
|
-
|
|
45
|
-
In your component you can then dependency inject `AngularFireAnalytics` and make calls against the SDK:
|
|
46
|
-
|
|
47
|
-
```ts
|
|
48
|
-
import { AngularFireAnalytics } from '@angular/fire/compat/analytics';
|
|
49
|
-
|
|
50
|
-
constructor(analytics: AngularFireAnalytics) {
|
|
51
|
-
analytics.logEvent('custom_event', { ... });
|
|
52
|
-
}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## Tracking Screen Views
|
|
56
|
-
|
|
57
|
-
You can log [`screen_view` events](https://firebase.google.com/docs/reference/js/firebase.analytics.Analytics.html#parameters_10) yourself of course, but AngularFire provides the `ScreenTrackingService` which automatically integrates with the Angular Router to provide Firebase with screen view tracking. You simply can integrate like so:
|
|
58
|
-
|
|
59
|
-
```ts
|
|
60
|
-
import { AngularFireAnalyticsModule, ScreenTrackingService } from '@angular/fire/compat/analytics';
|
|
61
|
-
|
|
62
|
-
@NgModule({
|
|
63
|
-
imports: [
|
|
64
|
-
AngularFireModule.initializeApp(environment.firebase),
|
|
65
|
-
AngularFireAnalyticsModule
|
|
66
|
-
],
|
|
67
|
-
providers: [
|
|
68
|
-
ScreenTrackingService
|
|
69
|
-
]
|
|
70
|
-
})
|
|
71
|
-
export class AppModule { }
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
`AngularFireAnalyticsModule` will initialize `ScreenTrackingService` if it is provided.
|
|
75
|
-
|
|
76
|
-
## Tracking User Identifiers
|
|
77
|
-
|
|
78
|
-
To enrich your Analytics data you can track the currently signed in user by setting [`setuserid`](https://firebase.google.com/docs/reference/js/firebase.analytics.Analytics.html#setuserid) and [`setUserProperties`](https://firebase.google.com/docs/reference/js/firebase.analytics.Analytics.html#set-user-properties). AngularFire provides a `UserTrackingService` which will dynamically import `firebase/auth`, monitor for changes in the logged in user, and call `setuserid` for you automatically.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
```ts
|
|
82
|
-
import { AngularFireAnalyticsModule, UserTrackingService } from '@angular/fire/compat/analytics';
|
|
83
|
-
|
|
84
|
-
@NgModule({
|
|
85
|
-
imports: [
|
|
86
|
-
AngularFireModule.initializeApp(environment.firebase),
|
|
87
|
-
AngularFireAnalyticsModule
|
|
88
|
-
],
|
|
89
|
-
providers: [
|
|
90
|
-
UserTrackingService
|
|
91
|
-
]
|
|
92
|
-
})
|
|
93
|
-
export class AppModule { }
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
`AngularFireAnalyticsModule` will initialize `UserTrackingService` if it is provided.
|
|
97
|
-
|
|
98
|
-
## Configuration with Dependency Injection
|
|
99
|
-
|
|
100
|
-
### Configure Google Analtyics with `CONFIG`
|
|
101
|
-
|
|
102
|
-
Using the `CONFIG` DI Token (*default: {}*) will allow you to configure Google Analytics. E.g, you could skip sending the initial `page_view` event, anonymize IP addresses, and disallow ads personalization signals for all events like so:
|
|
103
|
-
|
|
104
|
-
```ts
|
|
105
|
-
import { AngularFireAnalyticsModule, CONFIG } from '@angular/fire/compat/analytics';
|
|
106
|
-
|
|
107
|
-
@NgModule({
|
|
108
|
-
imports: [
|
|
109
|
-
AngularFireModule.initializeApp(environment.firebase),
|
|
110
|
-
AngularFireAnalyticsModule
|
|
111
|
-
],
|
|
112
|
-
providers: [
|
|
113
|
-
{ provide: CONFIG, useValue: {
|
|
114
|
-
send_page_view: false,
|
|
115
|
-
allow_ad_personalization_signals: false,
|
|
116
|
-
anonymize_ip: true
|
|
117
|
-
} }
|
|
118
|
-
]
|
|
119
|
-
})
|
|
120
|
-
export class AppModule { }
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
See the gtag.js documentation to learn of the different configuration options at your disposal.
|
|
124
|
-
|
|
125
|
-
### Use DebugView `DEBUG_MODE`
|
|
126
|
-
|
|
127
|
-
To use [DebugView in Analytics](https://console.firebase.google.com/project/_/analytics/debugview) set `DEBUG_MODE` to `true` (*default: false*).
|
|
128
|
-
|
|
129
|
-
### Track deployments with `APP_NAME` and `APP_VERSION`
|
|
130
|
-
|
|
131
|
-
If you provide `APP_NAME` and `APP_VERSION` (*default: undefined*) you will be able to [track version adoption](https://console.firebase.google.com/project/_/analytics/latestrelease) of your PWA.
|
|
132
|
-
|
|
133
|
-
### Disable analytics collection via `COLLECTION_ENABLED`
|
|
134
|
-
|
|
135
|
-
If you set `COLLECTION_ENABLED` (*default: true*) to `false` then analytics collection will be disabled for this app on this device. To opt back in to analytics collection you could then call `setAnalyticsCollectionEnabled(true)`.
|
|
136
|
-
|
|
137
|
-
Putting these APIs to use with cookies would allow you to create a flexible analytics collection scheme that would respect your user's desire for privacy.
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
# 5. Getting started with Firebase Authentication
|
|
2
|
-
|
|
3
|
-
`AngularFireAuth.user` provides you an `Observable<User|null>` to monitor your application's authentication State.
|
|
4
|
-
|
|
5
|
-
`AngularFireAuth` promise proxies an initialized
|
|
6
|
-
`firebase.auth.Auth` instance, allowing you to log users in, out, etc. [See
|
|
7
|
-
the Firebase docs for more information on what methods are available.](https://firebase.google.com/docs/reference/js/firebase.auth.Auth)
|
|
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
|
-
|
|
11
|
-
**Example app:**
|
|
12
|
-
|
|
13
|
-
```ts
|
|
14
|
-
import { Component } from '@angular/core';
|
|
15
|
-
import { AngularFireAuth } from '@angular/fire/compat/auth';
|
|
16
|
-
import firebase from 'firebase/compat/app';
|
|
17
|
-
|
|
18
|
-
@Component({
|
|
19
|
-
selector: 'app-root',
|
|
20
|
-
template: `
|
|
21
|
-
<div *ngIf="auth.user | async as user; else showLogin">
|
|
22
|
-
<h1>Hello {{ user.displayName }}!</h1>
|
|
23
|
-
<button (click)="logout()">Logout</button>
|
|
24
|
-
</div>
|
|
25
|
-
<ng-template #showLogin>
|
|
26
|
-
<p>Please login.</p>
|
|
27
|
-
<button (click)="login()">Login with Google</button>
|
|
28
|
-
</ng-template>
|
|
29
|
-
`,
|
|
30
|
-
})
|
|
31
|
-
export class AppComponent {
|
|
32
|
-
constructor(public auth: AngularFireAuth) {
|
|
33
|
-
}
|
|
34
|
-
login() {
|
|
35
|
-
this.auth.signInWithPopup(new firebase.auth.GoogleAuthProvider());
|
|
36
|
-
}
|
|
37
|
-
logout() {
|
|
38
|
-
this.auth.signOut();
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## Configuration with Dependency Injection
|
|
44
|
-
|
|
45
|
-
The AngularFireAuth Module provides several DI tokens to further configure your
|
|
46
|
-
authentication process.
|
|
47
|
-
|
|
48
|
-
### Configure
|
|
49
|
-
|
|
50
|
-
Using the `SETTINGS` DI Token (*default: null*), we can set the current Auth
|
|
51
|
-
instance's settings. This is used to edit/read configuration related options
|
|
52
|
-
like app verification mode for phone authentication, which is useful for
|
|
53
|
-
[testing](https://cloud.google.com/identity-platform/docs/test-phone-numbers).
|
|
54
|
-
|
|
55
|
-
```ts
|
|
56
|
-
import { SETTINGS as AUTH_SETTINGS } from '@angular/fire/compat/auth';
|
|
57
|
-
|
|
58
|
-
@NgModule({
|
|
59
|
-
// ... Existing configuration
|
|
60
|
-
providers: [
|
|
61
|
-
// ... Existing Providers
|
|
62
|
-
{ provide: AUTH_SETTINGS, useValue: { appVerificationDisabledForTesting: true } },
|
|
63
|
-
]
|
|
64
|
-
})
|
|
65
|
-
export class AppModule { }
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
Read more at [Firebase Auth Settings](https://firebase.google.com/docs/reference/js/firebase.auth.AuthSettings).
|
|
69
|
-
|
|
70
|
-
### Use Current Browser Language
|
|
71
|
-
|
|
72
|
-
Using the `USE_DEVICE_LANGUAGE` DI Token (*default: null*), which is a boolean
|
|
73
|
-
that allow you to set the current language to the default device/browser
|
|
74
|
-
preference. This allows to localize emails but be aware that this only applies
|
|
75
|
-
if you use the standard template provided by Firebase.
|
|
76
|
-
|
|
77
|
-
```ts
|
|
78
|
-
import { USE_DEVICE_LANGUAGE } from '@angular/fire/compat/auth';
|
|
79
|
-
|
|
80
|
-
@NgModule({
|
|
81
|
-
// ... Existing configuration
|
|
82
|
-
providers: [
|
|
83
|
-
// ... Existing Providers
|
|
84
|
-
{ provide: USE_DEVICE_LANGUAGE, useValue: true },
|
|
85
|
-
]
|
|
86
|
-
})
|
|
87
|
-
export class AppModule { }
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
If you want to set a different language, you can use `LANGUAGE_CODE` DI Token
|
|
91
|
-
(*default: null*).
|
|
92
|
-
|
|
93
|
-
More info at the [firebase auth docs](https://firebase.google.com/docs/reference/js/firebase.auth.Auth#languagecode).
|
|
94
|
-
|
|
95
|
-
```ts
|
|
96
|
-
import { LANGUAGE_CODE } from '@angular/fire/compat/auth';
|
|
97
|
-
|
|
98
|
-
@NgModule({
|
|
99
|
-
// ... Existing configuration
|
|
100
|
-
providers: [
|
|
101
|
-
// ... Existing Providers
|
|
102
|
-
{ provide: LANGUAGE_CODE, useValue: 'fr' },
|
|
103
|
-
]
|
|
104
|
-
})
|
|
105
|
-
export class AppModule { }
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
### Persistence
|
|
109
|
-
|
|
110
|
-
Firebase Auth default behavior is to persist a user's session even after the
|
|
111
|
-
user closes the browser. To change the current type of persistence on the
|
|
112
|
-
current Auth instance for the currently saved Auth session and apply this type
|
|
113
|
-
of persistence for future sign-in requests, including sign-in with redirect
|
|
114
|
-
requests, you can use the `PERSISTENCE` DI Token (*default: null*).
|
|
115
|
-
|
|
116
|
-
The possible types are `'local'`, `'session'` or `'none'`. Read more at
|
|
117
|
-
[authentication state persistence](https://firebase.google.com/docs/auth/web/auth-state-persistence).
|
|
118
|
-
|
|
119
|
-
```ts
|
|
120
|
-
import { PERSISTENCE } from '@angular/fire/compat/auth';
|
|
121
|
-
|
|
122
|
-
@NgModule({
|
|
123
|
-
// ... Existing configuration
|
|
124
|
-
providers: [
|
|
125
|
-
// ... Existing Providers
|
|
126
|
-
{ provide: PERSISTENCE, useValue: 'session' },
|
|
127
|
-
]
|
|
128
|
-
})
|
|
129
|
-
export class AppModule { }
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
### Tenant
|
|
133
|
-
|
|
134
|
-
If you need to use multi-tenancy, you can set the current Auth instance's tenant
|
|
135
|
-
ID using `TENANT_ID` DI Token (*default: null*).
|
|
136
|
-
|
|
137
|
-
More tutorials regarding this topic are _coming soon_.
|
|
138
|
-
|
|
139
|
-
```ts
|
|
140
|
-
import { TENANT_ID } from '@angular/fire/compat/auth';
|
|
141
|
-
|
|
142
|
-
@NgModule({
|
|
143
|
-
// ... Existing configuration
|
|
144
|
-
providers: [
|
|
145
|
-
// ... Existing Providers
|
|
146
|
-
{ provide: TENANT_ID, useValue: 'tenant-id-app-one' },
|
|
147
|
-
]
|
|
148
|
-
})
|
|
149
|
-
export class AppModule { }
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
- [Multi-Tenancy Authentication](https://cloud.google.com/identity-platform/docs/multi-tenancy-authentication)
|
|
153
|
-
- [Firebase Auth Tenant](https://firebase.google.com/docs/reference/js/firebase.auth.Auth#tenantid)
|
|
154
|
-
|
|
155
|
-
## UI Libraries
|
|
156
|
-
|
|
157
|
-
- Material Design : [ngx-auth-firebaseui](https://github.com/AnthonyNahas/ngx-auth-firebaseui)
|
|
158
|
-
- Bootstrap : [@firebaseui/ng-bootstrap](https://github.com/firebaseui/ng-bootstrap)
|
|
159
|
-
|
|
160
|
-
## Cordova
|
|
161
|
-
|
|
162
|
-
Learn how to [setup Firebase Authentication with Cordova](https://firebase.google.com/docs/auth/web/cordova) in the Firebase Guides.
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
# Route users with AngularFire guards
|
|
2
|
-
|
|
3
|
-
`AngularFireAuthGuard` provides a prebuilt [`canActivate` Router Guard](https://angular.io/api/router/CanActivate) using `AngularFireAuth`. By default unauthenticated users are not permitted to navigate to protected routes:
|
|
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
|
-
|
|
7
|
-
```ts
|
|
8
|
-
import { AngularFireAuthGuard } from '@angular/fire/compat/auth-guard';
|
|
9
|
-
|
|
10
|
-
export const routes: Routes = [
|
|
11
|
-
{ path: '', component: AppComponent },
|
|
12
|
-
{ path: 'items', component: ItemListComponent, canActivate: [AngularFireAuthGuard] },
|
|
13
|
-
]
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Customizing the behavior of `AngularFireAuthGuard`
|
|
17
|
-
|
|
18
|
-
To customize the behavior of `AngularFireAuthGuard`, you can pass an RXJS pipe through the route data's `authGuardPipe` key.
|
|
19
|
-
|
|
20
|
-
The `auth-guard` module provides the following pre-built pipes:
|
|
21
|
-
|
|
22
|
-
| Exported pipe | Functionality |
|
|
23
|
-
|-|-|
|
|
24
|
-
| `loggedIn` | The default pipe, rejects if the user is not authenticated. |
|
|
25
|
-
| `isNotAnonymous` | Rejects if the user is anonymous |
|
|
26
|
-
| `emailVerified` | Rejects if the user's email is not verified |
|
|
27
|
-
| `hasCustomClaim(claim)` | Rejects if the user does not have the specified claim |
|
|
28
|
-
| `redirectUnauthorizedTo(redirect)` | Redirect unauthenticated users to a different route |
|
|
29
|
-
| `redirectLoggedInTo(redirect)` | Redirect authenticated users to a different route |
|
|
30
|
-
|
|
31
|
-
Example use:
|
|
32
|
-
|
|
33
|
-
```ts
|
|
34
|
-
import { AngularFireAuthGuard, hasCustomClaim, redirectUnauthorizedTo, redirectLoggedInTo } from '@angular/fire/compat/auth-guard';
|
|
35
|
-
|
|
36
|
-
const adminOnly = () => hasCustomClaim('admin');
|
|
37
|
-
const redirectUnauthorizedToLogin = () => redirectUnauthorizedTo(['login']);
|
|
38
|
-
const redirectLoggedInToItems = () => redirectLoggedInTo(['items']);
|
|
39
|
-
const belongsToAccount = (next) => hasCustomClaim(`account-${next.params.id}`);
|
|
40
|
-
|
|
41
|
-
export const routes: Routes = [
|
|
42
|
-
{ path: '', component: AppComponent },
|
|
43
|
-
{ path: 'login', component: LoginComponent, canActivate: [AngularFireAuthGuard], data: { authGuardPipe: redirectLoggedInToItems }},
|
|
44
|
-
{ path: 'items', component: ItemListComponent, canActivate: [AngularFireAuthGuard], data: { authGuardPipe: redirectUnauthorizedToLogin }},
|
|
45
|
-
{ path: 'admin', component: AdminComponent, canActivate: [AngularFireAuthGuard], data: { authGuardPipe: adminOnly }},
|
|
46
|
-
{ path: 'accounts/:id', component: AdminComponent, canActivate: [AngularFireAuthGuard], data: { authGuardPipe: belongsToAccount }}
|
|
47
|
-
];
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
Use the provided `canActivate` helper and spread syntax to make your routes more readable:
|
|
51
|
-
|
|
52
|
-
```ts
|
|
53
|
-
import { canActivate } from '@angular/fire/compat/auth-guard';
|
|
54
|
-
|
|
55
|
-
export const routes: Routes = [
|
|
56
|
-
{ path: '', component: AppComponent },
|
|
57
|
-
{ path: 'login', component: LoginComponent, ...canActivate(redirectLoggedInToItems) },
|
|
58
|
-
{ path: 'items', component: ItemListComponent, ...canActivate(redirectUnauthorizedToLogin) },
|
|
59
|
-
{ path: 'admin', component: AdminComponent, ...canActivate(adminOnly) },
|
|
60
|
-
{ path: 'accounts/:id', component: AdminComponent, ...canActivate(belongsToAccount) }
|
|
61
|
-
];
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
### Compose your own pipes
|
|
65
|
-
|
|
66
|
-
`AngularFireAuthGuard` pipes are RXJS operators which transform an optional User to a boolean or Array (for redirects). You can easily build your own to customize behavior further:
|
|
67
|
-
|
|
68
|
-
```ts
|
|
69
|
-
import { map } from 'rxjs/operators';
|
|
70
|
-
|
|
71
|
-
// This pipe redirects a user to their "profile edit" page or the "login page" if they're unauthenticated
|
|
72
|
-
// { path: 'profile', ...canActivate(redirectToProfileEditOrLogin) }
|
|
73
|
-
const redirectToProfileEditOrLogin = () => map(user => user ? ['profiles', user.uid, 'edit'] : ['login']);
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
The `auth-guard` modules provides a `customClaims` operator to reduce boiler plate when checking a user's claims:
|
|
77
|
-
|
|
78
|
-
```ts
|
|
79
|
-
import { pipe } from 'rxjs';
|
|
80
|
-
import { map } from 'rxjs/operators';
|
|
81
|
-
import { customClaims } from '@angular/fire/compat/auth-guard';
|
|
82
|
-
|
|
83
|
-
// This pipe will only allow users with the editor role to access the route
|
|
84
|
-
// { path: 'articles/:id/edit', component: ArticleEditComponent, ...canActivate(editorOnly) }
|
|
85
|
-
const editorOnly = () => pipe(customClaims, map(claims => claims.role === 'editor'));
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
### Using router state
|
|
89
|
-
|
|
90
|
-
`AngularFireAuthGuard` will also accept `AuthPipeGenerator`s which generate `AuthPipe`s given the router state:
|
|
91
|
-
|
|
92
|
-
```ts
|
|
93
|
-
import { pipe } from 'rxjs';
|
|
94
|
-
import { map } from 'rxjs/operators';
|
|
95
|
-
import { customClaims } from '@angular/fire/compat/auth-guard';
|
|
96
|
-
|
|
97
|
-
// Only allow navigation to the route if :userId matches the authenticated user's uid
|
|
98
|
-
// { path: 'user/:userId/edit', component: ProfileEditComponent, ...canActivate(onlyAllowSelf) }
|
|
99
|
-
const onlyAllowSelf = (next) => map(user => !!user && next.params.userId === user.uid);
|
|
100
|
-
|
|
101
|
-
// Only allow navigation to the route if the user has a custom claim matching :accountId
|
|
102
|
-
// { path: 'accounts/:accountId/billing', component: BillingDetailsComponent, ...canActivate(accountAdmin) }
|
|
103
|
-
const accountAdmin = (next) => pipe(customClaims, map(claims => claims[`account-${next.params.accountId}-role`] === 'admin'));
|
|
104
|
-
```
|