@angular/fire 16.0.0-canary.e04cd7f → 16.0.0-rc.0

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 (257) hide show
  1. package/README.md +223 -0
  2. package/analytics/analytics.module.d.ts +2 -2
  3. package/analytics/firebase.d.ts +4 -1
  4. package/analytics/screen-tracking.service.d.ts +3 -3
  5. package/app-check/app-check.d.ts +0 -6
  6. package/app-check/app-check.module.d.ts +3 -4
  7. package/app-check/firebase.d.ts +2 -1
  8. package/app-check/public_api.d.ts +2 -1
  9. package/auth/auth.module.d.ts +2 -2
  10. package/auth/firebase.d.ts +3 -1
  11. package/auth-guard/auth-guard.d.ts +2 -2
  12. package/compat/analytics/analytics.d.ts +1 -3
  13. package/compat/analytics/analytics.module.d.ts +1 -1
  14. package/compat/analytics/screen-tracking.service.d.ts +1 -1
  15. package/compat/analytics/user-tracking.service.d.ts +1 -1
  16. package/compat/auth/auth.d.ts +3 -3
  17. package/compat/auth-guard/auth-guard.d.ts +2 -2
  18. package/compat/database/database.d.ts +4 -4
  19. package/compat/database/interfaces.d.ts +2 -2
  20. package/compat/database/list/audit-trail.d.ts +1 -1
  21. package/compat/database/list/create-reference.d.ts +1 -1
  22. package/compat/database/list/data-operation.d.ts +1 -1
  23. package/compat/database/list/state-changes.d.ts +1 -1
  24. package/compat/database/object/create-reference.d.ts +1 -1
  25. package/compat/database/observable/fromRef.d.ts +1 -1
  26. package/compat/database/utils.d.ts +1 -1
  27. package/compat/firebase.app.module.d.ts +1 -1
  28. package/compat/firestore/collection/collection.d.ts +2 -2
  29. package/compat/firestore/collection-group/collection-group.d.ts +2 -2
  30. package/compat/firestore/document/document.d.ts +4 -4
  31. package/compat/firestore/firestore.d.ts +7 -7
  32. package/compat/firestore/interfaces.d.ts +2 -2
  33. package/compat/functions/functions.d.ts +3 -3
  34. package/compat/messaging/messaging.d.ts +2 -2
  35. package/compat/performance/performance.d.ts +2 -2
  36. package/compat/remote-config/remote-config.d.ts +15 -49
  37. package/compat/storage/observable/fromTask.d.ts +1 -2
  38. package/compat/storage/ref.d.ts +1 -1
  39. package/compat/storage/storage.d.ts +3 -3
  40. package/compat/storage/task.d.ts +1 -1
  41. package/core.d.ts +7 -0
  42. package/database/database.module.d.ts +2 -2
  43. package/docs/analytics.md +67 -0
  44. package/docs/app-check.md +53 -0
  45. package/docs/auth.md +165 -0
  46. package/docs/compat/analytics/getting-started.md +137 -0
  47. package/docs/compat/auth/getting-started.md +162 -0
  48. package/docs/compat/auth/router-guards.md +104 -0
  49. package/docs/compat/emulators/emulators.md +134 -0
  50. package/docs/compat/firestore/collections.md +326 -0
  51. package/docs/compat/firestore/documents.md +115 -0
  52. package/docs/compat/firestore/offline-data.md +39 -0
  53. package/docs/compat/firestore/querying-collections.md +204 -0
  54. package/docs/compat/functions/functions.md +166 -0
  55. package/docs/compat/messaging/messaging.md +232 -0
  56. package/docs/compat/performance/getting-started.md +132 -0
  57. package/docs/compat/remote-config/getting-started.md +134 -0
  58. package/docs/compat/rtdb/lists.md +257 -0
  59. package/docs/compat/rtdb/objects.md +182 -0
  60. package/docs/compat/rtdb/querying-lists.md +155 -0
  61. package/docs/compat/storage/storage.md +257 -0
  62. package/docs/compat.md +70 -0
  63. package/docs/database.md +175 -0
  64. package/docs/deploy/getting-started.md +204 -0
  65. package/docs/firebase.json +16 -0
  66. package/docs/firestore.md +148 -0
  67. package/docs/functions.md +52 -0
  68. package/docs/images/analytics-illo_1x.png +0 -0
  69. package/docs/images/auth-illo_1x.png +0 -0
  70. package/docs/images/cloud-messaging-illo_1x.png +0 -0
  71. package/docs/images/database-illo_1x.png +0 -0
  72. package/docs/images/firestore-illo_1x.png +0 -0
  73. package/docs/images/functions-illo_1x.png +0 -0
  74. package/docs/images/hosting-illo_1x.png +0 -0
  75. package/docs/images/performance-illo_1x.png +0 -0
  76. package/docs/images/reCAPTCHA-logo@1x.png +0 -0
  77. package/docs/images/remote-config-illo_1x.png +0 -0
  78. package/docs/images/storage-illo_1x.png +0 -0
  79. package/docs/install-and-setup.md +114 -0
  80. package/docs/install-angular-cli-windows10.md +82 -0
  81. package/docs/install-firebase-tools.md +78 -0
  82. package/docs/messaging.md +25 -0
  83. package/docs/performance.md +57 -0
  84. package/docs/remote-config.md +53 -0
  85. package/docs/storage.md +90 -0
  86. package/docs/universal/cloud-functions.md +96 -0
  87. package/docs/universal/getting-started.md +28 -0
  88. package/docs/universal/prerendering.md +72 -0
  89. package/docs/version-4-upgrade.md +119 -0
  90. package/docs/version-5-upgrade.md +82 -0
  91. package/docs/version-6-upgrade.md +16 -0
  92. package/docs/version-7-upgrade.md +298 -0
  93. package/esm2022/analytics/analytics.mjs +1 -1
  94. package/esm2022/analytics/analytics.module.mjs +10 -10
  95. package/esm2022/analytics/firebase.mjs +5 -2
  96. package/esm2022/analytics/screen-tracking.service.mjs +11 -10
  97. package/esm2022/analytics/user-tracking.service.mjs +5 -5
  98. package/esm2022/app/app.mjs +1 -1
  99. package/esm2022/app/app.module.mjs +9 -8
  100. package/esm2022/app-check/app-check.mjs +3 -9
  101. package/esm2022/app-check/app-check.module.mjs +12 -14
  102. package/esm2022/app-check/firebase.mjs +3 -2
  103. package/esm2022/app-check/public_api.mjs +3 -2
  104. package/esm2022/auth/auth.mjs +1 -1
  105. package/esm2022/auth/auth.module.mjs +11 -11
  106. package/esm2022/auth/firebase.mjs +4 -2
  107. package/esm2022/auth-guard/auth-guard.mjs +8 -6
  108. package/esm2022/auth-guard/auth-guard.module.mjs +7 -7
  109. package/esm2022/compat/analytics/analytics.mjs +12 -13
  110. package/esm2022/compat/analytics/analytics.module.mjs +14 -11
  111. package/esm2022/compat/analytics/screen-tracking.service.mjs +9 -9
  112. package/esm2022/compat/analytics/user-tracking.service.mjs +7 -7
  113. package/esm2022/compat/auth/auth.mjs +13 -13
  114. package/esm2022/compat/auth/auth.module.mjs +7 -7
  115. package/esm2022/compat/auth-guard/auth-guard.mjs +8 -6
  116. package/esm2022/compat/auth-guard/auth-guard.module.mjs +7 -7
  117. package/esm2022/compat/cache.mjs +2 -1
  118. package/esm2022/compat/database/database.mjs +10 -10
  119. package/esm2022/compat/database/database.module.mjs +7 -7
  120. package/esm2022/compat/database/interfaces.mjs +1 -1
  121. package/esm2022/compat/database/list/audit-trail.mjs +3 -3
  122. package/esm2022/compat/database/list/changes.mjs +5 -5
  123. package/esm2022/compat/database/list/create-reference.mjs +5 -5
  124. package/esm2022/compat/database/list/data-operation.mjs +1 -1
  125. package/esm2022/compat/database/list/snapshot-changes.mjs +1 -1
  126. package/esm2022/compat/database/list/state-changes.mjs +2 -2
  127. package/esm2022/compat/database/object/create-reference.mjs +2 -2
  128. package/esm2022/compat/database/object/snapshot-changes.mjs +1 -1
  129. package/esm2022/compat/database/observable/fromRef.mjs +3 -2
  130. package/esm2022/compat/database/utils.mjs +1 -1
  131. package/esm2022/compat/firebase.app.mjs +1 -1
  132. package/esm2022/compat/firebase.app.module.mjs +11 -9
  133. package/esm2022/compat/firestore/collection/changes.mjs +2 -2
  134. package/esm2022/compat/firestore/collection/collection.mjs +4 -4
  135. package/esm2022/compat/firestore/collection-group/collection-group.mjs +4 -4
  136. package/esm2022/compat/firestore/document/document.mjs +4 -4
  137. package/esm2022/compat/firestore/firestore.mjs +11 -11
  138. package/esm2022/compat/firestore/firestore.module.mjs +7 -7
  139. package/esm2022/compat/firestore/interfaces.mjs +1 -1
  140. package/esm2022/compat/firestore/observable/fromRef.mjs +2 -2
  141. package/esm2022/compat/functions/functions.mjs +8 -8
  142. package/esm2022/compat/functions/functions.module.mjs +7 -7
  143. package/esm2022/compat/messaging/messaging.mjs +13 -12
  144. package/esm2022/compat/messaging/messaging.module.mjs +7 -7
  145. package/esm2022/compat/performance/performance.mjs +14 -20
  146. package/esm2022/compat/performance/performance.module.mjs +8 -9
  147. package/esm2022/compat/performance/performance.service.mjs +5 -4
  148. package/esm2022/compat/proxy.mjs +6 -7
  149. package/esm2022/compat/remote-config/remote-config.mjs +10 -11
  150. package/esm2022/compat/remote-config/remote-config.module.mjs +7 -7
  151. package/esm2022/compat/storage/observable/fromTask.mjs +3 -1
  152. package/esm2022/compat/storage/pipes/storageUrl.pipe.mjs +9 -9
  153. package/esm2022/compat/storage/ref.mjs +3 -3
  154. package/esm2022/compat/storage/storage.mjs +8 -8
  155. package/esm2022/compat/storage/storage.module.mjs +7 -7
  156. package/esm2022/compat/storage/task.mjs +2 -2
  157. package/esm2022/core.mjs +7 -1
  158. package/esm2022/database/database.mjs +1 -1
  159. package/esm2022/database/database.module.mjs +11 -11
  160. package/esm2022/firestore/firebase.mjs +22 -2
  161. package/esm2022/firestore/firestore.mjs +1 -1
  162. package/esm2022/firestore/firestore.module.mjs +11 -11
  163. package/esm2022/firestore/lite/firebase.mjs +11 -2
  164. package/esm2022/firestore/lite/lite.mjs +1 -1
  165. package/esm2022/firestore/lite/lite.module.mjs +10 -11
  166. package/esm2022/firestore/lite/rxfire.mjs +4 -2
  167. package/esm2022/firestore/rxfire.mjs +4 -4
  168. package/esm2022/functions/functions.mjs +1 -1
  169. package/esm2022/functions/functions.module.mjs +11 -11
  170. package/esm2022/messaging/messaging.mjs +1 -1
  171. package/esm2022/messaging/messaging.module.mjs +9 -9
  172. package/esm2022/performance/performance.mjs +1 -1
  173. package/esm2022/performance/performance.module.mjs +12 -12
  174. package/esm2022/remote-config/is-remote-config-supported-factory.mjs +2 -2
  175. package/esm2022/remote-config/remote-config.mjs +1 -1
  176. package/esm2022/remote-config/remote-config.module.mjs +9 -9
  177. package/esm2022/storage/storage.mjs +1 -1
  178. package/esm2022/storage/storage.module.mjs +11 -11
  179. package/esm2022/zones.mjs +9 -11
  180. package/fesm2022/angular-fire-analytics.mjs +18 -14
  181. package/fesm2022/angular-fire-analytics.mjs.map +1 -1
  182. package/fesm2022/angular-fire-app-check.mjs +13 -19
  183. package/fesm2022/angular-fire-app-check.mjs.map +1 -1
  184. package/fesm2022/angular-fire-app.mjs +6 -5
  185. package/fesm2022/angular-fire-app.mjs.map +1 -1
  186. package/fesm2022/angular-fire-auth-guard.mjs +13 -11
  187. package/fesm2022/angular-fire-auth-guard.mjs.map +1 -1
  188. package/fesm2022/angular-fire-auth.mjs +10 -9
  189. package/fesm2022/angular-fire-auth.mjs.map +1 -1
  190. package/fesm2022/angular-fire-compat-analytics.mjs +29 -27
  191. package/fesm2022/angular-fire-compat-analytics.mjs.map +1 -1
  192. package/fesm2022/angular-fire-compat-auth-guard.mjs +12 -10
  193. package/fesm2022/angular-fire-compat-auth-guard.mjs.map +1 -1
  194. package/fesm2022/angular-fire-compat-auth.mjs +13 -13
  195. package/fesm2022/angular-fire-compat-auth.mjs.map +1 -1
  196. package/fesm2022/angular-fire-compat-database.mjs +129 -128
  197. package/fesm2022/angular-fire-compat-database.mjs.map +1 -1
  198. package/fesm2022/angular-fire-compat-firestore.mjs +96 -96
  199. package/fesm2022/angular-fire-compat-firestore.mjs.map +1 -1
  200. package/fesm2022/angular-fire-compat-functions.mjs +10 -10
  201. package/fesm2022/angular-fire-compat-functions.mjs.map +1 -1
  202. package/fesm2022/angular-fire-compat-messaging.mjs +13 -12
  203. package/fesm2022/angular-fire-compat-messaging.mjs.map +1 -1
  204. package/fesm2022/angular-fire-compat-performance.mjs +23 -29
  205. package/fesm2022/angular-fire-compat-performance.mjs.map +1 -1
  206. package/fesm2022/angular-fire-compat-remote-config.mjs +10 -11
  207. package/fesm2022/angular-fire-compat-remote-config.mjs.map +1 -1
  208. package/fesm2022/angular-fire-compat-storage.mjs +21 -19
  209. package/fesm2022/angular-fire-compat-storage.mjs.map +1 -1
  210. package/fesm2022/angular-fire-compat.mjs +15 -13
  211. package/fesm2022/angular-fire-compat.mjs.map +1 -1
  212. package/fesm2022/angular-fire-database.mjs +7 -8
  213. package/fesm2022/angular-fire-database.mjs.map +1 -1
  214. package/fesm2022/angular-fire-firestore-lite.mjs +21 -11
  215. package/fesm2022/angular-fire-firestore-lite.mjs.map +1 -1
  216. package/fesm2022/angular-fire-firestore.mjs +32 -13
  217. package/fesm2022/angular-fire-firestore.mjs.map +1 -1
  218. package/fesm2022/angular-fire-functions.mjs +8 -9
  219. package/fesm2022/angular-fire-functions.mjs.map +1 -1
  220. package/fesm2022/angular-fire-messaging.mjs +4 -4
  221. package/fesm2022/angular-fire-messaging.mjs.map +1 -1
  222. package/fesm2022/angular-fire-performance.mjs +7 -7
  223. package/fesm2022/angular-fire-performance.mjs.map +1 -1
  224. package/fesm2022/angular-fire-remote-config.mjs +4 -4
  225. package/fesm2022/angular-fire-remote-config.mjs.map +1 -1
  226. package/fesm2022/angular-fire-storage.mjs +6 -7
  227. package/fesm2022/angular-fire-storage.mjs.map +1 -1
  228. package/fesm2022/angular-fire.mjs +14 -10
  229. package/fesm2022/angular-fire.mjs.map +1 -1
  230. package/firestore/firebase.d.ts +21 -1
  231. package/firestore/firestore.module.d.ts +2 -2
  232. package/firestore/lite/firebase.d.ts +10 -1
  233. package/firestore/lite/lite.module.d.ts +2 -2
  234. package/firestore/lite/rxfire.d.ts +3 -1
  235. package/firestore/rxfire.d.ts +3 -3
  236. package/functions/functions.module.d.ts +2 -2
  237. package/messaging/messaging.module.d.ts +2 -2
  238. package/package.json +17 -17
  239. package/performance/performance.module.d.ts +2 -2
  240. package/remote-config/remote-config.module.d.ts +2 -2
  241. package/schematics/add/index.js +1 -1
  242. package/schematics/add/schema.json +16 -0
  243. package/schematics/builders.json +10 -0
  244. package/schematics/collection.json +15 -0
  245. package/schematics/common.js +1 -1
  246. package/schematics/deploy/actions.js +11 -11
  247. package/schematics/deploy/builder.js +2 -2
  248. package/schematics/deploy/schema.json +119 -0
  249. package/schematics/migration.json +15 -0
  250. package/schematics/setup/index.js +5 -6
  251. package/schematics/setup/prompts.js +5 -6
  252. package/schematics/setup/schema.json +16 -0
  253. package/schematics/update/index.js +1 -1
  254. package/schematics/update/v7/index.js +2 -2
  255. package/schematics/utils.js +4 -4
  256. package/storage/storage.module.d.ts +2 -2
  257. package/publish.sh +0 -1
