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.
Files changed (274) hide show
  1. package/README.md +121 -13
  2. package/fesm2022/ngx-firebase.mjs +158 -0
  3. package/fesm2022/ngx-firebase.mjs.map +1 -0
  4. package/package.json +39 -30
  5. package/types/ngx-firebase.d.ts +55 -0
  6. package/bundles/ngx-firebase-capacitor.umd.js +0 -763
  7. package/bundles/ngx-firebase-capacitor.umd.js.map +0 -1
  8. package/bundles/ngx-firebase-capacitor.umd.min.js +0 -16
  9. package/bundles/ngx-firebase-capacitor.umd.min.js.map +0 -1
  10. package/bundles/ngx-firebase-iap.umd.js +0 -718
  11. package/bundles/ngx-firebase-iap.umd.js.map +0 -1
  12. package/bundles/ngx-firebase-iap.umd.min.js +0 -2
  13. package/bundles/ngx-firebase-iap.umd.min.js.map +0 -1
  14. package/bundles/ngx-firebase-ionic-auth-ui.umd.js +0 -2116
  15. package/bundles/ngx-firebase-ionic-auth-ui.umd.js.map +0 -1
  16. package/bundles/ngx-firebase-ionic-auth-ui.umd.min.js +0 -16
  17. package/bundles/ngx-firebase-ionic-auth-ui.umd.min.js.map +0 -1
  18. package/bundles/ngx-firebase-ionic.umd.js +0 -979
  19. package/bundles/ngx-firebase-ionic.umd.js.map +0 -1
  20. package/bundles/ngx-firebase-ionic.umd.min.js +0 -16
  21. package/bundles/ngx-firebase-ionic.umd.min.js.map +0 -1
  22. package/bundles/ngx-firebase-testing.umd.js +0 -801
  23. package/bundles/ngx-firebase-testing.umd.js.map +0 -1
  24. package/bundles/ngx-firebase-testing.umd.min.js +0 -2
  25. package/bundles/ngx-firebase-testing.umd.min.js.map +0 -1
  26. package/bundles/ngx-firebase.umd.js +0 -2299
  27. package/bundles/ngx-firebase.umd.js.map +0 -1
  28. package/bundles/ngx-firebase.umd.min.js +0 -2
  29. package/bundles/ngx-firebase.umd.min.js.map +0 -1
  30. package/capacitor/capacitor.module.d.ts +0 -9
  31. package/capacitor/interfaces/config.d.ts +0 -12
  32. package/capacitor/interfaces/index.d.ts +0 -1
  33. package/capacitor/ngx-firebase-capacitor.d.ts +0 -5
  34. package/capacitor/ngx-firebase-capacitor.metadata.json +0 -1
  35. package/capacitor/package.json +0 -25
  36. package/capacitor/public-api.d.ts +0 -3
  37. package/capacitor/services/analytics-firebase-capacitor.service.d.ts +0 -9
  38. package/capacitor/services/crashlytics-firebase-capacitor.service.d.ts +0 -8
  39. package/capacitor/services/credential-factory-capacitor.service.d.ts +0 -18
  40. package/capacitor/services/index.d.ts +0 -3
  41. package/esm2015/capacitor/capacitor.module.js +0 -78
  42. package/esm2015/capacitor/interfaces/config.js +0 -3
  43. package/esm2015/capacitor/interfaces/index.js +0 -2
  44. package/esm2015/capacitor/ngx-firebase-capacitor.js +0 -6
  45. package/esm2015/capacitor/public-api.js +0 -4
  46. package/esm2015/capacitor/services/analytics-firebase-capacitor.service.js +0 -43
  47. package/esm2015/capacitor/services/crashlytics-firebase-capacitor.service.js +0 -40
  48. package/esm2015/capacitor/services/credential-factory-capacitor.service.js +0 -182
  49. package/esm2015/capacitor/services/index.js +0 -4
  50. package/esm2015/iap/iap.module.js +0 -32
  51. package/esm2015/iap/interfaces/index.js +0 -5
  52. package/esm2015/iap/ngx-firebase-iap.js +0 -5
  53. package/esm2015/iap/public-api.js +0 -5
  54. package/esm2015/iap/services/iap.service.js +0 -317
  55. package/esm2015/iap/tokens/index.js +0 -4
  56. package/esm2015/ionic/animations/index.js +0 -30
  57. package/esm2015/ionic/components/avatar/avatar.component.js +0 -98
  58. package/esm2015/ionic/components/avatar/index.js +0 -2
  59. package/esm2015/ionic/components/index.js +0 -3
  60. package/esm2015/ionic/components/popover-menu/index.js +0 -3
  61. package/esm2015/ionic/components/popover-menu/interface.js +0 -2
  62. package/esm2015/ionic/components/popover-menu/popover-menu.component.js +0 -34
  63. package/esm2015/ionic/ionic.module.js +0 -46
  64. package/esm2015/ionic/ngx-firebase-ionic.js +0 -5
  65. package/esm2015/ionic/public-api.js +0 -5
  66. package/esm2015/ionic/services/alerts-ionic.service.js +0 -107
  67. package/esm2015/ionic/services/index.js +0 -6
  68. package/esm2015/ionic/services/legality-dialog-ionic.service.js +0 -85
  69. package/esm2015/ionic/services/loading-ionic.service.js +0 -46
  70. package/esm2015/ionic/services/picker-ionic.service.js +0 -44
  71. package/esm2015/ionic/services/toast-ionic.service.js +0 -49
  72. package/esm2015/ionic-auth-ui/animations/index.js +0 -30
  73. package/esm2015/ionic-auth-ui/components/email-confirmation/email-confirmation.component.js +0 -99
  74. package/esm2015/ionic-auth-ui/components/email-field/email-field.component.js +0 -25
  75. package/esm2015/ionic-auth-ui/components/form-field/form-field.component.js +0 -82
  76. package/esm2015/ionic-auth-ui/components/index.js +0 -12
  77. package/esm2015/ionic-auth-ui/components/name-field/name-field.component.js +0 -30
  78. package/esm2015/ionic-auth-ui/components/or-divider/or-divider.component.js +0 -11
  79. package/esm2015/ionic-auth-ui/components/password-field/password-field.component.js +0 -138
  80. package/esm2015/ionic-auth-ui/components/password-field/passwordValidatorFunctions.js +0 -62
  81. package/esm2015/ionic-auth-ui/components/providers/providers.component.js +0 -70
  82. package/esm2015/ionic-auth-ui/components/reauthenticate/reauthenticate.component.js +0 -99
  83. package/esm2015/ionic-auth-ui/components/register/register.component.js +0 -142
  84. package/esm2015/ionic-auth-ui/components/register-with-email/register-with-email.component.js +0 -60
  85. package/esm2015/ionic-auth-ui/components/register-with-email-popover/register-with-email-popover.component.js +0 -26
  86. package/esm2015/ionic-auth-ui/components/signin/signin.component.js +0 -92
  87. package/esm2015/ionic-auth-ui/components/terms-field/terms-field.component.js +0 -99
  88. package/esm2015/ionic-auth-ui/components/user/user.component.js +0 -195
  89. package/esm2015/ionic-auth-ui/ionic-auth-ui.module.js +0 -92
  90. package/esm2015/ionic-auth-ui/ngx-firebase-ionic-auth-ui.js +0 -23
  91. package/esm2015/ionic-auth-ui/pages/index.js +0 -5
  92. package/esm2015/ionic-auth-ui/pages/register/index.js +0 -2
  93. package/esm2015/ionic-auth-ui/pages/register/register.page.js +0 -56
  94. package/esm2015/ionic-auth-ui/pages/signin/index.js +0 -2
  95. package/esm2015/ionic-auth-ui/pages/signin/signin.page.js +0 -78
  96. package/esm2015/ionic-auth-ui/pages/user/index.js +0 -2
  97. package/esm2015/ionic-auth-ui/pages/user/user.page.js +0 -11
  98. package/esm2015/ionic-auth-ui/pages/verifyemail/index.js +0 -2
  99. package/esm2015/ionic-auth-ui/pages/verifyemail/verifyemail.page.js +0 -85
  100. package/esm2015/ionic-auth-ui/public-api.js +0 -5
  101. package/esm2015/ngx-firebase.js +0 -6
  102. package/esm2015/public-api.js +0 -6
  103. package/esm2015/shared/guards/index.js +0 -3
  104. package/esm2015/shared/guards/logged-in.guard.js +0 -60
  105. package/esm2015/shared/guards/verify-email.guard.js +0 -41
  106. package/esm2015/shared/interfaces/accounts.enum.js +0 -9
  107. package/esm2015/shared/interfaces/authprovider.enum.js +0 -15
  108. package/esm2015/shared/interfaces/config.interface.js +0 -61
  109. package/esm2015/shared/interfaces/index.js +0 -8
  110. package/esm2015/shared/interfaces/main.interface.js +0 -7
  111. package/esm2015/shared/interfaces/providers.interface.js +0 -2
  112. package/esm2015/shared/interfaces/tokens.js +0 -19
  113. package/esm2015/shared/interfaces/ui-providers.interface.js +0 -2
  114. package/esm2015/shared/services/analytics.service.js +0 -24
  115. package/esm2015/shared/services/auth-process.service.js +0 -779
  116. package/esm2015/shared/services/crashlytics.service.js +0 -42
  117. package/esm2015/shared/services/device-info.service.js +0 -14
  118. package/esm2015/shared/services/firebase.service.js +0 -37
  119. package/esm2015/shared/services/firestore-sync.service.js +0 -60
  120. package/esm2015/shared/services/index.js +0 -10
  121. package/esm2015/shared/services/performance.service.js +0 -28
  122. package/esm2015/shared/services/remoteconfig.service.js +0 -49
  123. package/esm2015/shared/services/ui.service.js +0 -45
  124. package/esm2015/shared/shared.module.js +0 -175
  125. package/esm2015/shared/types/DisplayWidth.js +0 -9
  126. package/esm2015/shared/types/Location.js +0 -2
  127. package/esm2015/shared/types/ValueAccessorControlComponent.js +0 -85
  128. package/esm2015/shared/types/ValueAccessorValueComponent.js +0 -40
  129. package/esm2015/shared/types/index.js +0 -5
  130. package/esm2015/testing/fakeavatar.module.js +0 -22
  131. package/esm2015/testing/fakes/FakeAuthProcessService.js +0 -31
  132. package/esm2015/testing/fakes/FakeAvatarComponent.js +0 -13
  133. package/esm2015/testing/fakes/FakeFireService.js +0 -21
  134. package/esm2015/testing/fakes/FakeFirestoreSyncService.js +0 -11
  135. package/esm2015/testing/fakes/FakeIAPurchaseService.js +0 -11
  136. package/esm2015/testing/fakes/FakePickerService.js +0 -9
  137. package/esm2015/testing/fakes/FakeRemoteConfigService.js +0 -44
  138. package/esm2015/testing/fakes/FakeTranslateService.js +0 -21
  139. package/esm2015/testing/fakes/FakeUiService.js +0 -26
  140. package/esm2015/testing/fakes/angular-fire/FakeAngularFireAuth.js +0 -30
  141. package/esm2015/testing/fakes/angular-fire/FakeAngularFireFunctions.js +0 -17
  142. package/esm2015/testing/fakes/angular-fire/FakeAngularFirePerformance.js +0 -17
  143. package/esm2015/testing/fakes/angular-fire/FakeAngularFireStorage.js +0 -8
  144. package/esm2015/testing/fakes/angular-fire/FakeAngularFirestore.js +0 -8
  145. package/esm2015/testing/fakes/angular-fire/FakeUserCredential.js +0 -18
  146. package/esm2015/testing/fakes/index.js +0 -19
  147. package/esm2015/testing/ngx-firebase-testing.js +0 -6
  148. package/esm2015/testing/public-api.js +0 -5
  149. package/esm2015/testing/test.module.js +0 -66
  150. package/esm2015/testing/utils/index.js +0 -17
  151. package/esm2015/testing/utils/patchConsole.js +0 -14
  152. package/fesm2015/ngx-firebase-capacitor.js +0 -328
  153. package/fesm2015/ngx-firebase-capacitor.js.map +0 -1
  154. package/fesm2015/ngx-firebase-iap.js +0 -354
  155. package/fesm2015/ngx-firebase-iap.js.map +0 -1
  156. package/fesm2015/ngx-firebase-ionic-auth-ui.js +0 -1482
  157. package/fesm2015/ngx-firebase-ionic-auth-ui.js.map +0 -1
  158. package/fesm2015/ngx-firebase-ionic.js +0 -495
  159. package/fesm2015/ngx-firebase-ionic.js.map +0 -1
  160. package/fesm2015/ngx-firebase-testing.js +0 -388
  161. package/fesm2015/ngx-firebase-testing.js.map +0 -1
  162. package/fesm2015/ngx-firebase.js +0 -1509
  163. package/fesm2015/ngx-firebase.js.map +0 -1
  164. package/iap/iap.module.d.ts +0 -5
  165. package/iap/interfaces/index.d.ts +0 -11
  166. package/iap/ngx-firebase-iap.d.ts +0 -4
  167. package/iap/ngx-firebase-iap.metadata.json +0 -1
  168. package/iap/package.json +0 -23
  169. package/iap/public-api.d.ts +0 -4
  170. package/iap/services/iap.service.d.ts +0 -47
  171. package/iap/tokens/index.d.ts +0 -3
  172. package/ionic/animations/index.d.ts +0 -1
  173. package/ionic/components/avatar/avatar.component.d.ts +0 -27
  174. package/ionic/components/avatar/index.d.ts +0 -1
  175. package/ionic/components/index.d.ts +0 -2
  176. package/ionic/components/popover-menu/index.d.ts +0 -2
  177. package/ionic/components/popover-menu/interface.d.ts +0 -6
  178. package/ionic/components/popover-menu/popover-menu.component.d.ts +0 -10
  179. package/ionic/ionic.module.d.ts +0 -2
  180. package/ionic/ngx-firebase-ionic.d.ts +0 -4
  181. package/ionic/ngx-firebase-ionic.metadata.json +0 -1
  182. package/ionic/package.json +0 -30
  183. package/ionic/public-api.d.ts +0 -4
  184. package/ionic/services/alerts-ionic.service.d.ts +0 -13
  185. package/ionic/services/index.d.ts +0 -5
  186. package/ionic/services/legality-dialog-ionic.service.d.ts +0 -10
  187. package/ionic/services/loading-ionic.service.d.ts +0 -17
  188. package/ionic/services/picker-ionic.service.d.ts +0 -9
  189. package/ionic/services/toast-ionic.service.d.ts +0 -11
  190. package/ionic-auth-ui/animations/index.d.ts +0 -1
  191. package/ionic-auth-ui/components/email-confirmation/email-confirmation.component.d.ts +0 -31
  192. package/ionic-auth-ui/components/email-field/email-field.component.d.ts +0 -7
  193. package/ionic-auth-ui/components/form-field/form-field.component.d.ts +0 -28
  194. package/ionic-auth-ui/components/index.d.ts +0 -11
  195. package/ionic-auth-ui/components/name-field/name-field.component.d.ts +0 -8
  196. package/ionic-auth-ui/components/or-divider/or-divider.component.d.ts +0 -2
  197. package/ionic-auth-ui/components/password-field/password-field.component.d.ts +0 -34
  198. package/ionic-auth-ui/components/password-field/passwordValidatorFunctions.d.ts +0 -4
  199. package/ionic-auth-ui/components/providers/providers.component.d.ts +0 -26
  200. package/ionic-auth-ui/components/reauthenticate/reauthenticate.component.d.ts +0 -30
  201. package/ionic-auth-ui/components/register/register.component.d.ts +0 -26
  202. package/ionic-auth-ui/components/register-with-email/register-with-email.component.d.ts +0 -24
  203. package/ionic-auth-ui/components/register-with-email-popover/register-with-email-popover.component.d.ts +0 -7
  204. package/ionic-auth-ui/components/signin/signin.component.d.ts +0 -28
  205. package/ionic-auth-ui/components/terms-field/terms-field.component.d.ts +0 -27
  206. package/ionic-auth-ui/components/user/user.component.d.ts +0 -45
  207. package/ionic-auth-ui/ionic-auth-ui.module.d.ts +0 -32
  208. package/ionic-auth-ui/ngx-firebase-ionic-auth-ui.d.ts +0 -22
  209. package/ionic-auth-ui/ngx-firebase-ionic-auth-ui.metadata.json +0 -1
  210. package/ionic-auth-ui/package.json +0 -30
  211. package/ionic-auth-ui/pages/index.d.ts +0 -4
  212. package/ionic-auth-ui/pages/register/index.d.ts +0 -1
  213. package/ionic-auth-ui/pages/register/register.page.d.ts +0 -16
  214. package/ionic-auth-ui/pages/signin/index.d.ts +0 -1
  215. package/ionic-auth-ui/pages/signin/signin.page.d.ts +0 -22
  216. package/ionic-auth-ui/pages/user/index.d.ts +0 -1
  217. package/ionic-auth-ui/pages/user/user.page.d.ts +0 -3
  218. package/ionic-auth-ui/pages/verifyemail/index.d.ts +0 -1
  219. package/ionic-auth-ui/pages/verifyemail/verifyemail.page.d.ts +0 -19
  220. package/ionic-auth-ui/public-api.d.ts +0 -4
  221. package/ngx-firebase.d.ts +0 -5
  222. package/ngx-firebase.metadata.json +0 -1
  223. package/public-api.d.ts +0 -5
  224. package/shared/guards/index.d.ts +0 -2
  225. package/shared/guards/logged-in.guard.d.ts +0 -13
  226. package/shared/guards/verify-email.guard.d.ts +0 -11
  227. package/shared/interfaces/accounts.enum.d.ts +0 -7
  228. package/shared/interfaces/authprovider.enum.d.ts +0 -13
  229. package/shared/interfaces/config.interface.d.ts +0 -63
  230. package/shared/interfaces/index.d.ts +0 -7
  231. package/shared/interfaces/main.interface.d.ts +0 -13
  232. package/shared/interfaces/providers.interface.d.ts +0 -70
  233. package/shared/interfaces/tokens.d.ts +0 -16
  234. package/shared/interfaces/ui-providers.interface.d.ts +0 -66
  235. package/shared/services/analytics.service.d.ts +0 -10
  236. package/shared/services/auth-process.service.d.ts +0 -197
  237. package/shared/services/crashlytics.service.d.ts +0 -11
  238. package/shared/services/device-info.service.d.ts +0 -3
  239. package/shared/services/firebase.service.d.ts +0 -16
  240. package/shared/services/firestore-sync.service.d.ts +0 -16
  241. package/shared/services/index.d.ts +0 -9
  242. package/shared/services/performance.service.d.ts +0 -12
  243. package/shared/services/remoteconfig.service.d.ts +0 -18
  244. package/shared/services/ui.service.d.ts +0 -22
  245. package/shared/shared.module.d.ts +0 -14
  246. package/shared/types/DisplayWidth.d.ts +0 -7
  247. package/shared/types/Location.d.ts +0 -8
  248. package/shared/types/ValueAccessorControlComponent.d.ts +0 -27
  249. package/shared/types/ValueAccessorValueComponent.d.ts +0 -19
  250. package/shared/types/index.d.ts +0 -4
  251. package/testing/fakeavatar.module.d.ts +0 -2
  252. package/testing/fakes/FakeAuthProcessService.d.ts +0 -28
  253. package/testing/fakes/FakeAvatarComponent.d.ts +0 -3
  254. package/testing/fakes/FakeFireService.d.ts +0 -20
  255. package/testing/fakes/FakeFirestoreSyncService.d.ts +0 -9
  256. package/testing/fakes/FakeIAPurchaseService.d.ts +0 -9
  257. package/testing/fakes/FakePickerService.d.ts +0 -6
  258. package/testing/fakes/FakeRemoteConfigService.d.ts +0 -19
  259. package/testing/fakes/FakeTranslateService.d.ts +0 -15
  260. package/testing/fakes/FakeUiService.d.ts +0 -25
  261. package/testing/fakes/angular-fire/FakeAngularFireAuth.d.ts +0 -52
  262. package/testing/fakes/angular-fire/FakeAngularFireFunctions.d.ts +0 -11
  263. package/testing/fakes/angular-fire/FakeAngularFirePerformance.d.ts +0 -10
  264. package/testing/fakes/angular-fire/FakeAngularFireStorage.d.ts +0 -5
  265. package/testing/fakes/angular-fire/FakeAngularFirestore.d.ts +0 -5
  266. package/testing/fakes/angular-fire/FakeUserCredential.d.ts +0 -9
  267. package/testing/fakes/index.d.ts +0 -16
  268. package/testing/ngx-firebase-testing.d.ts +0 -5
  269. package/testing/ngx-firebase-testing.metadata.json +0 -1
  270. package/testing/package.json +0 -29
  271. package/testing/public-api.d.ts +0 -4
  272. package/testing/test.module.d.ts +0 -4
  273. package/testing/utils/index.d.ts +0 -5
  274. package/testing/utils/patchConsole.d.ts +0 -4
