react-query-firebase 2.10.1 → 2.12.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/package.json CHANGED
@@ -5,14 +5,14 @@
5
5
  "url": "https://github.com/vpishuk/react-query-firebase/issues"
6
6
  },
7
7
  "peerDependencies": {
8
- "@react-native-firebase/analytics": "^22.x.x",
9
- "@react-native-firebase/app": "^22.x.x",
10
- "@react-native-firebase/auth": "^22.x.x",
11
- "@react-native-firebase/crashlytics": "^22.x.x",
12
- "@react-native-firebase/firestore": "^22.x.x",
13
- "@react-native-firebase/installations": "^22.x.x",
14
- "@react-native-firebase/remote-config": "^22.x.x",
15
- "@tanstack/react-query": "^5.83.0",
8
+ "@react-native-firebase/analytics": "^23.x.x",
9
+ "@react-native-firebase/app": "^23.x.x",
10
+ "@react-native-firebase/auth": "^23.x.x",
11
+ "@react-native-firebase/crashlytics": "^23.x.x",
12
+ "@react-native-firebase/firestore": "^23.x.x",
13
+ "@react-native-firebase/installations": "^23.x.x",
14
+ "@react-native-firebase/remote-config": "^23.x.x",
15
+ "@tanstack/react-query": "^5.x.x",
16
16
  "firebase": "^11.x.x",
17
17
  "react": "^18.x.x || ^19.x.x"
18
18
  },
@@ -22,24 +22,25 @@
22
22
  "description": "This module offers react hooks to work with Firebase on react-native and web platforms",
23
23
  "devDependencies": {
24
24
  "@laverve/eslint-utils": "^5.3.1",
25
- "@react-native-firebase/analytics": "^22.2.1",
26
- "@react-native-firebase/app": "^22.2.1",
27
- "@react-native-firebase/auth": "^22.4.0",
28
- "@react-native-firebase/crashlytics": "^22.4.0",
29
- "@react-native-firebase/firestore": "^22.4.0",
30
- "@react-native-firebase/installations": "^22.4.0",
31
- "@react-native-firebase/remote-config": "^22.4.0",
32
- "@types/react": "^19.1.8",
33
- "firebase": "^12.0.0",
25
+ "@react-native-firebase/analytics": "^23.0.1",
26
+ "@react-native-firebase/app": "23.0.1",
27
+ "@react-native-firebase/auth": "^23.0.1",
28
+ "@react-native-firebase/crashlytics": "^23.0.1",
29
+ "@react-native-firebase/firestore": "^23.0.1",
30
+ "@react-native-firebase/installations": "^23.0.1",
31
+ "@react-native-firebase/remote-config": "^23.0.1",
32
+ "@tanstack/react-query": "^5.85.3",
33
+ "@types/react": "^19.1.10",
34
+ "firebase": "^12.1.0",
34
35
  "husky": "^9.1.7",
35
- "lint-staged": "^16.1.2",
36
+ "lint-staged": "^16.1.5",
36
37
  "prettier": "^3.6.2",
37
- "react": "^19.1.0",
38
- "typedoc": "^0.28.7",
39
- "typedoc-plugin-markdown": "^4.7.1",
38
+ "react": "^19.1.1",
39
+ "typedoc": "^0.28.10",
40
+ "typedoc-plugin-markdown": "^4.8.1",
40
41
  "typedoc-vitepress-theme": "^1.1.2",
41
- "typescript": "^5.8.3",
42
- "vitepress": "^1.6.3"
42
+ "typescript": "^5.9.2",
43
+ "vitepress": "^1.6.4"
43
44
  },
44
45
  "homepage": "https://github.com/vpishuk/react-query-firebase",
45
46
  "keywords": [
@@ -74,5 +75,5 @@
74
75
  "docs:build": "vitepress build docs",
75
76
  "docs:preview": "vitepress preview docs"
76
77
  },
77
- "version": "2.10.1"
78
+ "version": "2.12.0"
78
79
  }
@@ -17,3 +17,4 @@ export * from "./useFacebookAuthProviderCredential";
17
17
  export * from "./useAppleAuthProviderCredential";