@@ -1,8 +1,8 @@
1
1
  import { InjectionToken, NgZone } from '@angular/core';
2
- import { Observable } from 'rxjs';
3
- import firebase from 'firebase/compat/app';
4
2
  import { ɵPromiseProxy } from '@angular/fire/compat';
5
3
  import { FirebaseApp } from '@angular/fire/compat';
4
+ import firebase from 'firebase/compat/app';
5
+ import { Observable } from 'rxjs';
6
6
  import * as i0 from "@angular/core";
7
7
  export declare const INSTRUMENTATION_ENABLED: InjectionToken<boolean>;
8
8
  export declare const DATA_COLLECTION_ENABLED: InjectionToken<boolean>;
@@ -1,14 +1,12 @@
1
1
  import { InjectionToken, NgZone } from '@angular/core';
2
- import { MonoTypeOperatorFunction, Observable, OperatorFunction } from 'rxjs';
3
2
  import { ɵAngularFireSchedulers } from '@angular/fire';
4
3
  import { ɵPromiseProxy } from '@angular/fire/compat';
5
4
  import { FirebaseOptions } from 'firebase/app';
6
5
  import firebase from 'firebase/compat/app';
6
+ import { MonoTypeOperatorFunction, Observable, OperatorFunction } from 'rxjs';
7
7
  import { Settings } from './interfaces';