package/README.md CHANGED
@@ -1,24 +1,132 @@
1
- # Mal
1
+ # @ngx-firebase
2
2
 
3
- This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.13.
3
+ A lightweight, drop-in, and zoneless-friendly wrapper around the native **Firebase JS SDK** for **Angular 22+**.
4
4
 
5
- ## Code scaffolding
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
- Run `ng generate component component-name --project mal` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project mal`.
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
- ## Build
9
+ ## ⚡ Features
11
10
 
12
- Run `ng build mal` to build the project. The build artifacts will be stored in the `dist/` directory.
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
- ## Publishing
17
+ ---
15
18
 
16
- After building your library with `ng build mal`, go to the dist folder `cd dist/mal` and run `npm publish`.
19
+ ## 📦 Installation
17
20
 
18
- ## Running unit tests
21
+ Install both the library and the native Firebase SDK:
19
22
 
20
- Run `ng test mal` to execute the unit tests via [Karma](https://karma-runner.github.io).
23
+ ```bash
24
+ npm install ngx-firebase firebase
25
+ ```
21
26
 
22
- ## Further help
27
+ ---
23
28
 
24
- To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
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": "1.1.13",
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/animations": "^11.2.5",
7
- "@angular/cdk": "^11.2.4",
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.3"
32
+ "tslib": "^2.3.0"
25
33
  },
26
- "repository": {
27
- "type": "git",
28
- "url": "https://github.com/mcroker/ngx-firebase.git"
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
- "main": "bundles/ngx-firebase.umd.js",
31
- "module": "fesm2015/ngx-firebase.js",
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 };