18
18
  export * from "./useLinkWithCredentialMutation";
19
19
  export * from "./useSignInWithCredentialMutation";
20
+ export * from "./useGetRedirectResultMutation";
package/web/auth/index.js CHANGED
@@ -17,3 +17,4 @@ export * from "./useFacebookAuthProviderCredential";
17
17
  export * from "./useAppleAuthProviderCredential";
18
18
  export * from "./useLinkWithCredentialMutation";
19
19
  export * from "./useSignInWithCredentialMutation";
20
+ export * from "./useGetRedirectResultMutation";
package/web/auth/index.ts CHANGED
@@ -17,3 +17,4 @@ export * from "./useFacebookAuthProviderCredential";
17
17
  export * from "./useAppleAuthProviderCredential";
18
18
  export * from "./useLinkWithCredentialMutation";
19
19
  export * from "./useSignInWithCredentialMutation";
20
+ export * from "./useGetRedirectResultMutation";
@@ -1,4 +1,5 @@
1
1
  export declare const CREATE_USER_WITH_EMAIL_AND_PASSWORD_MUTATION_KEY: readonly ["FIREBASE", "AUTH", "CREATE_USER_WITH_EMAIL_AND_PASSWORD_MUTATION"];
2
+ export declare const GET_REDIRECT_RESULT_MUTATION_KEY: readonly ["FIREBASE", "AUTH", "GET_REDIRECT_RESULT_MUTATION"];
2
3
  export declare const SEND_EMAIL_VERIFICATION_MUTATION_KEY: readonly ["FIREBASE", "AUTH", "SEND_EMAIL_VERIFICATION_MUTATION"];
3
4
  export declare const SIGN_IN_ANONYMOUSLY_MUTATION_KEY: readonly ["FIREBASE", "AUTH", "SIGN_IN_ANONYMOUSLY_MUTATION"];
4
5
  export declare const SIGN_IN_WITH_EMAIL_AND_PASSWORD_MUTATION_KEY: readonly ["FIREBASE", "AUTH", "SIGN_IN_WITH_EMAIL_AND_PASSWORD_MUTATION"];
@@ -3,6 +3,7 @@ export const CREATE_USER_WITH_EMAIL_AND_PASSWORD_MUTATION_KEY = [
3
3
  "AUTH",
4
4
  "CREATE_USER_WITH_EMAIL_AND_PASSWORD_MUTATION"
5
5
  ];
6
+ export const GET_REDIRECT_RESULT_MUTATION_KEY = ["FIREBASE", "AUTH", "GET_REDIRECT_RESULT_MUTATION"];
6
7
  export const SEND_EMAIL_VERIFICATION_MUTATION_KEY = ["FIREBASE", "AUTH", "SEND_EMAIL_VERIFICATION_MUTATION"];
7
8
  export const SIGN_IN_ANONYMOUSLY_MUTATION_KEY = ["FIREBASE", "AUTH", "SIGN_IN_ANONYMOUSLY_MUTATION"];
