@angular/fire 7.6.1 → 16.0.0-canary.e04cd7f

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 (455) hide show
  1. package/analytics/is-analytics-supported-factory.d.ts +4 -0
  2. package/auth-guard/auth-guard.d.ts +4 -4
  3. package/compat/auth/auth.d.ts +1 -1
  4. package/compat/auth-guard/auth-guard.d.ts +6 -4
  5. package/compat/database/interfaces.d.ts +12 -12
  6. package/compat/firestore/interfaces.d.ts +17 -17
  7. package/compat/proxy.d.ts +8 -8
  8. package/compat/remote-config/interfaces.d.ts +1 -1
  9. package/compat/storage/interfaces.d.ts +8 -8
  10. package/compat/storage/pipes/storageUrl.pipe.d.ts +1 -1
  11. package/core.d.ts +1 -12
  12. package/esm2022/analytics/analytics.module.mjs +94 -0
  13. package/esm2022/analytics/is-analytics-supported-factory.mjs +16 -0
  14. package/esm2022/analytics/overrides.mjs +3 -0
  15. package/esm2022/analytics/screen-tracking.service.mjs +147 -0
  16. package/esm2022/analytics/user-tracking.service.mjs +44 -0
  17. package/esm2022/app/app.module.mjs +84 -0
  18. package/esm2022/app-check/app-check.module.mjs +80 -0
  19. package/{esm2015/auth/auth.module.js → esm2022/auth/auth.module.mjs} +8 -8
  20. package/esm2022/auth-guard/auth-guard.mjs +51 -0
  21. package/{esm2015/auth-guard/auth-guard.module.js → esm2022/auth-guard/auth-guard.module.mjs} +5 -5
  22. package/esm2022/compat/analytics/analytics.mjs +161 -0
  23. package/{esm2015/compat/analytics/analytics.module.js → esm2022/compat/analytics/analytics.module.mjs} +5 -5
  24. package/esm2022/compat/analytics/screen-tracking.service.mjs +49 -0
  25. package/esm2022/compat/analytics/user-tracking.service.mjs +53 -0
  26. package/esm2022/compat/auth/auth.mjs +161 -0
  27. package/{esm2015/compat/auth/auth.module.js → esm2022/compat/auth/auth.module.mjs} +5 -5
  28. package/{esm2015/compat/auth/public_api.js → esm2022/compat/auth/public_api.mjs} +1 -1
  29. package/esm2022/compat/auth-guard/auth-guard.mjs +51 -0
  30. package/{esm2015/compat/auth-guard/auth-guard.module.js → esm2022/compat/auth-guard/auth-guard.module.mjs} +5 -5
  31. package/{esm2015/compat/cache.js → esm2022/compat/cache.mjs} +3 -3
  32. package/esm2022/compat/database/database.mjs +119 -0
  33. package/{esm2015/compat/database/database.module.js → esm2022/compat/database/database.module.mjs} +5 -5
  34. package/esm2022/compat/database/list/create-reference.mjs +44 -0
  35. package/{esm2015/compat/firebase.app.module.js → esm2022/compat/firebase.app.module.mjs} +11 -11
  36. package/esm2022/compat/firestore/collection/changes.mjs +108 -0
  37. package/esm2022/compat/firestore/collection/collection.mjs +123 -0
  38. package/esm2022/compat/firestore/collection-group/collection-group.mjs +86 -0
  39. package/esm2022/compat/firestore/document/document.mjs +87 -0
  40. package/esm2022/compat/firestore/firestore.mjs +257 -0
  41. package/{esm2015/compat/firestore/firestore.module.js → esm2022/compat/firestore/firestore.module.mjs} +5 -5
  42. package/esm2022/compat/firestore/interfaces.mjs +2 -0
  43. package/esm2022/compat/firestore/observable/fromRef.mjs +40 -0
  44. package/esm2022/compat/functions/functions.mjs +69 -0
  45. package/{esm2015/compat/functions/functions.module.js → esm2022/compat/functions/functions.module.mjs} +5 -5
  46. package/{esm2015/compat/functions/public_api.js → esm2022/compat/functions/public_api.mjs} +1 -1
  47. package/esm2022/compat/messaging/messaging.mjs +80 -0
  48. package/{esm2015/compat/messaging/messaging.module.js → esm2022/compat/messaging/messaging.module.mjs} +5 -5
  49. package/{esm2015/compat/performance/performance.js → esm2022/compat/performance/performance.mjs} +7 -6
  50. package/{esm2015/compat/performance/performance.module.js → esm2022/compat/performance/performance.module.mjs} +5 -5
  51. package/esm2022/compat/performance/performance.service.mjs +27 -0
  52. package/esm2022/compat/proxy.mjs +59 -0
  53. package/esm2022/compat/remote-config/remote-config.mjs +207 -0
  54. package/{esm2015/compat/remote-config/remote-config.module.js → esm2022/compat/remote-config/remote-config.module.mjs} +5 -5
  55. package/esm2022/compat/storage/pipes/storageUrl.pipe.mjs +58 -0
  56. package/esm2022/compat/storage/storage.mjs +95 -0
  57. package/{esm2015/compat/storage/storage.module.js → esm2022/compat/storage/storage.module.mjs} +5 -5
  58. package/esm2022/core.mjs +37 -0
  59. package/{esm2015/database/database.module.js → esm2022/database/database.module.mjs} +8 -8
  60. package/{esm2015/firestore/firestore.module.js → esm2022/firestore/firestore.module.mjs} +8 -8
  61. package/{esm2015/firestore/lite/lite.module.js → esm2022/firestore/lite/lite.module.mjs} +8 -8
  62. package/esm2022/firestore/rxfire.mjs +15 -0
  63. package/{esm2015/functions/functions.module.js → esm2022/functions/functions.module.mjs} +8 -8
  64. package/esm2022/messaging/is-messaging-supported-factory.mjs +16 -0
  65. package/esm2022/messaging/messaging.module.mjs +86 -0
  66. package/esm2022/messaging/overrides.mjs +3 -0
  67. package/{esm2015/performance/performance.module.js → esm2022/performance/performance.module.mjs} +8 -8
  68. package/esm2022/remote-config/is-remote-config-supported-factory.mjs +16 -0
  69. package/esm2022/remote-config/overrides.mjs +3 -0
  70. package/esm2022/remote-config/remote-config.module.mjs +86 -0
  71. package/{esm2015/storage/storage.module.js → esm2022/storage/storage.module.mjs} +8 -8
  72. package/esm2022/zones.mjs +196 -0
  73. package/{fesm2015/angular-fire-analytics.js → fesm2022/angular-fire-analytics.mjs} +61 -38
  74. package/fesm2022/angular-fire-analytics.mjs.map +1 -0
  75. package/{fesm2015/angular-fire-app-check.js → fesm2022/angular-fire-app-check.mjs} +9 -10
  76. package/fesm2022/angular-fire-app-check.mjs.map +1 -0
  77. package/{fesm2015/angular-fire-app.js → fesm2022/angular-fire-app.mjs} +8 -8
  78. package/fesm2022/angular-fire-app.mjs.map +1 -0
  79. package/{fesm2015/angular-fire-auth-guard.js → fesm2022/angular-fire-auth-guard.mjs} +25 -23
  80. package/fesm2022/angular-fire-auth-guard.mjs.map +1 -0
  81. package/{fesm2015/angular-fire-auth.js → fesm2022/angular-fire-auth.mjs} +8 -8
  82. package/fesm2022/angular-fire-auth.mjs.map +1 -0
  83. package/{fesm2015/angular-fire-compat-analytics.js → fesm2022/angular-fire-compat-analytics.mjs} +28 -28
  84. package/fesm2022/angular-fire-compat-analytics.mjs.map +1 -0
  85. package/{fesm2015/angular-fire-compat-auth-guard.js → fesm2022/angular-fire-compat-auth-guard.mjs} +25 -23
  86. package/fesm2022/angular-fire-compat-auth-guard.mjs.map +1 -0
  87. package/{fesm2015/angular-fire-compat-auth.js → fesm2022/angular-fire-compat-auth.mjs} +32 -10
  88. package/fesm2022/angular-fire-compat-auth.mjs.map +1 -0
  89. package/{fesm2015/angular-fire-compat-database.js → fesm2022/angular-fire-compat-database.mjs} +17 -12
  90. package/fesm2022/angular-fire-compat-database.mjs.map +1 -0
  91. package/{fesm2015/angular-fire-compat-firestore.js → fesm2022/angular-fire-compat-firestore.mjs} +37 -16
  92. package/fesm2022/angular-fire-compat-firestore.mjs.map +1 -0
  93. package/{fesm2015/angular-fire-compat-functions.js → fesm2022/angular-fire-compat-functions.mjs} +10 -9
  94. package/fesm2022/angular-fire-compat-functions.mjs.map +1 -0
  95. package/{fesm2015/angular-fire-compat-messaging.js → fesm2022/angular-fire-compat-messaging.mjs} +20 -15
  96. package/fesm2022/angular-fire-compat-messaging.mjs.map +1 -0
  97. package/{fesm2015/angular-fire-compat-performance.js → fesm2022/angular-fire-compat-performance.mjs} +16 -15
  98. package/fesm2022/angular-fire-compat-performance.mjs.map +1 -0
  99. package/{fesm2015/angular-fire-compat-remote-config.js → fesm2022/angular-fire-compat-remote-config.mjs} +33 -19
  100. package/fesm2022/angular-fire-compat-remote-config.mjs.map +1 -0
  101. package/{fesm2015/angular-fire-compat-storage.js → fesm2022/angular-fire-compat-storage.mjs} +23 -18
  102. package/fesm2022/angular-fire-compat-storage.mjs.map +1 -0
  103. package/{fesm2015/angular-fire-compat.js → fesm2022/angular-fire-compat.mjs} +15 -17
  104. package/fesm2022/angular-fire-compat.mjs.map +1 -0
  105. package/{fesm2015/angular-fire-database.js → fesm2022/angular-fire-database.mjs} +8 -8
  106. package/fesm2022/angular-fire-database.mjs.map +1 -0
  107. package/{fesm2015/angular-fire-firestore-lite.js → fesm2022/angular-fire-firestore-lite.mjs} +8 -8
  108. package/fesm2022/angular-fire-firestore-lite.mjs.map +1 -0
  109. package/{fesm2015/angular-fire-firestore.js → fesm2022/angular-fire-firestore.mjs} +12 -10
  110. package/fesm2022/angular-fire-firestore.mjs.map +1 -0
  111. package/{fesm2015/angular-fire-functions.js → fesm2022/angular-fire-functions.mjs} +8 -8
  112. package/fesm2022/angular-fire-functions.mjs.map +1 -0
  113. package/{fesm2015/angular-fire-messaging.js → fesm2022/angular-fire-messaging.mjs} +33 -19
  114. package/fesm2022/angular-fire-messaging.mjs.map +1 -0
  115. package/{fesm2015/angular-fire-performance.js → fesm2022/angular-fire-performance.mjs} +8 -8
  116. package/fesm2022/angular-fire-performance.mjs.map +1 -0
  117. package/{fesm2015/angular-fire-remote-config.js → fesm2022/angular-fire-remote-config.mjs} +34 -20
  118. package/fesm2022/angular-fire-remote-config.mjs.map +1 -0
  119. package/{fesm2015/angular-fire-storage.js → fesm2022/angular-fire-storage.mjs} +8 -8
  120. package/fesm2022/angular-fire-storage.mjs.map +1 -0
  121. package/{fesm2015/angular-fire.js → fesm2022/angular-fire.mjs} +23 -52
  122. package/fesm2022/angular-fire.mjs.map +1 -0
  123. package/firestore/rxfire.d.ts +3 -1
  124. package/messaging/is-messaging-supported-factory.d.ts +4 -0
  125. package/package.json +158 -7
  126. package/publish.sh +1 -0
  127. package/remote-config/is-remote-config-supported-factory.d.ts +4 -0
  128. package/schematics/add/index.js +1 -1
  129. package/schematics/common.js +8 -4
  130. package/schematics/deploy/actions.js +59 -59
  131. package/schematics/deploy/builder.js +5 -5
  132. package/schematics/firebaseTools.js +9 -5
  133. package/schematics/setup/index.js +24 -23
  134. package/schematics/setup/prompts.js +20 -15
  135. package/schematics/update/v7/index.js +5 -5
  136. package/schematics/utils.js +30 -30
  137. package/README.md +0 -216
  138. package/analytics/package.json +0 -11
  139. package/app/package.json +0 -11
  140. package/app-check/package.json +0 -11
  141. package/auth/package.json +0 -11
  142. package/auth-guard/package.json +0 -11
  143. package/bundles/angular-fire-analytics.umd.js +0 -673
  144. package/bundles/angular-fire-analytics.umd.js.map +0 -1
  145. package/bundles/angular-fire-app-check.umd.js +0 -465
  146. package/bundles/angular-fire-app-check.umd.js.map +0 -1
  147. package/bundles/angular-fire-app.umd.js +0 -477
  148. package/bundles/angular-fire-app.umd.js.map +0 -1
  149. package/bundles/angular-fire-auth-guard.umd.js +0 -109
  150. package/bundles/angular-fire-auth-guard.umd.js.map +0 -1
  151. package/bundles/angular-fire-auth.umd.js +0 -557
  152. package/bundles/angular-fire-auth.umd.js.map +0 -1
  153. package/bundles/angular-fire-compat-analytics.umd.js +0 -672
  154. package/bundles/angular-fire-compat-analytics.umd.js.map +0 -1
  155. package/bundles/angular-fire-compat-auth-guard.umd.js +0 -112
  156. package/bundles/angular-fire-compat-auth-guard.umd.js.map +0 -1
  157. package/bundles/angular-fire-compat-auth.umd.js +0 -559
  158. package/bundles/angular-fire-compat-auth.umd.js.map +0 -1
  159. package/bundles/angular-fire-compat-database.umd.js +0 -799
  160. package/bundles/angular-fire-compat-database.umd.js.map +0 -1
  161. package/bundles/angular-fire-compat-firestore.umd.js +0 -1073
  162. package/bundles/angular-fire-compat-firestore.umd.js.map +0 -1
  163. package/bundles/angular-fire-compat-functions.umd.js +0 -443
  164. package/bundles/angular-fire-compat-functions.umd.js.map +0 -1
  165. package/bundles/angular-fire-compat-messaging.umd.js +0 -465
  166. package/bundles/angular-fire-compat-messaging.umd.js.map +0 -1
  167. package/bundles/angular-fire-compat-performance.umd.js +0 -212
  168. package/bundles/angular-fire-compat-performance.umd.js.map +0 -1
  169. package/bundles/angular-fire-compat-remote-config.umd.js +0 -605
  170. package/bundles/angular-fire-compat-remote-config.umd.js.map +0 -1
  171. package/bundles/angular-fire-compat-storage.umd.js +0 -598
  172. package/bundles/angular-fire-compat-storage.umd.js.map +0 -1
  173. package/bundles/angular-fire-compat.umd.js +0 -535
  174. package/bundles/angular-fire-compat.umd.js.map +0 -1
  175. package/bundles/angular-fire-database.umd.js +0 -557
  176. package/bundles/angular-fire-database.umd.js.map +0 -1
  177. package/bundles/angular-fire-firestore-lite.umd.js +0 -531
  178. package/bundles/angular-fire-firestore-lite.umd.js.map +0 -1
  179. package/bundles/angular-fire-firestore.umd.js +0 -565
  180. package/bundles/angular-fire-firestore.umd.js.map +0 -1
  181. package/bundles/angular-fire-functions.umd.js +0 -461
  182. package/bundles/angular-fire-functions.umd.js.map +0 -1
  183. package/bundles/angular-fire-messaging.umd.js +0 -473
  184. package/bundles/angular-fire-messaging.umd.js.map +0 -1
  185. package/bundles/angular-fire-performance.umd.js +0 -473
  186. package/bundles/angular-fire-performance.umd.js.map +0 -1
  187. package/bundles/angular-fire-remote-config.umd.js +0 -499
  188. package/bundles/angular-fire-remote-config.umd.js.map +0 -1
  189. package/bundles/angular-fire-storage.umd.js +0 -485
  190. package/bundles/angular-fire-storage.umd.js.map +0 -1
  191. package/bundles/angular-fire.umd.js +0 -308
  192. package/bundles/angular-fire.umd.js.map +0 -1
  193. package/compat/analytics/package.json +0 -11
  194. package/compat/auth/package.json +0 -11
  195. package/compat/auth-guard/package.json +0 -11
  196. package/compat/database/package.json +0 -11
  197. package/compat/firestore/package.json +0 -11
  198. package/compat/functions/package.json +0 -11
  199. package/compat/messaging/package.json +0 -11
  200. package/compat/package.json +0 -11
  201. package/compat/performance/package.json +0 -11
  202. package/compat/remote-config/package.json +0 -11
  203. package/compat/storage/package.json +0 -11
  204. package/database/package.json +0 -11
  205. package/docs/analytics.md +0 -67
  206. package/docs/app-check.md +0 -53
  207. package/docs/auth.md +0 -165
  208. package/docs/compat/analytics/getting-started.md +0 -137
  209. package/docs/compat/auth/getting-started.md +0 -162
  210. package/docs/compat/auth/router-guards.md +0 -104
  211. package/docs/compat/emulators/emulators.md +0 -134
  212. package/docs/compat/firestore/collections.md +0 -326
  213. package/docs/compat/firestore/documents.md +0 -115
  214. package/docs/compat/firestore/offline-data.md +0 -39
  215. package/docs/compat/firestore/querying-collections.md +0 -204
  216. package/docs/compat/functions/functions.md +0 -166
  217. package/docs/compat/messaging/messaging.md +0 -232
  218. package/docs/compat/performance/getting-started.md +0 -132
  219. package/docs/compat/remote-config/getting-started.md +0 -134
  220. package/docs/compat/rtdb/lists.md +0 -257
  221. package/docs/compat/rtdb/objects.md +0 -182
  222. package/docs/compat/rtdb/querying-lists.md +0 -155
  223. package/docs/compat/storage/storage.md +0 -257
  224. package/docs/compat.md +0 -70
  225. package/docs/database.md +0 -175
  226. package/docs/deploy/getting-started.md +0 -204
  227. package/docs/firebase.json +0 -16
  228. package/docs/firestore.md +0 -148
  229. package/docs/functions.md +0 -52
  230. package/docs/images/analytics-illo_1x.png +0 -0
  231. package/docs/images/auth-illo_1x.png +0 -0
  232. package/docs/images/cloud-messaging-illo_1x.png +0 -0
  233. package/docs/images/database-illo_1x.png +0 -0
  234. package/docs/images/firestore-illo_1x.png +0 -0
  235. package/docs/images/functions-illo_1x.png +0 -0
  236. package/docs/images/hosting-illo_1x.png +0 -0
  237. package/docs/images/performance-illo_1x.png +0 -0
  238. package/docs/images/reCAPTCHA-logo@1x.png +0 -0
  239. package/docs/images/remote-config-illo_1x.png +0 -0
  240. package/docs/images/storage-illo_1x.png +0 -0
  241. package/docs/install-and-setup.md +0 -114
  242. package/docs/install-angular-cli-windows10.md +0 -82
  243. package/docs/messaging.md +0 -25
  244. package/docs/performance.md +0 -57
  245. package/docs/remote-config.md +0 -53
  246. package/docs/storage.md +0 -90
  247. package/docs/universal/cloud-functions.md +0 -75
  248. package/docs/universal/getting-started.md +0 -153
  249. package/docs/universal/prerendering.md +0 -72
  250. package/docs/version-4-upgrade.md +0 -119
  251. package/docs/version-5-upgrade.md +0 -82
  252. package/docs/version-6-upgrade.md +0 -16
  253. package/docs/version-7-upgrade.md +0 -298
  254. package/esm2015/analytics/analytics.module.js +0 -93
  255. package/esm2015/analytics/overrides.js +0 -3
  256. package/esm2015/analytics/screen-tracking.service.js +0 -139
  257. package/esm2015/analytics/user-tracking.service.js +0 -43
  258. package/esm2015/app/app.module.js +0 -84
  259. package/esm2015/app-check/app-check.module.js +0 -81
  260. package/esm2015/auth-guard/auth-guard.js +0 -49
  261. package/esm2015/compat/analytics/analytics.js +0 -163
  262. package/esm2015/compat/analytics/screen-tracking.service.js +0 -49
  263. package/esm2015/compat/analytics/user-tracking.service.js +0 -52
  264. package/esm2015/compat/auth/auth.js +0 -139
  265. package/esm2015/compat/auth-guard/auth-guard.js +0 -49
  266. package/esm2015/compat/database/database.js +0 -117
  267. package/esm2015/compat/database/list/create-reference.js +0 -41
  268. package/esm2015/compat/firestore/collection/changes.js +0 -107
  269. package/esm2015/compat/firestore/collection/collection.js +0 -117
  270. package/esm2015/compat/firestore/collection-group/collection-group.js +0 -81
  271. package/esm2015/compat/firestore/document/document.js +0 -82
  272. package/esm2015/compat/firestore/firestore.js +0 -254
  273. package/esm2015/compat/firestore/interfaces.js +0 -2
  274. package/esm2015/compat/firestore/observable/fromRef.js +0 -39
  275. package/esm2015/compat/functions/functions.js +0 -68
  276. package/esm2015/compat/messaging/messaging.js +0 -75
  277. package/esm2015/compat/performance/performance.service.js +0 -27
  278. package/esm2015/compat/proxy.js +0 -61
  279. package/esm2015/compat/remote-config/remote-config.js +0 -193
  280. package/esm2015/compat/storage/pipes/storageUrl.pipe.js +0 -54
  281. package/esm2015/compat/storage/storage.js +0 -94
  282. package/esm2015/core.js +0 -79
  283. package/esm2015/firestore/rxfire.js +0 -13
  284. package/esm2015/messaging/messaging.module.js +0 -85
  285. package/esm2015/messaging/overrides.js +0 -3
  286. package/esm2015/remote-config/overrides.js +0 -3
  287. package/esm2015/remote-config/remote-config.module.js +0 -85
  288. package/esm2015/zones.js +0 -183
  289. package/fesm2015/angular-fire-analytics.js.map +0 -1
  290. package/fesm2015/angular-fire-app-check.js.map +0 -1
  291. package/fesm2015/angular-fire-app.js.map +0 -1
  292. package/fesm2015/angular-fire-auth-guard.js.map +0 -1
  293. package/fesm2015/angular-fire-auth.js.map +0 -1
  294. package/fesm2015/angular-fire-compat-analytics.js.map +0 -1
  295. package/fesm2015/angular-fire-compat-auth-guard.js.map +0 -1
  296. package/fesm2015/angular-fire-compat-auth.js.map +0 -1
  297. package/fesm2015/angular-fire-compat-database.js.map +0 -1
  298. package/fesm2015/angular-fire-compat-firestore.js.map +0 -1
  299. package/fesm2015/angular-fire-compat-functions.js.map +0 -1
  300. package/fesm2015/angular-fire-compat-messaging.js.map +0 -1
  301. package/fesm2015/angular-fire-compat-performance.js.map +0 -1
  302. package/fesm2015/angular-fire-compat-remote-config.js.map +0 -1
  303. package/fesm2015/angular-fire-compat-storage.js.map +0 -1
  304. package/fesm2015/angular-fire-compat.js.map +0 -1
  305. package/fesm2015/angular-fire-database.js.map +0 -1
  306. package/fesm2015/angular-fire-firestore-lite.js.map +0 -1
  307. package/fesm2015/angular-fire-firestore.js.map +0 -1
  308. package/fesm2015/angular-fire-functions.js.map +0 -1
  309. package/fesm2015/angular-fire-messaging.js.map +0 -1
  310. package/fesm2015/angular-fire-performance.js.map +0 -1
  311. package/fesm2015/angular-fire-remote-config.js.map +0 -1
  312. package/fesm2015/angular-fire-storage.js.map +0 -1
  313. package/fesm2015/angular-fire.js.map +0 -1
  314. package/firestore/lite/package.json +0 -11
  315. package/firestore/package.json +0 -11
  316. package/firestore-protos.js +0 -4
  317. package/functions/package.json +0 -11
  318. package/messaging/package.json +0 -11
  319. package/performance/package.json +0 -11
  320. package/remote-config/package.json +0 -11
  321. package/schematics/add/schema.json +0 -16
  322. package/schematics/builders.json +0 -10
  323. package/schematics/collection.json +0 -15
  324. package/schematics/deploy/schema.json +0 -119
  325. package/schematics/migration.json +0 -15
  326. package/schematics/setup/schema.json +0 -16
  327. package/storage/package.json +0 -11
  328. /package/analytics/{angular-fire-analytics.d.ts → index.d.ts} +0 -0
  329. /package/app/{angular-fire-app.d.ts → index.d.ts} +0 -0
  330. /package/app-check/{angular-fire-app-check.d.ts → index.d.ts} +0 -0
  331. /package/auth/{angular-fire-auth.d.ts → index.d.ts} +0 -0
  332. /package/auth-guard/{angular-fire-auth-guard.d.ts → index.d.ts} +0 -0
  333. /package/compat/analytics/{angular-fire-compat-analytics.d.ts → index.d.ts} +0 -0
  334. /package/compat/auth/{angular-fire-compat-auth.d.ts → index.d.ts} +0 -0
  335. /package/compat/auth-guard/{angular-fire-compat-auth-guard.d.ts → index.d.ts} +0 -0
  336. /package/compat/database/{angular-fire-compat-database.d.ts → index.d.ts} +0 -0
  337. /package/compat/firestore/{angular-fire-compat-firestore.d.ts → index.d.ts} +0 -0
  338. /package/compat/functions/{angular-fire-compat-functions.d.ts → index.d.ts} +0 -0
  339. /package/compat/{angular-fire-compat.d.ts → index.d.ts} +0 -0
  340. /package/compat/messaging/{angular-fire-compat-messaging.d.ts → index.d.ts} +0 -0
  341. /package/compat/performance/{angular-fire-compat-performance.d.ts → index.d.ts} +0 -0
  342. /package/compat/remote-config/{angular-fire-compat-remote-config.d.ts → index.d.ts} +0 -0
  343. /package/compat/storage/{angular-fire-compat-storage.d.ts → index.d.ts} +0 -0
  344. /package/database/{angular-fire-database.d.ts → index.d.ts} +0 -0
  345. /package/{esm2015/analytics/analytics.js → esm2022/analytics/analytics.mjs} +0 -0
  346. /package/{esm2015/analytics/angular-fire-analytics.js → esm2022/analytics/angular-fire-analytics.mjs} +0 -0
  347. /package/{esm2015/analytics/firebase.js → esm2022/analytics/firebase.mjs} +0 -0
  348. /package/{esm2015/analytics/public_api.js → esm2022/analytics/public_api.mjs} +0 -0
  349. /package/{esm2015/angular-fire.js → esm2022/angular-fire.mjs} +0 -0
  350. /package/{esm2015/app/angular-fire-app.js → esm2022/app/angular-fire-app.mjs} +0 -0
  351. /package/{esm2015/app/app.js → esm2022/app/app.mjs} +0 -0
  352. /package/{esm2015/app/firebase.js → esm2022/app/firebase.mjs} +0 -0
  353. /package/{esm2015/app/public_api.js → esm2022/app/public_api.mjs} +0 -0
  354. /package/{esm2015/app-check/angular-fire-app-check.js → esm2022/app-check/angular-fire-app-check.mjs} +0 -0
  355. /package/{esm2015/app-check/app-check.js → esm2022/app-check/app-check.mjs} +0 -0
  356. /package/{esm2015/app-check/firebase.js → esm2022/app-check/firebase.mjs} +0 -0
  357. /package/{esm2015/app-check/public_api.js → esm2022/app-check/public_api.mjs} +0 -0
  358. /package/{esm2015/auth/angular-fire-auth.js → esm2022/auth/angular-fire-auth.mjs} +0 -0
  359. /package/{esm2015/auth/auth.js → esm2022/auth/auth.mjs} +0 -0
  360. /package/{esm2015/auth/firebase.js → esm2022/auth/firebase.mjs} +0 -0
  361. /package/{esm2015/auth/public_api.js → esm2022/auth/public_api.mjs} +0 -0
  362. /package/{esm2015/auth/rxfire.js → esm2022/auth/rxfire.mjs} +0 -0
  363. /package/{esm2015/auth-guard/angular-fire-auth-guard.js → esm2022/auth-guard/angular-fire-auth-guard.mjs} +0 -0
  364. /package/{esm2015/auth-guard/public_api.js → esm2022/auth-guard/public_api.mjs} +0 -0
  365. /package/{esm2015/compat/analytics/angular-fire-compat-analytics.js → esm2022/compat/analytics/angular-fire-compat-analytics.mjs} +0 -0
  366. /package/{esm2015/compat/analytics/base.js → esm2022/compat/analytics/base.mjs} +0 -0
  367. /package/{esm2015/compat/analytics/public_api.js → esm2022/compat/analytics/public_api.mjs} +0 -0
  368. /package/{esm2015/compat/angular-fire-compat.js → esm2022/compat/angular-fire-compat.mjs} +0 -0
  369. /package/{esm2015/compat/auth/angular-fire-compat-auth.js → esm2022/compat/auth/angular-fire-compat-auth.mjs} +0 -0
  370. /package/{esm2015/compat/auth/base.js → esm2022/compat/auth/base.mjs} +0 -0
  371. /package/{esm2015/compat/auth-guard/angular-fire-compat-auth-guard.js → esm2022/compat/auth-guard/angular-fire-compat-auth-guard.mjs} +0 -0
  372. /package/{esm2015/compat/auth-guard/public_api.js → esm2022/compat/auth-guard/public_api.mjs} +0 -0
  373. /package/{esm2015/compat/database/angular-fire-compat-database.js → esm2022/compat/database/angular-fire-compat-database.mjs} +0 -0
  374. /package/{esm2015/compat/database/interfaces.js → esm2022/compat/database/interfaces.mjs} +0 -0
  375. /package/{esm2015/compat/database/list/audit-trail.js → esm2022/compat/database/list/audit-trail.mjs} +0 -0
  376. /package/{esm2015/compat/database/list/changes.js → esm2022/compat/database/list/changes.mjs} +0 -0
  377. /package/{esm2015/compat/database/list/data-operation.js → esm2022/compat/database/list/data-operation.mjs} +0 -0
  378. /package/{esm2015/compat/database/list/remove.js → esm2022/compat/database/list/remove.mjs} +0 -0
  379. /package/{esm2015/compat/database/list/snapshot-changes.js → esm2022/compat/database/list/snapshot-changes.mjs} +0 -0
  380. /package/{esm2015/compat/database/list/state-changes.js → esm2022/compat/database/list/state-changes.mjs} +0 -0
  381. /package/{esm2015/compat/database/list/utils.js → esm2022/compat/database/list/utils.mjs} +0 -0
  382. /package/{esm2015/compat/database/object/create-reference.js → esm2022/compat/database/object/create-reference.mjs} +0 -0
  383. /package/{esm2015/compat/database/object/snapshot-changes.js → esm2022/compat/database/object/snapshot-changes.mjs} +0 -0
  384. /package/{esm2015/compat/database/observable/fromRef.js → esm2022/compat/database/observable/fromRef.mjs} +0 -0
  385. /package/{esm2015/compat/database/public_api.js → esm2022/compat/database/public_api.mjs} +0 -0
  386. /package/{esm2015/compat/database/utils.js → esm2022/compat/database/utils.mjs} +0 -0
  387. /package/{esm2015/compat/firebase.app.js → esm2022/compat/firebase.app.mjs} +0 -0
  388. /package/{esm2015/compat/firestore/angular-fire-compat-firestore.js → esm2022/compat/firestore/angular-fire-compat-firestore.mjs} +0 -0
  389. /package/{esm2015/compat/firestore/public_api.js → esm2022/compat/firestore/public_api.mjs} +0 -0
  390. /package/{esm2015/compat/functions/angular-fire-compat-functions.js → esm2022/compat/functions/angular-fire-compat-functions.mjs} +0 -0
  391. /package/{esm2015/compat/functions/base.js → esm2022/compat/functions/base.mjs} +0 -0
  392. /package/{esm2015/compat/messaging/angular-fire-compat-messaging.js → esm2022/compat/messaging/angular-fire-compat-messaging.mjs} +0 -0
  393. /package/{esm2015/compat/messaging/base.js → esm2022/compat/messaging/base.mjs} +0 -0
  394. /package/{esm2015/compat/messaging/public_api.js → esm2022/compat/messaging/public_api.mjs} +0 -0
  395. /package/{esm2015/compat/performance/angular-fire-compat-performance.js → esm2022/compat/performance/angular-fire-compat-performance.mjs} +0 -0
  396. /package/{esm2015/compat/performance/base.js → esm2022/compat/performance/base.mjs} +0 -0
  397. /package/{esm2015/compat/performance/public_api.js → esm2022/compat/performance/public_api.mjs} +0 -0
  398. /package/{esm2015/compat/public_api.js → esm2022/compat/public_api.mjs} +0 -0
  399. /package/{esm2015/compat/remote-config/angular-fire-compat-remote-config.js → esm2022/compat/remote-config/angular-fire-compat-remote-config.mjs} +0 -0
  400. /package/{esm2015/compat/remote-config/base.js → esm2022/compat/remote-config/base.mjs} +0 -0
  401. /package/{esm2015/compat/remote-config/interfaces.js → esm2022/compat/remote-config/interfaces.mjs} +0 -0
  402. /package/{esm2015/compat/remote-config/public_api.js → esm2022/compat/remote-config/public_api.mjs} +0 -0
  403. /package/{esm2015/compat/storage/angular-fire-compat-storage.js → esm2022/compat/storage/angular-fire-compat-storage.mjs} +0 -0
  404. /package/{esm2015/compat/storage/interfaces.js → esm2022/compat/storage/interfaces.mjs} +0 -0
  405. /package/{esm2015/compat/storage/observable/fromTask.js → esm2022/compat/storage/observable/fromTask.mjs} +0 -0
  406. /package/{esm2015/compat/storage/public_api.js → esm2022/compat/storage/public_api.mjs} +0 -0
  407. /package/{esm2015/compat/storage/ref.js → esm2022/compat/storage/ref.mjs} +0 -0
  408. /package/{esm2015/compat/storage/task.js → esm2022/compat/storage/task.mjs} +0 -0
  409. /package/{esm2015/database/angular-fire-database.js → esm2022/database/angular-fire-database.mjs} +0 -0
  410. /package/{esm2015/database/database.js → esm2022/database/database.mjs} +0 -0
  411. /package/{esm2015/database/firebase.js → esm2022/database/firebase.mjs} +0 -0
  412. /package/{esm2015/database/public_api.js → esm2022/database/public_api.mjs} +0 -0
  413. /package/{esm2015/database/rxfire.js → esm2022/database/rxfire.mjs} +0 -0
  414. /package/{esm2015/firestore/angular-fire-firestore.js → esm2022/firestore/angular-fire-firestore.mjs} +0 -0
  415. /package/{esm2015/firestore/firebase.js → esm2022/firestore/firebase.mjs} +0 -0
  416. /package/{esm2015/firestore/firestore.js → esm2022/firestore/firestore.mjs} +0 -0
  417. /package/{esm2015/firestore/lite/angular-fire-firestore-lite.js → esm2022/firestore/lite/angular-fire-firestore-lite.mjs} +0 -0
  418. /package/{esm2015/firestore/lite/firebase.js → esm2022/firestore/lite/firebase.mjs} +0 -0
  419. /package/{esm2015/firestore/lite/lite.js → esm2022/firestore/lite/lite.mjs} +0 -0
  420. /package/{esm2015/firestore/lite/public_api.js → esm2022/firestore/lite/public_api.mjs} +0 -0
  421. /package/{esm2015/firestore/lite/rxfire.js → esm2022/firestore/lite/rxfire.mjs} +0 -0
  422. /package/{esm2015/firestore/public_api.js → esm2022/firestore/public_api.mjs} +0 -0
  423. /package/{esm2015/functions/angular-fire-functions.js → esm2022/functions/angular-fire-functions.mjs} +0 -0
  424. /package/{esm2015/functions/firebase.js → esm2022/functions/firebase.mjs} +0 -0
  425. /package/{esm2015/functions/functions.js → esm2022/functions/functions.mjs} +0 -0
  426. /package/{esm2015/functions/public_api.js → esm2022/functions/public_api.mjs} +0 -0
  427. /package/{esm2015/functions/rxfire.js → esm2022/functions/rxfire.mjs} +0 -0
  428. /package/{esm2015/messaging/angular-fire-messaging.js → esm2022/messaging/angular-fire-messaging.mjs} +0 -0
  429. /package/{esm2015/messaging/firebase.js → esm2022/messaging/firebase.mjs} +0 -0
  430. /package/{esm2015/messaging/messaging.js → esm2022/messaging/messaging.mjs} +0 -0
  431. /package/{esm2015/messaging/public_api.js → esm2022/messaging/public_api.mjs} +0 -0
  432. /package/{esm2015/performance/angular-fire-performance.js → esm2022/performance/angular-fire-performance.mjs} +0 -0
  433. /package/{esm2015/performance/firebase.js → esm2022/performance/firebase.mjs} +0 -0
  434. /package/{esm2015/performance/performance.js → esm2022/performance/performance.mjs} +0 -0
  435. /package/{esm2015/performance/public_api.js → esm2022/performance/public_api.mjs} +0 -0
  436. /package/{esm2015/performance/rxfire.js → esm2022/performance/rxfire.mjs} +0 -0
  437. /package/{esm2015/public_api.js → esm2022/public_api.mjs} +0 -0
  438. /package/{esm2015/remote-config/angular-fire-remote-config.js → esm2022/remote-config/angular-fire-remote-config.mjs} +0 -0
  439. /package/{esm2015/remote-config/firebase.js → esm2022/remote-config/firebase.mjs} +0 -0
  440. /package/{esm2015/remote-config/public_api.js → esm2022/remote-config/public_api.mjs} +0 -0
  441. /package/{esm2015/remote-config/remote-config.js → esm2022/remote-config/remote-config.mjs} +0 -0
  442. /package/{esm2015/remote-config/rxfire.js → esm2022/remote-config/rxfire.mjs} +0 -0
  443. /package/{esm2015/storage/angular-fire-storage.js → esm2022/storage/angular-fire-storage.mjs} +0 -0
  444. /package/{esm2015/storage/firebase.js → esm2022/storage/firebase.mjs} +0 -0
  445. /package/{esm2015/storage/public_api.js → esm2022/storage/public_api.mjs} +0 -0
  446. /package/{esm2015/storage/rxfire.js → esm2022/storage/rxfire.mjs} +0 -0
  447. /package/{esm2015/storage/storage.js → esm2022/storage/storage.mjs} +0 -0
  448. /package/firestore/{angular-fire-firestore.d.ts → index.d.ts} +0 -0
  449. /package/firestore/lite/{angular-fire-firestore-lite.d.ts → index.d.ts} +0 -0
  450. /package/functions/{angular-fire-functions.d.ts → index.d.ts} +0 -0
  451. /package/{angular-fire.d.ts → index.d.ts} +0 -0
  452. /package/messaging/{angular-fire-messaging.d.ts → index.d.ts} +0 -0
  453. /package/performance/{angular-fire-performance.d.ts → index.d.ts} +0 -0
  454. /package/remote-config/{angular-fire-remote-config.d.ts → index.d.ts} +0 -0
  455. /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> &#10097; <a href="../README.md#developer-guide">Developer Guide</a> &#10097; 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
- ```