ngx-firebase 1.1.13 → 22.0.1
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 +121 -13
- package/fesm2022/ngx-firebase.mjs +158 -0
- package/fesm2022/ngx-firebase.mjs.map +1 -0
- package/package.json +39 -30
- package/types/ngx-firebase.d.ts +55 -0
- package/bundles/ngx-firebase-capacitor.umd.js +0 -763
- package/bundles/ngx-firebase-capacitor.umd.js.map +0 -1
- package/bundles/ngx-firebase-capacitor.umd.min.js +0 -16
- package/bundles/ngx-firebase-capacitor.umd.min.js.map +0 -1
- package/bundles/ngx-firebase-iap.umd.js +0 -718
- package/bundles/ngx-firebase-iap.umd.js.map +0 -1
- package/bundles/ngx-firebase-iap.umd.min.js +0 -2
- package/bundles/ngx-firebase-iap.umd.min.js.map +0 -1
- package/bundles/ngx-firebase-ionic-auth-ui.umd.js +0 -2116
- package/bundles/ngx-firebase-ionic-auth-ui.umd.js.map +0 -1
- package/bundles/ngx-firebase-ionic-auth-ui.umd.min.js +0 -16
- package/bundles/ngx-firebase-ionic-auth-ui.umd.min.js.map +0 -1
- package/bundles/ngx-firebase-ionic.umd.js +0 -979
- package/bundles/ngx-firebase-ionic.umd.js.map +0 -1
- package/bundles/ngx-firebase-ionic.umd.min.js +0 -16
- package/bundles/ngx-firebase-ionic.umd.min.js.map +0 -1
- package/bundles/ngx-firebase-testing.umd.js +0 -801
- package/bundles/ngx-firebase-testing.umd.js.map +0 -1
- package/bundles/ngx-firebase-testing.umd.min.js +0 -2
- package/bundles/ngx-firebase-testing.umd.min.js.map +0 -1
- package/bundles/ngx-firebase.umd.js +0 -2299
- package/bundles/ngx-firebase.umd.js.map +0 -1
- package/bundles/ngx-firebase.umd.min.js +0 -2
- package/bundles/ngx-firebase.umd.min.js.map +0 -1
- package/capacitor/capacitor.module.d.ts +0 -9
- package/capacitor/interfaces/config.d.ts +0 -12
- package/capacitor/interfaces/index.d.ts +0 -1
- package/capacitor/ngx-firebase-capacitor.d.ts +0 -5
- package/capacitor/ngx-firebase-capacitor.metadata.json +0 -1
- package/capacitor/package.json +0 -25
- package/capacitor/public-api.d.ts +0 -3
- package/capacitor/services/analytics-firebase-capacitor.service.d.ts +0 -9
- package/capacitor/services/crashlytics-firebase-capacitor.service.d.ts +0 -8
- package/capacitor/services/credential-factory-capacitor.service.d.ts +0 -18
- package/capacitor/services/index.d.ts +0 -3
- package/esm2015/capacitor/capacitor.module.js +0 -78
- package/esm2015/capacitor/interfaces/config.js +0 -3
- package/esm2015/capacitor/interfaces/index.js +0 -2
- package/esm2015/capacitor/ngx-firebase-capacitor.js +0 -6
- package/esm2015/capacitor/public-api.js +0 -4
- package/esm2015/capacitor/services/analytics-firebase-capacitor.service.js +0 -43
- package/esm2015/capacitor/services/crashlytics-firebase-capacitor.service.js +0 -40
- package/esm2015/capacitor/services/credential-factory-capacitor.service.js +0 -182
- package/esm2015/capacitor/services/index.js +0 -4
- package/esm2015/iap/iap.module.js +0 -32
- package/esm2015/iap/interfaces/index.js +0 -5
- package/esm2015/iap/ngx-firebase-iap.js +0 -5
- package/esm2015/iap/public-api.js +0 -5
- package/esm2015/iap/services/iap.service.js +0 -317
- package/esm2015/iap/tokens/index.js +0 -4
- package/esm2015/ionic/animations/index.js +0 -30
- package/esm2015/ionic/components/avatar/avatar.component.js +0 -98
- package/esm2015/ionic/components/avatar/index.js +0 -2
- package/esm2015/ionic/components/index.js +0 -3
- package/esm2015/ionic/components/popover-menu/index.js +0 -3
- package/esm2015/ionic/components/popover-menu/interface.js +0 -2
- package/esm2015/ionic/components/popover-menu/popover-menu.component.js +0 -34
- package/esm2015/ionic/ionic.module.js +0 -46
- package/esm2015/ionic/ngx-firebase-ionic.js +0 -5
- package/esm2015/ionic/public-api.js +0 -5
- package/esm2015/ionic/services/alerts-ionic.service.js +0 -107
- package/esm2015/ionic/services/index.js +0 -6
- package/esm2015/ionic/services/legality-dialog-ionic.service.js +0 -85
- package/esm2015/ionic/services/loading-ionic.service.js +0 -46
- package/esm2015/ionic/services/picker-ionic.service.js +0 -44
- package/esm2015/ionic/services/toast-ionic.service.js +0 -49
- package/esm2015/ionic-auth-ui/animations/index.js +0 -30
- package/esm2015/ionic-auth-ui/components/email-confirmation/email-confirmation.component.js +0 -99
- package/esm2015/ionic-auth-ui/components/email-field/email-field.component.js +0 -25
- package/esm2015/ionic-auth-ui/components/form-field/form-field.component.js +0 -82
- package/esm2015/ionic-auth-ui/components/index.js +0 -12
- package/esm2015/ionic-auth-ui/components/name-field/name-field.component.js +0 -30
- package/esm2015/ionic-auth-ui/components/or-divider/or-divider.component.js +0 -11
- package/esm2015/ionic-auth-ui/components/password-field/password-field.component.js +0 -138
- package/esm2015/ionic-auth-ui/components/password-field/passwordValidatorFunctions.js +0 -62
- package/esm2015/ionic-auth-ui/components/providers/providers.component.js +0 -70
- package/esm2015/ionic-auth-ui/components/reauthenticate/reauthenticate.component.js +0 -99
- package/esm2015/ionic-auth-ui/components/register/register.component.js +0 -142
- package/esm2015/ionic-auth-ui/components/register-with-email/register-with-email.component.js +0 -60
- package/esm2015/ionic-auth-ui/components/register-with-email-popover/register-with-email-popover.component.js +0 -26
- package/esm2015/ionic-auth-ui/components/signin/signin.component.js +0 -92
- package/esm2015/ionic-auth-ui/components/terms-field/terms-field.component.js +0 -99
- package/esm2015/ionic-auth-ui/components/user/user.component.js +0 -195
- package/esm2015/ionic-auth-ui/ionic-auth-ui.module.js +0 -92
- package/esm2015/ionic-auth-ui/ngx-firebase-ionic-auth-ui.js +0 -23
- package/esm2015/ionic-auth-ui/pages/index.js +0 -5
- package/esm2015/ionic-auth-ui/pages/register/index.js +0 -2
- package/esm2015/ionic-auth-ui/pages/register/register.page.js +0 -56
- package/esm2015/ionic-auth-ui/pages/signin/index.js +0 -2
- package/esm2015/ionic-auth-ui/pages/signin/signin.page.js +0 -78
- package/esm2015/ionic-auth-ui/pages/user/index.js +0 -2
- package/esm2015/ionic-auth-ui/pages/user/user.page.js +0 -11
- package/esm2015/ionic-auth-ui/pages/verifyemail/index.js +0 -2
- package/esm2015/ionic-auth-ui/pages/verifyemail/verifyemail.page.js +0 -85
- package/esm2015/ionic-auth-ui/public-api.js +0 -5
- package/esm2015/ngx-firebase.js +0 -6
- package/esm2015/public-api.js +0 -6
- package/esm2015/shared/guards/index.js +0 -3
- package/esm2015/shared/guards/logged-in.guard.js +0 -60
- package/esm2015/shared/guards/verify-email.guard.js +0 -41
- package/esm2015/shared/interfaces/accounts.enum.js +0 -9
- package/esm2015/shared/interfaces/authprovider.enum.js +0 -15
- package/esm2015/shared/interfaces/config.interface.js +0 -61
- package/esm2015/shared/interfaces/index.js +0 -8
- package/esm2015/shared/interfaces/main.interface.js +0 -7
- package/esm2015/shared/interfaces/providers.interface.js +0 -2
- package/esm2015/shared/interfaces/tokens.js +0 -19
- package/esm2015/shared/interfaces/ui-providers.interface.js +0 -2
- package/esm2015/shared/services/analytics.service.js +0 -24
- package/esm2015/shared/services/auth-process.service.js +0 -779
- package/esm2015/shared/services/crashlytics.service.js +0 -42
- package/esm2015/shared/services/device-info.service.js +0 -14
- package/esm2015/shared/services/firebase.service.js +0 -37
- package/esm2015/shared/services/firestore-sync.service.js +0 -60
- package/esm2015/shared/services/index.js +0 -10
- package/esm2015/shared/services/performance.service.js +0 -28
- package/esm2015/shared/services/remoteconfig.service.js +0 -49
- package/esm2015/shared/services/ui.service.js +0 -45
- package/esm2015/shared/shared.module.js +0 -175
- package/esm2015/shared/types/DisplayWidth.js +0 -9
- package/esm2015/shared/types/Location.js +0 -2
- package/esm2015/shared/types/ValueAccessorControlComponent.js +0 -85
- package/esm2015/shared/types/ValueAccessorValueComponent.js +0 -40
- package/esm2015/shared/types/index.js +0 -5
- package/esm2015/testing/fakeavatar.module.js +0 -22
- package/esm2015/testing/fakes/FakeAuthProcessService.js +0 -31
- package/esm2015/testing/fakes/FakeAvatarComponent.js +0 -13
- package/esm2015/testing/fakes/FakeFireService.js +0 -21
- package/esm2015/testing/fakes/FakeFirestoreSyncService.js +0 -11
- package/esm2015/testing/fakes/FakeIAPurchaseService.js +0 -11
- package/esm2015/testing/fakes/FakePickerService.js +0 -9
- package/esm2015/testing/fakes/FakeRemoteConfigService.js +0 -44
- package/esm2015/testing/fakes/FakeTranslateService.js +0 -21
- package/esm2015/testing/fakes/FakeUiService.js +0 -26
- package/esm2015/testing/fakes/angular-fire/FakeAngularFireAuth.js +0 -30
- package/esm2015/testing/fakes/angular-fire/FakeAngularFireFunctions.js +0 -17
- package/esm2015/testing/fakes/angular-fire/FakeAngularFirePerformance.js +0 -17
- package/esm2015/testing/fakes/angular-fire/FakeAngularFireStorage.js +0 -8
- package/esm2015/testing/fakes/angular-fire/FakeAngularFirestore.js +0 -8
- package/esm2015/testing/fakes/angular-fire/FakeUserCredential.js +0 -18
- package/esm2015/testing/fakes/index.js +0 -19
- package/esm2015/testing/ngx-firebase-testing.js +0 -6
- package/esm2015/testing/public-api.js +0 -5
- package/esm2015/testing/test.module.js +0 -66
- package/esm2015/testing/utils/index.js +0 -17
- package/esm2015/testing/utils/patchConsole.js +0 -14
- package/fesm2015/ngx-firebase-capacitor.js +0 -328
- package/fesm2015/ngx-firebase-capacitor.js.map +0 -1
- package/fesm2015/ngx-firebase-iap.js +0 -354
- package/fesm2015/ngx-firebase-iap.js.map +0 -1
- package/fesm2015/ngx-firebase-ionic-auth-ui.js +0 -1482
- package/fesm2015/ngx-firebase-ionic-auth-ui.js.map +0 -1
- package/fesm2015/ngx-firebase-ionic.js +0 -495
- package/fesm2015/ngx-firebase-ionic.js.map +0 -1
- package/fesm2015/ngx-firebase-testing.js +0 -388
- package/fesm2015/ngx-firebase-testing.js.map +0 -1
- package/fesm2015/ngx-firebase.js +0 -1509
- package/fesm2015/ngx-firebase.js.map +0 -1
- package/iap/iap.module.d.ts +0 -5
- package/iap/interfaces/index.d.ts +0 -11
- package/iap/ngx-firebase-iap.d.ts +0 -4
- package/iap/ngx-firebase-iap.metadata.json +0 -1
- package/iap/package.json +0 -23
- package/iap/public-api.d.ts +0 -4
- package/iap/services/iap.service.d.ts +0 -47
- package/iap/tokens/index.d.ts +0 -3
- package/ionic/animations/index.d.ts +0 -1
- package/ionic/components/avatar/avatar.component.d.ts +0 -27
- package/ionic/components/avatar/index.d.ts +0 -1
- package/ionic/components/index.d.ts +0 -2
- package/ionic/components/popover-menu/index.d.ts +0 -2
- package/ionic/components/popover-menu/interface.d.ts +0 -6
- package/ionic/components/popover-menu/popover-menu.component.d.ts +0 -10
- package/ionic/ionic.module.d.ts +0 -2
- package/ionic/ngx-firebase-ionic.d.ts +0 -4
- package/ionic/ngx-firebase-ionic.metadata.json +0 -1
- package/ionic/package.json +0 -30
- package/ionic/public-api.d.ts +0 -4
- package/ionic/services/alerts-ionic.service.d.ts +0 -13
- package/ionic/services/index.d.ts +0 -5
- package/ionic/services/legality-dialog-ionic.service.d.ts +0 -10
- package/ionic/services/loading-ionic.service.d.ts +0 -17
- package/ionic/services/picker-ionic.service.d.ts +0 -9
- package/ionic/services/toast-ionic.service.d.ts +0 -11
- package/ionic-auth-ui/animations/index.d.ts +0 -1
- package/ionic-auth-ui/components/email-confirmation/email-confirmation.component.d.ts +0 -31
- package/ionic-auth-ui/components/email-field/email-field.component.d.ts +0 -7
- package/ionic-auth-ui/components/form-field/form-field.component.d.ts +0 -28
- package/ionic-auth-ui/components/index.d.ts +0 -11
- package/ionic-auth-ui/components/name-field/name-field.component.d.ts +0 -8
- package/ionic-auth-ui/components/or-divider/or-divider.component.d.ts +0 -2
- package/ionic-auth-ui/components/password-field/password-field.component.d.ts +0 -34
- package/ionic-auth-ui/components/password-field/passwordValidatorFunctions.d.ts +0 -4
- package/ionic-auth-ui/components/providers/providers.component.d.ts +0 -26
- package/ionic-auth-ui/components/reauthenticate/reauthenticate.component.d.ts +0 -30
- package/ionic-auth-ui/components/register/register.component.d.ts +0 -26
- package/ionic-auth-ui/components/register-with-email/register-with-email.component.d.ts +0 -24
- package/ionic-auth-ui/components/register-with-email-popover/register-with-email-popover.component.d.ts +0 -7
- package/ionic-auth-ui/components/signin/signin.component.d.ts +0 -28
- package/ionic-auth-ui/components/terms-field/terms-field.component.d.ts +0 -27
- package/ionic-auth-ui/components/user/user.component.d.ts +0 -45
- package/ionic-auth-ui/ionic-auth-ui.module.d.ts +0 -32
- package/ionic-auth-ui/ngx-firebase-ionic-auth-ui.d.ts +0 -22
- package/ionic-auth-ui/ngx-firebase-ionic-auth-ui.metadata.json +0 -1
- package/ionic-auth-ui/package.json +0 -30
- package/ionic-auth-ui/pages/index.d.ts +0 -4
- package/ionic-auth-ui/pages/register/index.d.ts +0 -1
- package/ionic-auth-ui/pages/register/register.page.d.ts +0 -16
- package/ionic-auth-ui/pages/signin/index.d.ts +0 -1
- package/ionic-auth-ui/pages/signin/signin.page.d.ts +0 -22
- package/ionic-auth-ui/pages/user/index.d.ts +0 -1
- package/ionic-auth-ui/pages/user/user.page.d.ts +0 -3
- package/ionic-auth-ui/pages/verifyemail/index.d.ts +0 -1
- package/ionic-auth-ui/pages/verifyemail/verifyemail.page.d.ts +0 -19
- package/ionic-auth-ui/public-api.d.ts +0 -4
- package/ngx-firebase.d.ts +0 -5
- package/ngx-firebase.metadata.json +0 -1
- package/public-api.d.ts +0 -5
- package/shared/guards/index.d.ts +0 -2
- package/shared/guards/logged-in.guard.d.ts +0 -13
- package/shared/guards/verify-email.guard.d.ts +0 -11
- package/shared/interfaces/accounts.enum.d.ts +0 -7
- package/shared/interfaces/authprovider.enum.d.ts +0 -13
- package/shared/interfaces/config.interface.d.ts +0 -63
- package/shared/interfaces/index.d.ts +0 -7
- package/shared/interfaces/main.interface.d.ts +0 -13
- package/shared/interfaces/providers.interface.d.ts +0 -70
- package/shared/interfaces/tokens.d.ts +0 -16
- package/shared/interfaces/ui-providers.interface.d.ts +0 -66
- package/shared/services/analytics.service.d.ts +0 -10
- package/shared/services/auth-process.service.d.ts +0 -197
- package/shared/services/crashlytics.service.d.ts +0 -11
- package/shared/services/device-info.service.d.ts +0 -3
- package/shared/services/firebase.service.d.ts +0 -16
- package/shared/services/firestore-sync.service.d.ts +0 -16
- package/shared/services/index.d.ts +0 -9
- package/shared/services/performance.service.d.ts +0 -12
- package/shared/services/remoteconfig.service.d.ts +0 -18
- package/shared/services/ui.service.d.ts +0 -22
- package/shared/shared.module.d.ts +0 -14
- package/shared/types/DisplayWidth.d.ts +0 -7
- package/shared/types/Location.d.ts +0 -8
- package/shared/types/ValueAccessorControlComponent.d.ts +0 -27
- package/shared/types/ValueAccessorValueComponent.d.ts +0 -19
- package/shared/types/index.d.ts +0 -4
- package/testing/fakeavatar.module.d.ts +0 -2
- package/testing/fakes/FakeAuthProcessService.d.ts +0 -28
- package/testing/fakes/FakeAvatarComponent.d.ts +0 -3
- package/testing/fakes/FakeFireService.d.ts +0 -20
- package/testing/fakes/FakeFirestoreSyncService.d.ts +0 -9
- package/testing/fakes/FakeIAPurchaseService.d.ts +0 -9
- package/testing/fakes/FakePickerService.d.ts +0 -6
- package/testing/fakes/FakeRemoteConfigService.d.ts +0 -19
- package/testing/fakes/FakeTranslateService.d.ts +0 -15
- package/testing/fakes/FakeUiService.d.ts +0 -25
- package/testing/fakes/angular-fire/FakeAngularFireAuth.d.ts +0 -52
- package/testing/fakes/angular-fire/FakeAngularFireFunctions.d.ts +0 -11
- package/testing/fakes/angular-fire/FakeAngularFirePerformance.d.ts +0 -10
- package/testing/fakes/angular-fire/FakeAngularFireStorage.d.ts +0 -5
- package/testing/fakes/angular-fire/FakeAngularFirestore.d.ts +0 -5
- package/testing/fakes/angular-fire/FakeUserCredential.d.ts +0 -9
- package/testing/fakes/index.d.ts +0 -16
- package/testing/ngx-firebase-testing.d.ts +0 -5
- package/testing/ngx-firebase-testing.metadata.json +0 -1
- package/testing/package.json +0 -29
- package/testing/public-api.d.ts +0 -4
- package/testing/test.module.d.ts +0 -4
- package/testing/utils/index.d.ts +0 -5
- package/testing/utils/patchConsole.d.ts +0 -4
package/README.md
CHANGED
|
@@ -1,24 +1,132 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @ngx-firebase
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A lightweight, drop-in, and zoneless-friendly wrapper around the native **Firebase JS SDK** for **Angular 22+**.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This library serves as a modern, boilerplate-free alternative to `@angular/fire`, providing native Angular Dependency Injection (DI) class tokens and reactive RxJS wrappers around standard Firebase listeners.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
> Note: Don't forget to add `--project mal` or else it will be added to the default project in your `angular.json` file.
|
|
7
|
+
---
|
|
9
8
|
|
|
10
|
-
##
|
|
9
|
+
## ⚡ Features
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
- 📦 **Zero overhead**: Communicates directly with the Firebase JS SDK without complex wrappers.
|
|
12
|
+
- 💉 **Native Angular DI**: Standard provider functions (`provideFirestore`, `provideAuth`, etc.) compatible with Angular's `ApplicationConfig`.
|
|
13
|
+
- 🎭 **RxJS Wrappers**: Lightweight, memory-leak-safe wrappers for common tasks (`docData`, `collectionSnapshots`, `user`).
|
|
14
|
+
- ⏱️ **Zoneless Friendly**: Uses native SDK snapshot listeners wrapped in RxJS observable streams.
|
|
15
|
+
- 📊 **Screen Tracking**: Custom built-in `ScreenTrackingService` for automated Google Analytics route tracking.
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
---
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
## 📦 Installation
|
|
17
20
|
|
|
18
|
-
|
|
21
|
+
Install both the library and the native Firebase SDK:
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
```bash
|
|
24
|
+
npm install ngx-firebase firebase
|
|
25
|
+
```
|
|
21
26
|
|
|
22
|
-
|
|
27
|
+
---
|
|
23
28
|
|
|
24
|
-
|
|
29
|
+
## 🚀 Quick Start
|
|
30
|
+
|
|
31
|
+
### 1. Configure Providers
|
|
32
|
+
|
|
33
|
+
Register the Firebase services in your `app.config.ts` using the functional providers:
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
import { ApplicationConfig } from '@angular/core';
|
|
37
|
+
import { provideRouter } from '@angular/router';
|
|
38
|
+
import { initializeApp } from 'firebase/app';
|
|
39
|
+
import { getAuth } from 'firebase/auth';
|
|
40
|
+
import { getFirestore } from 'firebase/firestore';
|
|
41
|
+
import {
|
|
42
|
+
provideFirebaseApp,
|
|
43
|
+
provideAuth,
|
|
44
|
+
provideFirestore
|
|
45
|
+
} from 'ngx-firebase';
|
|
46
|
+
|
|
47
|
+
import { routes } from './app.routes';
|
|
48
|
+
|
|
49
|
+
export const appConfig: ApplicationConfig = {
|
|
50
|
+
providers: [
|
|
51
|
+
provideRouter(routes),
|
|
52
|
+
|
|
53
|
+
// Initialize Firebase App
|
|
54
|
+
provideFirebaseApp(() => initializeApp({
|
|
55
|
+
apiKey: "YOUR_API_KEY",
|
|
56
|
+
authDomain: "YOUR_AUTH_DOMAIN",
|
|
57
|
+
projectId: "YOUR_PROJECT_ID",
|
|
58
|
+
storageBucket: "YOUR_STORAGE_BUCKET",
|
|
59
|
+
messagingSenderId: "YOUR_MESSAGING_SENDER_ID",
|
|
60
|
+
appId: "YOUR_APP_ID",
|
|
61
|
+
measurementId: "YOUR_MEASUREMENT_ID"
|
|
62
|
+
})),
|
|
63
|
+
|
|
64
|
+
// Provide Firestore & Auth
|
|
65
|
+
provideFirestore(() => getFirestore()),
|
|
66
|
+
provideAuth(() => getAuth())
|
|
67
|
+
]
|
|
68
|
+
};
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 2. Using Services in Standalone Components
|
|
72
|
+
|
|
73
|
+
Inject the native Firebase instances directly using the provided tokens, and use the RxJS helpers:
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
import { Component, inject } from '@angular/core';
|
|
77
|
+
import { CommonModule } from '@angular/common';
|
|
78
|
+
import { Firestore, doc } from 'firebase/firestore';
|
|
79
|
+
import { docData } from 'ngx-firebase';
|
|
80
|
+
import { Observable } from 'rxjs';
|
|
81
|
+
|
|
82
|
+
@Component({
|
|
83
|
+
selector: 'app-store-detail',
|
|
84
|
+
standalone: true,
|
|
85
|
+
imports: [CommonModule],
|
|
86
|
+
template: `
|
|
87
|
+
<div *ngIf="store$ | async as store">
|
|
88
|
+
<h1>{{ store.name }}</h1>
|
|
89
|
+
<p>{{ store.description }}</p>
|
|
90
|
+
</div>
|
|
91
|
+
`
|
|
92
|
+
})
|
|
93
|
+
export class StoreDetailComponent {
|
|
94
|
+
private firestore = inject(Firestore);
|
|
95
|
+
store$: Observable<any>;
|
|
96
|
+
|
|
97
|
+
constructor() {
|
|
98
|
+
// Reference a document using the native Firestore SDK
|
|
99
|
+
const storeRef = doc(this.firestore, 'stores/store_123');
|
|
100
|
+
|
|
101
|
+
// Wrap it reactively using docData
|
|
102
|
+
this.store$ = docData(storeRef);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### 3. Track Route Page Views Automatically (Google Analytics)
|
|
108
|
+
|
|
109
|
+
To enable automatic page view tracking, register `provideAnalytics` and inject `ScreenTrackingService` in your client config:
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
import { ApplicationConfig, provideEnvironmentInitializer, inject } from '@angular/core';
|
|
113
|
+
import { getAnalytics } from 'firebase/analytics';
|
|
114
|
+
import { provideAnalytics, ScreenTrackingService } from 'ngx-firebase';
|
|
115
|
+
|
|
116
|
+
export const clientConfig: ApplicationConfig = {
|
|
117
|
+
providers: [
|
|
118
|
+
provideAnalytics(() => getAnalytics()),
|
|
119
|
+
ScreenTrackingService,
|
|
120
|
+
provideEnvironmentInitializer(() => {
|
|
121
|
+
// Force service initialization to listen to router events
|
|
122
|
+
inject(ScreenTrackingService);
|
|
123
|
+
})
|
|
124
|
+
]
|
|
125
|
+
};
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## 📄 License
|
|
131
|
+
|
|
132
|
+
MIT © 2026 Sebas (quedicesebas)
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Injectable } from '@angular/core';
|
|
3
|
+
import { Router, NavigationEnd } from '@angular/router';
|
|
4
|
+
import { onSnapshot, Firestore } from 'firebase/firestore';
|
|
5
|
+
import { onAuthStateChanged } from 'firebase/auth';
|
|
6
|
+
import { logEvent } from 'firebase/analytics';
|
|
7
|
+
import { Observable } from 'rxjs';
|
|
8
|
+
import { filter } from 'rxjs/operators';
|
|
9
|
+
|
|
10
|
+
// --- DI TOKENS ---
|
|
11
|
+
// We export abstract classes with matching names to act as DI Tokens in Angular
|
|
12
|
+
class FirebaseApp {
|
|
13
|
+
}
|
|
14
|
+
class Auth {
|
|
15
|
+
}
|
|
16
|
+
class FirebaseStorage {
|
|
17
|
+
}
|
|
18
|
+
class Functions {
|
|
19
|
+
}
|
|
20
|
+
class Analytics {
|
|
21
|
+
}
|
|
22
|
+
// --- FIREBASE SDK MUTABLE WRAPPER FOR TESTING ---
|
|
23
|
+
const firebaseSdk = {
|
|
24
|
+
onSnapshot,
|
|
25
|
+
onAuthStateChanged,
|
|
26
|
+
};
|
|
27
|
+
// --- RXJS WRAPPERS ---
|
|
28
|
+
/**
|
|
29
|
+
* Wraps onSnapshot for a document reference.
|
|
30
|
+
*/
|
|
31
|
+
function docData(ref) {
|
|
32
|
+
return new Observable((subscriber) => {
|
|
33
|
+
const unsubscribe = firebaseSdk.onSnapshot(ref, (snapshot) => {
|
|
34
|
+
subscriber.next(snapshot.data());
|
|
35
|
+
}, (error) => {
|
|
36
|
+
subscriber.error(error);
|
|
37
|
+
});
|
|
38
|
+
return () => unsubscribe();
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Wraps onSnapshot for a query/collection.
|
|
43
|
+
*/
|
|
44
|
+
function collectionSnapshots(q) {
|
|
45
|
+
return new Observable((subscriber) => {
|
|
46
|
+
const unsubscribe = firebaseSdk.onSnapshot(q, (snapshot) => {
|
|
47
|
+
subscriber.next(snapshot.docs);
|
|
48
|
+
}, (error) => {
|
|
49
|
+
subscriber.error(error);
|
|
50
|
+
});
|
|
51
|
+
return () => unsubscribe();
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Wraps onAuthStateChanged to monitor auth state.
|
|
56
|
+
*/
|
|
57
|
+
function user(auth) {
|
|
58
|
+
return new Observable((subscriber) => {
|
|
59
|
+
const unsubscribe = firebaseSdk.onAuthStateChanged(auth, (user) => {
|
|
60
|
+
subscriber.next(user);
|
|
61
|
+
}, (error) => {
|
|
62
|
+
subscriber.error(error);
|
|
63
|
+
});
|
|
64
|
+
return () => unsubscribe();
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
// --- SCREEN TRACKING SERVICE ---
|
|
68
|
+
/**
|
|
69
|
+
* Custom ScreenTrackingService to replace @angular/fire/analytics ScreenTrackingService.
|
|
70
|
+
* Automatically tracks page views on router navigation events.
|
|
71
|
+
*/
|
|
72
|
+
class ScreenTrackingService {
|
|
73
|
+
analytics = inject(Analytics, { optional: true });
|
|
74
|
+
router = inject(Router, { optional: true });
|
|
75
|
+
constructor() {
|
|
76
|
+
if (this.analytics && this.router) {
|
|
77
|
+
this.router.events
|
|
78
|
+
.pipe(filter((event) => event instanceof NavigationEnd))
|
|
79
|
+
.subscribe((event) => {
|
|
80
|
+
logEvent(this.analytics, 'screen_view', {
|
|
81
|
+
firebase_screen: event.urlAfterRedirects || event.url,
|
|
82
|
+
firebase_screen_class: 'AngularRoute',
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ScreenTrackingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
88
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ScreenTrackingService, providedIn: 'root' });
|
|
89
|
+
}
|
|
90
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ScreenTrackingService, decorators: [{
|
|
91
|
+
type: Injectable,
|
|
92
|
+
args: [{
|
|
93
|
+
providedIn: 'root',
|
|
94
|
+
}]
|
|
95
|
+
}], ctorParameters: () => [] });
|
|
96
|
+
// --- DI PROVIDERS ---
|
|
97
|
+
function provideFirebaseApp(fn) {
|
|
98
|
+
return {
|
|
99
|
+
provide: FirebaseApp,
|
|
100
|
+
useFactory: fn,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function provideFirestore(fn) {
|
|
104
|
+
return {
|
|
105
|
+
provide: Firestore,
|
|
106
|
+
useFactory: () => {
|
|
107
|
+
inject(FirebaseApp); // Force app initialization before building Firestore
|
|
108
|
+
return fn();
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function provideAuth(fn) {
|
|
113
|
+
return {
|
|
114
|
+
provide: Auth,
|
|
115
|
+
useFactory: () => {
|
|
116
|
+
inject(FirebaseApp); // Force app initialization before building Auth
|
|
117
|
+
return fn();
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function provideStorage(fn) {
|
|
122
|
+
return {
|
|
123
|
+
provide: FirebaseStorage,
|
|
124
|
+
useFactory: () => {
|
|
125
|
+
inject(FirebaseApp); // Force app initialization before building Storage
|
|
126
|
+
return fn();
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function provideFunctions(fn) {
|
|
131
|
+
return {
|
|
132
|
+
provide: Functions,
|
|
133
|
+
useFactory: () => {
|
|
134
|
+
inject(FirebaseApp); // Force app initialization before building Functions
|
|
135
|
+
return fn();
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function provideAnalytics(fn) {
|
|
140
|
+
return {
|
|
141
|
+
provide: Analytics,
|
|
142
|
+
useFactory: () => {
|
|
143
|
+
inject(FirebaseApp); // Force app initialization before building Analytics
|
|
144
|
+
return fn();
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/*
|
|
150
|
+
* Public API Surface of ngx-firebase
|
|
151
|
+
*/
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Generated bundle index. Do not edit.
|
|
155
|
+
*/
|
|
156
|
+
|
|
157
|
+
export { Analytics, Auth, FirebaseApp, FirebaseStorage, Functions, ScreenTrackingService, collectionSnapshots, docData, firebaseSdk, provideAnalytics, provideAuth, provideFirebaseApp, provideFirestore, provideFunctions, provideStorage, user };
|
|
158
|
+
//# sourceMappingURL=ngx-firebase.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-firebase.mjs","sources":["../../../projects/ngx-firebase/src/lib/firebase-providers.ts","../../../projects/ngx-firebase/src/public-api.ts","../../../projects/ngx-firebase/src/ngx-firebase.ts"],"sourcesContent":["import { inject, Injectable, Provider } from '@angular/core';\nimport { Router, NavigationEnd } from '@angular/router';\nimport { FirebaseApp as NativeFirebaseApp } from 'firebase/app';\nimport { Firestore, DocumentReference, Query, QueryDocumentSnapshot, onSnapshot } from 'firebase/firestore';\nimport { Auth as NativeAuth, User, onAuthStateChanged } from 'firebase/auth';\nimport { FirebaseStorage as NativeFirebaseStorage } from 'firebase/storage';\nimport { Functions as NativeFunctions } from 'firebase/functions';\nimport { Analytics as NativeAnalytics, logEvent } from 'firebase/analytics';\nimport { Observable } from 'rxjs';\nimport { filter } from 'rxjs/operators';\n\n// --- DI TOKENS ---\n// We export abstract classes with matching names to act as DI Tokens in Angular\nexport abstract class FirebaseApp {}\nexport abstract class Auth {}\nexport abstract class FirebaseStorage {}\nexport abstract class Functions {}\nexport abstract class Analytics {}\n\n// --- FIREBASE SDK MUTABLE WRAPPER FOR TESTING ---\nexport const firebaseSdk = {\n onSnapshot,\n onAuthStateChanged,\n};\n\n// --- RXJS WRAPPERS ---\n\n/**\n * Wraps onSnapshot for a document reference.\n */\nexport function docData<T = any>(ref: DocumentReference<T>): Observable<T | undefined> {\n return new Observable<T | undefined>((subscriber) => {\n const unsubscribe = firebaseSdk.onSnapshot(\n ref,\n (snapshot) => {\n subscriber.next(snapshot.data());\n },\n (error) => {\n subscriber.error(error);\n }\n );\n return () => unsubscribe();\n });\n}\n\n/**\n * Wraps onSnapshot for a query/collection.\n */\nexport function collectionSnapshots<T = any>(q: Query<T>): Observable<QueryDocumentSnapshot<T>[]> {\n return new Observable<QueryDocumentSnapshot<T>[]>((subscriber) => {\n const unsubscribe = firebaseSdk.onSnapshot(\n q,\n (snapshot) => {\n subscriber.next(snapshot.docs);\n },\n (error) => {\n subscriber.error(error);\n }\n );\n return () => unsubscribe();\n });\n}\n\n/**\n * Wraps onAuthStateChanged to monitor auth state.\n */\nexport function user(auth: Auth): Observable<User | null> {\n return new Observable<User | null>((subscriber) => {\n const unsubscribe = firebaseSdk.onAuthStateChanged(\n auth as unknown as NativeAuth,\n (user) => {\n subscriber.next(user);\n },\n (error) => {\n subscriber.error(error);\n }\n );\n return () => unsubscribe();\n });\n}\n\n// --- SCREEN TRACKING SERVICE ---\n\n/**\n * Custom ScreenTrackingService to replace @angular/fire/analytics ScreenTrackingService.\n * Automatically tracks page views on router navigation events.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ScreenTrackingService {\n private analytics = inject(Analytics, { optional: true });\n private router = inject(Router, { optional: true });\n\n constructor() {\n if (this.analytics && this.router) {\n this.router.events\n .pipe(filter((event) => event instanceof NavigationEnd))\n .subscribe((event: any) => {\n logEvent(this.analytics as unknown as NativeAnalytics, 'screen_view', {\n firebase_screen: event.urlAfterRedirects || event.url,\n firebase_screen_class: 'AngularRoute',\n });\n });\n }\n }\n}\n\n// --- DI PROVIDERS ---\n\nexport function provideFirebaseApp(fn: () => NativeFirebaseApp): Provider {\n return {\n provide: FirebaseApp,\n useFactory: fn,\n };\n}\n\nexport function provideFirestore(fn: () => Firestore): Provider {\n return {\n provide: Firestore,\n useFactory: () => {\n inject(FirebaseApp); // Force app initialization before building Firestore\n return fn();\n },\n };\n}\n\nexport function provideAuth(fn: () => NativeAuth): Provider {\n return {\n provide: Auth,\n useFactory: () => {\n inject(FirebaseApp); // Force app initialization before building Auth\n return fn();\n },\n };\n}\n\nexport function provideStorage(fn: () => NativeFirebaseStorage): Provider {\n return {\n provide: FirebaseStorage,\n useFactory: () => {\n inject(FirebaseApp); // Force app initialization before building Storage\n return fn();\n },\n };\n}\n\nexport function provideFunctions(fn: () => NativeFunctions): Provider {\n return {\n provide: Functions,\n useFactory: () => {\n inject(FirebaseApp); // Force app initialization before building Functions\n return fn();\n },\n };\n}\n\nexport function provideAnalytics(fn: () => NativeAnalytics): Provider {\n return {\n provide: Analytics,\n useFactory: () => {\n inject(FirebaseApp); // Force app initialization before building Analytics\n return fn();\n },\n };\n}\n","/*\n * Public API Surface of ngx-firebase\n */\n\nexport * from './lib/firebase-providers';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,38 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-firebase",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "22.0.1",
|
|
4
|
+
"description": "A lightweight, drop-in, and zoneless-friendly wrapper around the native Firebase JS SDK for Angular 22+.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"angular",
|
|
7
|
+
"firebase",
|
|
8
|
+
"rxjs",
|
|
9
|
+
"zoneless",
|
|
10
|
+
"angular-fire",
|
|
11
|
+
"firestore",
|
|
12
|
+
"firebase-auth",
|
|
13
|
+
"providers"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://github.com/quedicesebas/ngx-firebase#readme",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/quedicesebas/ngx-firebase/issues"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/quedicesebas/ngx-firebase.git"
|
|
22
|
+
},
|
|
4
23
|
"license": "MIT",
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
5
27
|
"peerDependencies": {
|
|
6
|
-
"@angular/
|
|
7
|
-
"@angular/
|
|
8
|
-
"@angular/common": "^11.2.5",
|
|
9
|
-
"@angular/core": "^11.2.5",
|
|
10
|
-
"@angular/fire": "^6.1.4",
|
|
11
|
-
"@angular/flex-layout": "^11.0.0-beta.33",
|
|
12
|
-
"@angular/forms": "^11.2.5",
|
|
13
|
-
"@angular/platform-browser": "^11.2.5",
|
|
14
|
-
"@angular/platform-browser-dynamic": "^11.2.5",
|
|
15
|
-
"@angular/router": "^11.2.5",
|
|
16
|
-
"@ionic/angular": "^5.5.0",
|
|
17
|
-
"@ngx-translate/core": "^13.0.0",
|
|
18
|
-
"ionic4-tooltips": "^2.0.2",
|
|
19
|
-
"rxjs": "~6.5.4",
|
|
20
|
-
"zone.js": "^0.11.3",
|
|
21
|
-
"firebase": "^8.2.6"
|
|
28
|
+
"@angular/common": "^22.0.0",
|
|
29
|
+
"@angular/core": "^22.0.0"
|
|
22
30
|
},
|
|
23
31
|
"dependencies": {
|
|
24
|
-
"tslib": "^2.0
|
|
32
|
+
"tslib": "^2.3.0"
|
|
25
33
|
},
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
34
|
+
"sideEffects": false,
|
|
35
|
+
"module": "fesm2022/ngx-firebase.mjs",
|
|
36
|
+
"typings": "types/ngx-firebase.d.ts",
|
|
37
|
+
"exports": {
|
|
38
|
+
"./package.json": {
|
|
39
|
+
"default": "./package.json"
|
|
40
|
+
},
|
|
41
|
+
".": {
|
|
42
|
+
"types": "./types/ngx-firebase.d.ts",
|
|
43
|
+
"default": "./fesm2022/ngx-firebase.mjs"
|
|
44
|
+
}
|
|
29
45
|
},
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
"es2015": "fesm2015/ngx-firebase.js",
|
|
33
|
-
"esm2015": "esm2015/ngx-firebase.js",
|
|
34
|
-
"fesm2015": "fesm2015/ngx-firebase.js",
|
|
35
|
-
"typings": "ngx-firebase.d.ts",
|
|
36
|
-
"metadata": "ngx-firebase.metadata.json",
|
|
37
|
-
"sideEffects": false
|
|
38
|
-
}
|
|
46
|
+
"type": "module"
|
|
47
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Provider } from '@angular/core';
|
|
3
|
+
import { FirebaseApp as FirebaseApp$1 } from 'firebase/app';
|
|
4
|
+
import { Query, QueryDocumentSnapshot, DocumentReference, onSnapshot, Firestore } from 'firebase/firestore';
|
|
5
|
+
import { onAuthStateChanged, Auth as Auth$1, User } from 'firebase/auth';
|
|
6
|
+
import { FirebaseStorage as FirebaseStorage$1 } from 'firebase/storage';
|
|
7
|
+
import { Functions as Functions$1 } from 'firebase/functions';
|
|
8
|
+
import { Analytics as Analytics$1 } from 'firebase/analytics';
|
|
9
|
+
import { Observable } from 'rxjs';
|
|
10
|
+
|
|
11
|
+
declare abstract class FirebaseApp {
|
|
12
|
+
}
|
|
13
|
+
declare abstract class Auth {
|
|
14
|
+
}
|
|
15
|
+
declare abstract class FirebaseStorage {
|
|
16
|
+
}
|
|
17
|
+
declare abstract class Functions {
|
|
18
|
+
}
|
|
19
|
+
declare abstract class Analytics {
|
|
20
|
+
}
|
|
21
|
+
declare const firebaseSdk: {
|
|
22
|
+
onSnapshot: typeof onSnapshot;
|
|
23
|
+
onAuthStateChanged: typeof onAuthStateChanged;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Wraps onSnapshot for a document reference.
|
|
27
|
+
*/
|
|
28
|
+
declare function docData<T = any>(ref: DocumentReference<T>): Observable<T | undefined>;
|
|
29
|
+
/**
|
|
30
|
+
* Wraps onSnapshot for a query/collection.
|
|
31
|
+
*/
|
|
32
|
+
declare function collectionSnapshots<T = any>(q: Query<T>): Observable<QueryDocumentSnapshot<T>[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Wraps onAuthStateChanged to monitor auth state.
|
|
35
|
+
*/
|
|
36
|
+
declare function user(auth: Auth): Observable<User | null>;
|
|
37
|
+
/**
|
|
38
|
+
* Custom ScreenTrackingService to replace @angular/fire/analytics ScreenTrackingService.
|
|
39
|
+
* Automatically tracks page views on router navigation events.
|
|
40
|
+
*/
|
|
41
|
+
declare class ScreenTrackingService {
|
|
42
|
+
private analytics;
|
|
43
|
+
private router;
|
|
44
|
+
constructor();
|
|
45
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ScreenTrackingService, never>;
|
|
46
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ScreenTrackingService>;
|
|
47
|
+
}
|
|
48
|
+
declare function provideFirebaseApp(fn: () => FirebaseApp$1): Provider;
|
|
49
|
+
declare function provideFirestore(fn: () => Firestore): Provider;
|
|
50
|
+
declare function provideAuth(fn: () => Auth$1): Provider;
|
|
51
|
+
declare function provideStorage(fn: () => FirebaseStorage$1): Provider;
|
|
52
|
+
declare function provideFunctions(fn: () => Functions$1): Provider;
|
|
53
|
+
declare function provideAnalytics(fn: () => Analytics$1): Provider;
|
|
54
|
+
|
|
55
|
+
export { Analytics, Auth, FirebaseApp, FirebaseStorage, Functions, ScreenTrackingService, collectionSnapshots, docData, firebaseSdk, provideAnalytics, provideAuth, provideFirebaseApp, provideFirestore, provideFunctions, provideStorage, user };
|