@react-native-firebase/app-check 21.13.0 → 21.14.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [21.14.0](https://github.com/invertase/react-native-firebase/compare/v21.13.0...v21.14.0) (2025-04-14)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **app-check:** type def fixes ([#8367](https://github.com/invertase/react-native-firebase/issues/8367)) ([ecb1340](https://github.com/invertase/react-native-firebase/commit/ecb134086c685c8ac337cdc252a2298465633dab))
11
+
6
12
  ## [21.13.0](https://github.com/invertase/react-native-firebase/compare/v21.12.3...v21.13.0) (2025-03-31)
7
13
 
8
14
  **Note:** Version bump only for package @react-native-firebase/app-check
@@ -14,23 +14,20 @@ import CustomProviderOptions = FirebaseAppCheckTypes.CustomProviderOptions;
14
14
  * Activate App Check for the given app. Can be called only once per app.
15
15
  * @param app - FirebaseApp. Optional.
16
16
  * @param options - AppCheckOptions
17
- * @returns {Promise<{ app: FirebaseApp }>}
17
+ * @returns {Promise<AppCheck>}
18
18
  */
19
- export function initializeAppCheck(
20
- app?: FirebaseApp,
21
- options?: AppCheckOptions,
22
- ): Promise<{ app: FirebaseApp }>;
19
+ export function initializeAppCheck(app?: FirebaseApp, options?: AppCheckOptions): Promise<AppCheck>;
23
20
 
24
21
  /**
25
22
  * Get the current App Check token. Attaches to the most recent in-flight request if one is present.
26
23
  * Returns null if no token is present and no token requests are in-flight.
27
24
  * @param appCheckInstance - AppCheck
28
- * @param forceRefresh - boolean
25
+ * @param forceRefresh - If true, will always try to fetch a fresh token. If false, will use a cached token if found in storage.
29
26
  * @returns {Promise<AppCheckTokenResult>}
30
27
  */
31
28
  export function getToken(
32
29
  appCheckInstance: AppCheck,
33
- forceRefresh: boolean,
30
+ forceRefresh?: boolean,
34
31
  ): Promise<AppCheckTokenResult>;
35
32
 
36
33
  /**
@@ -32,29 +32,28 @@ import ReactNativeFirebaseAppCheckProvider from '../ReactNativeFirebaseAppCheckP
32
32
  * Activate App Check for the given app. Can be called only once per app.
33
33
  * @param {FirebaseApp} [app] - The app to initialize App Check for. Optional.
34
34
  * @param {AppCheckOptions} options - App Check options.
35
- * @returns {Promise<{ app: FirebaseApp }>}
35
+ * @returns {Promise<AppCheck>}
36
36
  */
37
37
  export async function initializeAppCheck(app, options) {
38
38
  if (app) {
39
39
  const appCheck = getApp(app.name).appCheck();
40
40
  await appCheck.initializeAppCheck.call(appCheck, options, MODULAR_DEPRECATION_ARG);
41
- return { app: getApp(app.name) };
41
+ return appCheck;
42
42
  }
43
43
  const appCheck = getApp().appCheck();
44
44
  await appCheck.initializeAppCheck.call(appCheck, options, MODULAR_DEPRECATION_ARG);
45
- return { app: getApp() };
45
+ return appCheck;
46
46
  }
47
47
 
48
48
  /**
49
49
  * Get the current App Check token. Attaches to the most recent in-flight request if one is present.
50
50
  * Returns null if no token is present and no token requests are in-flight.
51
51
  * @param {AppCheck} appCheckInstance - The App Check instance.
52
- * @param {boolean} forceRefresh - Whether to force refresh the token.
52
+ * @param {boolean} forceRefresh - Whether to force refresh the token. Optional
53
53
  * @returns {Promise<AppCheckTokenResult>}
54
54
  */
55
55
  export function getToken(appCheckInstance, forceRefresh) {
56
- const appCheck = appCheckInstance.app.appCheck();
57
- return appCheck.getToken.call(appCheck, forceRefresh, MODULAR_DEPRECATION_ARG);
56
+ return appCheckInstance.getToken.call(appCheckInstance, forceRefresh, MODULAR_DEPRECATION_ARG);
58
57
  }
59
58
 
60
59
  /**
@@ -64,8 +63,7 @@ export function getToken(appCheckInstance, forceRefresh) {
64
63
  * @returns {Promise<AppCheckTokenResult>}
65
64
  */
66
65
  export function getLimitedUseToken(appCheckInstance) {
67
- const appCheck = appCheckInstance.app.appCheck();
68
- return appCheck.getLimitedUseToken.call(appCheck, MODULAR_DEPRECATION_ARG);
66
+ return appCheckInstance.getLimitedUseToken.call(appCheckInstance, MODULAR_DEPRECATION_ARG);
69
67
  }
70
68
 
71
69
  /**
@@ -74,9 +72,8 @@ export function getLimitedUseToken(appCheckInstance) {
74
72
  * @param {boolean} isAutoRefreshEnabled - Whether to enable auto-refresh.
75
73
  */
76
74
  export function setTokenAutoRefreshEnabled(appCheckInstance, isAutoRefreshEnabled) {
77
- const appCheck = appCheckInstance.app.appCheck();
78
- return appCheck.setTokenAutoRefreshEnabled.call(
79
- appCheck,
75
+ return appCheckInstance.setTokenAutoRefreshEnabled.call(
76
+ appCheckInstance,
80
77
  isAutoRefreshEnabled,
81
78
  MODULAR_DEPRECATION_ARG,
82
79
  );
@@ -93,9 +90,8 @@ export function setTokenAutoRefreshEnabled(appCheckInstance, isAutoRefreshEnable
93
90
  * @returns {Unsubscribe}
94
91
  */
95
92
  export function onTokenChanged(appCheckInstance, onNextOrObserver, onError, onCompletion) {
96
- const appCheck = appCheckInstance.app.appCheck();
97
- return appCheck.onTokenChanged.call(
98
- appCheck,
93
+ return appCheckInstance.onTokenChanged.call(
94
+ appCheckInstance,
99
95
  onNextOrObserver,
100
96
  onError,
101
97
  onCompletion,
package/lib/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- module.exports = '21.13.0';
2
+ module.exports = '21.14.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-firebase/app-check",
3
- "version": "21.13.0",
3
+ "version": "21.14.0",
4
4
  "author": "Invertase <oss@invertase.io> (http://invertase.io)",
5
5
  "description": "React Native Firebase - App Check",
6
6
  "main": "lib/index.js",
@@ -25,7 +25,7 @@
25
25
  "appCheck"
26
26
  ],
27
27
  "peerDependencies": {
28
- "@react-native-firebase/app": "21.13.0",
28
+ "@react-native-firebase/app": "21.14.0",
29
29
  "expo": ">=47.0.0"
30
30
  },
31
31
  "devDependencies": {
@@ -39,5 +39,5 @@
39
39
  "publishConfig": {
40
40
  "access": "public"
41
41
  },
42
- "gitHead": "d4d02d15431a0be091a7417833e0180479f5e788"
42
+ "gitHead": "7c7beaab9cf8a619927a33ef7a15b8000e2874c2"
43
43
  }