8
8
  import * as i0 from "@angular/core";
9
- export interface ConfigTemplate {
10
- [key: string]: string | number | boolean;
11
- }
9
+ export type ConfigTemplate = Record<string, string | number | boolean>;
12
10
  export declare const SETTINGS: InjectionToken<firebase.remoteConfig.Settings>;
13
11
  export declare const DEFAULTS: InjectionToken<ConfigTemplate>;
14
12
  export interface AngularFireRemoteConfig extends ɵPromiseProxy<firebase.remoteConfig.RemoteConfig> {
@@ -33,53 +31,21 @@ export declare class AngularFireRemoteConfig {
33
31
  private zone;
34
32
  readonly changes: Observable<Parameter>;
35
33
  readonly parameters: Observable<Parameter[]>;
36
- readonly numbers: Observable<{
37
- [key: string]: number | undefined;
38
- }> & {
39
- [key: string]: Observable<number>;
40
- };
41
- readonly booleans: Observable<{
42
- [key: string]: boolean | undefined;
43
- }> & {
44
- [key: string]: Observable<boolean>;
45
- };
46
- readonly strings: Observable<{
47
- [key: string]: string | undefined;
48
- }> & {
49
- [key: string]: Observable<string | undefined>;
50
- };
34
+ readonly numbers: Observable<Record<string, number | undefined>> & Record<string, Observable<number>>;
35
+ readonly booleans: Observable<Record<string, boolean | undefined>> & Record<string, Observable<boolean>>;
36
+ readonly strings: Observable<Record<string, string | undefined>> & Record<string, Observable<string | undefined>>;
51
37
  constructor(options: FirebaseOptions, name: string | null | undefined, settings: Settings | null, defaultConfig: ConfigTemplate | null, zone: NgZone, schedulers: ɵAngularFireSchedulers, platformId: Object);
52
38
  static ɵfac: i0.ɵɵFactoryDeclaration<AngularFireRemoteConfig, [null, { optional: true; }, { optional: true; }, { optional: true; }, null, null, null]>;
53
39
  static ɵprov: i0.ɵɵInjectableDeclaration<AngularFireRemoteConfig>;
54
40
  }
55
41
  export declare const budget: <T>(interval: number) => MonoTypeOperatorFunction<T>;
56
- export declare function scanToObject(): OperatorFunction<Parameter, {
57
- [key: string]: string | undefined;
58
- }>;
59
- export declare function scanToObject(to: 'numbers'): OperatorFunction<Parameter, {
60
- [key: string]: number | undefined;
61
- }>;
62
- export declare function scanToObject(to: 'booleans'): OperatorFunction<Parameter, {
63
- [key: string]: boolean | undefined;
64
- }>;
65
- export declare function scanToObject(to: 'strings'): OperatorFunction<Parameter, {
66
- [key: string]: string | undefined;
67
- }>;
68
- export declare function scanToObject<T extends ConfigTemplate>(template: T): OperatorFunction<Parameter, T & {
69
- [key: string]: string | undefined;
70
- }>;
71
- export declare function mapToObject(): OperatorFunction<Parameter[], {
72
- [key: string]: string | undefined;
73
- }>;
74
- export declare function mapToObject(to: 'numbers'): OperatorFunction<Parameter[], {
75
- [key: string]: number | undefined;
76
- }>;
77
- export declare function mapToObject(to: 'booleans'): OperatorFunction<Parameter[], {
78
- [key: string]: boolean | undefined;
79
- }>;
80
- export declare function mapToObject(to: 'strings'): OperatorFunction<Parameter[], {
81
- [key: string]: string | undefined;
82
- }>;
83
- export declare function mapToObject<T extends ConfigTemplate>(template: T): OperatorFunction<Parameter[], T & {
84
- [key: string]: string | undefined;
85
- }>;
42
+ export declare function scanToObject(): OperatorFunction<Parameter, Record<string, string | undefined>>;
43
+ export declare function scanToObject(to: 'numbers'): OperatorFunction<Parameter, Record<string, number | undefined>>;
44
+ export declare function scanToObject(to: 'booleans'): OperatorFunction<Parameter, Record<string, boolean | undefined>>;
45
+ export declare function scanToObject(to: 'strings'): OperatorFunction<Parameter, Record<string, string | undefined>>;
46
+ export declare function scanToObject<T extends ConfigTemplate>(template: T): OperatorFunction<Parameter, T & Record<string, string | undefined>>;
47
+ export declare function mapToObject(): OperatorFunction<Parameter[], Record<string, string | undefined>>;
48
+ export declare function mapToObject(to: 'numbers'): OperatorFunction<Parameter[], Record<string, number | undefined>>;
49
+ export declare function mapToObject(to: 'booleans'): OperatorFunction<Parameter[], Record<string, boolean | undefined>>;
50
+ export declare function mapToObject(to: 'strings'): OperatorFunction<Parameter[], Record<string, string | undefined>>;
51
+ export declare function mapToObject<T extends ConfigTemplate>(template: T): OperatorFunction<Parameter[], T & Record<string, string | undefined>>;
@@ -1,4 +1,3 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { UploadTask } from '../interfaces';
3
- import firebase from 'firebase/compat/app';
4
- export declare function fromTask(task: UploadTask): Observable<firebase.storage.UploadTaskSnapshot>;
3
+ export declare function fromTask(task: UploadTask): Observable<import("firebase/compat").default.storage.UploadTaskSnapshot>;
@@ -1,6 +1,6 @@
1
+ import { Observable } from 'rxjs';
1
2
  import { ListOptions, ListResult, Reference, SettableMetadata, UploadMetadata } from './interfaces';
2
3
  import { AngularFireUploadTask } from './task';
3
- import { Observable } from 'rxjs';
4
4
  export interface AngularFireStorageReference {
5
5
  getDownloadURL(): Observable<any>;
6
6
  getMetadata(): Observable<any>;
@@ -1,10 +1,10 @@
1
1
  import { InjectionToken, NgZone } from '@angular/core';
2
2
  import { ɵAngularFireSchedulers } from '@angular/fire';
3
+ import { AppCheckInstances } from '@angular/fire/app-check';
3
4
  import { FirebaseOptions } from 'firebase/app';
5
+ import firebase from 'firebase/compat/app';
4
6
  import { UploadMetadata } from './interfaces';
5
7
  import 'firebase/compat/storage';
6
- import firebase from 'firebase/compat/app';
7
- import { AppCheckInstances } from '@angular/fire/app-check';
8
8
  import * as i0 from "@angular/core";
9
9
  export declare const BUCKET: InjectionToken<string>;
10
10
  export declare const MAX_UPLOAD_RETRY_TIME: InjectionToken<number>;
@@ -21,7 +21,7 @@ export declare const USE_EMULATOR: InjectionToken<[host: string, port: number, o
21
21
  */
22
22
  export declare class AngularFireStorage {
23
23
  readonly storage: firebase.storage.Storage;
24
- constructor(options: FirebaseOptions, name: string | null | undefined, storageBucket: string | null, platformId: Object, zone: NgZone, schedulers: ɵAngularFireSchedulers, maxUploadRetryTime: number | any, maxOperationRetryTime: number | any, _useEmulator: any, _appCheckInstances: AppCheckInstances);
24
+ constructor(options: FirebaseOptions, name: string | null | undefined, storageBucket: string | null, platformId: Object, zone: NgZone, schedulers: ɵAngularFireSchedulers, maxUploadRetryTime: any, maxOperationRetryTime: any, _useEmulator: any, _appCheckInstances: AppCheckInstances);
25
25
  ref(path: string): import("./ref").AngularFireStorageReference;
26
26
  refFromURL(path: string): import("./ref").AngularFireStorageReference;
27
27
  upload(path: string, data: any, metadata?: UploadMetadata): import("@angular/fire/compat/storage").AngularFireUploadTask;
@@ -1,5 +1,5 @@
1
- import { UploadTask, UploadTaskSnapshot } from './interfaces';
2
1
  import { Observable } from 'rxjs';
2
+ import { UploadTask, UploadTaskSnapshot } from './interfaces';
3
3
  export interface AngularFireUploadTask {
4
4
  task: UploadTask;
5
5
  snapshotChanges(): Observable<UploadTaskSnapshot | undefined>;
package/core.d.ts CHANGED
@@ -1,6 +1,13 @@
1
1
  import { Version } from '@angular/core';
2
2
  import { FirebaseApp } from 'firebase/app';
3
+ import type { AppCheck } from 'firebase/app-check';
3
4
  export declare const VERSION: Version;
4
5
  export declare const ɵisSupportedError: (module: string) => string;
5
6
  export declare function ɵgetDefaultInstanceOf<T = unknown>(identifier: string, provided: T[] | undefined, defaultApp: FirebaseApp): T | undefined;
6
7
  export declare const ɵgetAllInstancesOf: <T = unknown>(identifier: string, app?: FirebaseApp) => T[];
8
+ export interface ɵAppCheckInstances extends Array<AppCheck> {
9
+ }
10
+ export declare class ɵAppCheckInstances {
11
+ constructor();
12
+ }
13
+ export declare const ɵAPP_CHECK_PROVIDER_NAME = "app-check";
@@ -1,7 +1,7 @@
1
- import { NgZone, InjectionToken, ModuleWithProviders, Injector } from '@angular/core';
1
+ import { InjectionToken, Injector, ModuleWithProviders, NgZone } from '@angular/core';
2
+ import { FirebaseApp } from '@angular/fire/app';
2
3
  import { Database as FirebaseDatabase } from 'firebase/database';
3
4
  import { Database } from './database';
4
- import { FirebaseApp } from '@angular/fire/app';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare const PROVIDED_DATABASE_INSTANCES: InjectionToken<Database[]>;
7
7
  export declare function defaultDatabaseInstanceFactory(provided: FirebaseDatabase[] | undefined, defaultApp: FirebaseApp): Database;
@@ -0,0 +1,67 @@
1
+ <img align="right" width="30%" src="images/analytics-illo_1x.png">
2
+
3
+ <small>
4
+ <a href="https://github.com/angular/angularfire">AngularFire</a> &#10097; <a href="../README.md#developer-guide">Developer Guide</a> &#10097; Analytics
5
+ </small>
6
+
7
+ # Analytics
8
+
9
+ Google Analytics is an app measurement solution, available at no charge, that provides insight on app usage and user engagement.
10
+
11
+ [Learn more](https://firebase.google.com/docs/analytics)
12
+ ## Dependency Injection
13
+
14
+ As a prerequisite, ensure that `AngularFire` has been added to your project via
15
+ ```bash
16
+ ng add @angular/fire
17
+ ```
18
+
19
+ Provide a Google Analytics instance in the application's `NgModule` (`app.module.ts`):
20
+
21
+ ```ts
22
+ @NgModule({
23
+ declarations: [
24
+ ...
25
+ ],
26
+ imports: [
27
+ ...
28
+ // App initialization
29
+ provideFirebaseApp(() => initializeApp(environment.firebase)),
30
+ provideAnalytics(() => getAnalytics())
31
+ ],
32
+ providers: [],
33
+ bootstrap: [AppComponent]
34
+ })
35
+ export class AppModule { }
36
+ ```
37
+
38
+ In your component class, for example `user-profile.component.ts` import and inject `Firestore`:
39
+
40
+ ```typescript
41
+ import { Component, inject } from '@angular/core';
42
+ import { Analytics } from '@angular/fire/analytics';
43
+
44
+ @Component({
45
+ standalone: true,
46
+ selector: 'app-user-profile',
47
+ ...
48
+ })
49
+ export class UserProfileComponent {
50
+ private analytics: Analytics = inject(Analytics);
51
+ ...
52
+ }
53
+ ```
54
+
55
+ ## Firebase API
56
+
57
+ The [Firebase API for Google Analytics documentation](https://firebase.google.com/docs/reference/js/analytics.md#analytics_package) is available on the Firebase website.
58
+
59
+ ## Services
60
+
61
+ ### ScreenTrackingService
62
+
63
+ Coming soon, for now [please review the documentation](https://firebase.google.com/docs/analytics/screenviews)
64
+
65
+ ### UserTrackingService
66
+ Coming soon
67
+
@@ -0,0 +1,53 @@
1
+ <small>
2
+ <a href="https://github.com/angular/angularfire">AngularFire</a> &#10097; <a href="../README.md#developer-guide">Developer Guide</a> &#10097; Realtime App Check
3
+ </small>
4
+
5
+ <img align="right" width="30%" src="images/reCAPTCHA-logo@1x.png">
6
+
7
+ # App Check
8
+
9
+ App Check helps protect your API resources from abuse by preventing unauthorized clients from accessing your backend resources. It works with both Firebase services, Google Cloud services, and your own APIs to keep your resources safe.
10
+
11
+ [Learn More](https://firebase.google.com/docs/app-check)
12
+
13
+ ## Dependency Injection
14
+ As a prerequisite, ensure that `AngularFire` has been added to your project via
15
+ ```bash
16
+ ng add @angular/fire
17
+ ```
18
+
19
+ Provide an App Check instance and configuration in the application's `NgModule` (`app.module.ts`):
20
+
21
+ ```ts
22
+ import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
23
+ import { provideAppCheck } from '@angular/fire/app-check';
24
+
25
+ @NgModule({
26
+ imports: [
27
+ provideFirebaseApp(() => initializeApp(environment.firebase)),
28
+ provideAppCheck(() => initializeAppCheck(getApp(), {
29
+ provider: new ReCaptchaV3Provider(/* configuration */),
30
+ })),
31
+ ]
32
+ })
33
+ ```
34
+
35
+ Next inject it into your component:
36
+
37
+ ```ts
38
+ import { Component, inject} from '@angular/core';
39
+ import { AppCheck } from '@angular/fire/app-check';
40
+
41
+ @Component({ ... })
42
+ export class AppCheckComponent {
43
+ private appCheck: AppCheck = inject(AppCheck);
44
+ ...
45
+ }
46
+ ```
47
+
48
+ ## Firebase API
49
+
50
+ The [AppCheck documentation](https://firebase.google.com/docs/reference/js/app-check) is available on the Firebase website.
51
+
52
+ ## Convenience observables
53
+ Coming soon.
package/docs/auth.md ADDED
@@ -0,0 +1,165 @@
1
+ <img align="right" width="30%" src="images/auth-illo_1x.png">
2
+
3
+ <small>
4
+ <a href="https://github.com/angular/angularfire">AngularFire</a> &#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 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
+ ```
@@ -0,0 +1,137 @@
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.