8
9
  export const SIGN_IN_WITH_EMAIL_AND_PASSWORD_MUTATION_KEY = [
@@ -3,6 +3,7 @@ export const CREATE_USER_WITH_EMAIL_AND_PASSWORD_MUTATION_KEY = [
3
3
  "AUTH",
4
4
  "CREATE_USER_WITH_EMAIL_AND_PASSWORD_MUTATION"
5
5
  ] as const;
6
+ export const GET_REDIRECT_RESULT_MUTATION_KEY = ["FIREBASE", "AUTH", "GET_REDIRECT_RESULT_MUTATION"] as const;
6
7
  export const SEND_EMAIL_VERIFICATION_MUTATION_KEY = ["FIREBASE", "AUTH", "SEND_EMAIL_VERIFICATION_MUTATION"] as const;
7
8
  export const SIGN_IN_ANONYMOUSLY_MUTATION_KEY = ["FIREBASE", "AUTH", "SIGN_IN_ANONYMOUSLY_MUTATION"] as const;
8
9
  export const SIGN_IN_WITH_EMAIL_AND_PASSWORD_MUTATION_KEY = [
@@ -0,0 +1,11 @@
1
+ import { UseMutationOptions } from "@tanstack/react-query";
2
+ import { UserCredential } from "firebase/auth";
3
+ import { FirebaseError } from "firebase/app";
4
+ /**
5
+ * Custom hook to retrieve redirect result after sign in with redirect.
6
+ * This hook utilizes the `useMutation` functionality to support creating new user credentials asynchronously.
7
+ *
8
+ * @param {Omit<UseMutationOptions<UserCredential, FirebaseError, void, TContext>, "mutationKey" | "mutationFn">} options - Optional settings to customize the mutation behavior, excluding `mutationKey` and `mutationFn`.
9
+ * @returns {UseMutationResult<UserCredential, FirebaseError, void, TContext>} The result of the mutation which includes status, user credentials, and error information if any.
10
+ */
11
+ export declare const useGetRedirectResultMutation: <TContext = unknown>(options?: Omit<UseMutationOptions<UserCredential | null, FirebaseError, void, TContext>, "mutationKey" | "mutationFn">) => import("@tanstack/react-query").UseMutationResult<UserCredential | null, FirebaseError, void, TContext>;
@@ -0,0 +1,19 @@
1
+ import { useMutation } from "@tanstack/react-query";
2
+ import { useAuth } from "./useAuth";
3
+ import { GET_REDIRECT_RESULT_MUTATION_KEY } from "./mutation-keys";
4
+ import { getRedirectResult } from "firebase/auth";
5
+ /**
6
+ * Custom hook to retrieve redirect result after sign in with redirect.
7
+ * This hook utilizes the `useMutation` functionality to support creating new user credentials asynchronously.
8
+ *
9
+ * @param {Omit<UseMutationOptions<UserCredential, FirebaseError, void, TContext>, "mutationKey" | "mutationFn">} options - Optional settings to customize the mutation behavior, excluding `mutationKey` and `mutationFn`.
10
+ * @returns {UseMutationResult<UserCredential, FirebaseError, void, TContext>} The result of the mutation which includes status, user credentials, and error information if any.
11
+ */
12
+ export const useGetRedirectResultMutation = (options = {}) => {
13
+ const firebaseAuth = useAuth();
14
+ return useMutation({
15
+ ...options,
16
+ mutationFn: async () => await getRedirectResult(firebaseAuth),
17
+ mutationKey: GET_REDIRECT_RESULT_MUTATION_KEY
18
+ });
19
+ };
@@ -0,0 +1,27 @@
1
+ import { useMutation, UseMutationOptions } from "@tanstack/react-query";
2
+ import { useAuth } from "./useAuth";
3
+ import { GET_REDIRECT_RESULT_MUTATION_KEY } from "./mutation-keys";
4
+ import { getRedirectResult, UserCredential } from "firebase/auth";
5
+ import { FirebaseError } from "firebase/app";
6
+
7
+ /**
8
+ * Custom hook to retrieve redirect result after sign in with redirect.
9
+ * This hook utilizes the `useMutation` functionality to support creating new user credentials asynchronously.
10
+ *
11
+ * @param {Omit<UseMutationOptions<UserCredential, FirebaseError, void, TContext>, "mutationKey" | "mutationFn">} options - Optional settings to customize the mutation behavior, excluding `mutationKey` and `mutationFn`.
12
+ * @returns {UseMutationResult<UserCredential, FirebaseError, void, TContext>} The result of the mutation which includes status, user credentials, and error information if any.
13
+ */
14
+ export const useGetRedirectResultMutation = <TContext = unknown>(
15
+ options: Omit<
16
+ UseMutationOptions<UserCredential | null, FirebaseError, void, TContext>,
17
+ "mutationKey" | "mutationFn"
18
+ > = {}
19
+ ) => {
20
+ const firebaseAuth = useAuth();
21
+
22
+ return useMutation({
23
+ ...options,
24
+ mutationFn: async () => await getRedirectResult(firebaseAuth),
25
+ mutationKey: GET_REDIRECT_RESULT_MUTATION_KEY
26
+ });
27
+ };