@better-auth-ui/react 1.6.0 → 1.6.2

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 (211) hide show
  1. package/dist/components/auth/auth-provider.d.ts +4 -3
  2. package/dist/components/auth/auth-provider.js +24 -40
  3. package/dist/components/email/email-changed.d.ts +2 -2
  4. package/dist/components/email/email-changed.js +154 -68
  5. package/dist/components/email/email-localization.js +18 -23
  6. package/dist/components/email/email-styles.js +52 -77
  7. package/dist/components/email/email-verification.d.ts +2 -2
  8. package/dist/components/email/email-verification.js +138 -73
  9. package/dist/components/email/index.d.ts +9 -9
  10. package/dist/components/email/index.js +9 -9
  11. package/dist/components/email/magic-link.d.ts +2 -2
  12. package/dist/components/email/magic-link.js +139 -70
  13. package/dist/components/email/new-device.d.ts +2 -2
  14. package/dist/components/email/new-device.js +221 -88
  15. package/dist/components/email/otp-email.d.ts +2 -2
  16. package/dist/components/email/otp-email.js +127 -63
  17. package/dist/components/email/password-changed.d.ts +2 -2
  18. package/dist/components/email/password-changed.js +157 -74
  19. package/dist/components/email/reset-password.d.ts +2 -2
  20. package/dist/components/email/reset-password.js +138 -66
  21. package/dist/components/icons/apple.d.ts +1 -1
  22. package/dist/components/icons/apple.js +16 -9
  23. package/dist/components/icons/atlassian.d.ts +1 -1
  24. package/dist/components/icons/atlassian.js +38 -13
  25. package/dist/components/icons/cognito.d.ts +1 -1
  26. package/dist/components/icons/cognito.js +19 -9
  27. package/dist/components/icons/discord.d.ts +1 -1
  28. package/dist/components/icons/discord.js +16 -9
  29. package/dist/components/icons/dropbox.d.ts +1 -1
  30. package/dist/components/icons/dropbox.js +16 -9
  31. package/dist/components/icons/facebook.d.ts +1 -1
  32. package/dist/components/icons/facebook.js +19 -11
  33. package/dist/components/icons/figma.d.ts +1 -1
  34. package/dist/components/icons/figma.js +34 -12
  35. package/dist/components/icons/github.d.ts +1 -1
  36. package/dist/components/icons/github.js +16 -11
  37. package/dist/components/icons/gitlab.d.ts +1 -1
  38. package/dist/components/icons/gitlab.js +30 -9
  39. package/dist/components/icons/google.d.ts +1 -1
  40. package/dist/components/icons/google.js +39 -9
  41. package/dist/components/icons/huggingface.d.ts +1 -1
  42. package/dist/components/icons/huggingface.js +38 -9
  43. package/dist/components/icons/index.d.ts +35 -35
  44. package/dist/components/icons/index.js +35 -35
  45. package/dist/components/icons/kakao.d.ts +1 -1
  46. package/dist/components/icons/kakao.js +16 -11
  47. package/dist/components/icons/kick.d.ts +1 -1
  48. package/dist/components/icons/kick.js +20 -11
  49. package/dist/components/icons/line.d.ts +1 -1
  50. package/dist/components/icons/line.js +16 -9
  51. package/dist/components/icons/linear.d.ts +1 -1
  52. package/dist/components/icons/linear.js +16 -9
  53. package/dist/components/icons/linkedin.d.ts +1 -1
  54. package/dist/components/icons/linkedin.js +33 -9
  55. package/dist/components/icons/microsoft.d.ts +1 -1
  56. package/dist/components/icons/microsoft.js +30 -9
  57. package/dist/components/icons/naver.d.ts +1 -1
  58. package/dist/components/icons/naver.js +16 -9
  59. package/dist/components/icons/notion.d.ts +1 -1
  60. package/dist/components/icons/notion.js +16 -9
  61. package/dist/components/icons/paybin.d.ts +1 -1
  62. package/dist/components/icons/paybin.js +32 -8
  63. package/dist/components/icons/paypal.d.ts +1 -1
  64. package/dist/components/icons/paypal.js +30 -9
  65. package/dist/components/icons/polar.d.ts +1 -1
  66. package/dist/components/icons/polar.js +24 -9
  67. package/dist/components/icons/railway.d.ts +1 -1
  68. package/dist/components/icons/railway.js +16 -9
  69. package/dist/components/icons/reddit.d.ts +1 -1
  70. package/dist/components/icons/reddit.js +21 -9
  71. package/dist/components/icons/roblox.d.ts +1 -1
  72. package/dist/components/icons/roblox.js +17 -12
  73. package/dist/components/icons/salesforce.d.ts +1 -1
  74. package/dist/components/icons/salesforce.js +16 -9
  75. package/dist/components/icons/slack.d.ts +1 -1
  76. package/dist/components/icons/slack.js +30 -9
  77. package/dist/components/icons/spotify.d.ts +1 -1
  78. package/dist/components/icons/spotify.js +16 -9
  79. package/dist/components/icons/tiktok.d.ts +1 -1
  80. package/dist/components/icons/tiktok.js +23 -10
  81. package/dist/components/icons/twitch.d.ts +1 -1
  82. package/dist/components/icons/twitch.js +43 -12
  83. package/dist/components/icons/vercel.d.ts +1 -1
  84. package/dist/components/icons/vercel.js +16 -9
  85. package/dist/components/icons/vk.d.ts +1 -1
  86. package/dist/components/icons/vk.js +16 -9
  87. package/dist/components/icons/wechat.d.ts +1 -1
  88. package/dist/components/icons/wechat.js +16 -9
  89. package/dist/components/icons/x.d.ts +1 -1
  90. package/dist/components/icons/x.js +16 -9
  91. package/dist/components/icons/zoom.d.ts +1 -1
  92. package/dist/components/icons/zoom.js +69 -11
  93. package/dist/components/settings/account/theme-preview.js +286 -7
  94. package/dist/core.d.ts +1 -1
  95. package/dist/hooks/auth/use-auth-mutation.d.ts +2 -2
  96. package/dist/hooks/auth/use-auth-mutation.js +12 -9
  97. package/dist/hooks/auth/use-auth-query.d.ts +3 -3
  98. package/dist/hooks/auth/use-auth-query.js +12 -9
  99. package/dist/hooks/auth/use-authenticate.d.ts +2 -2
  100. package/dist/hooks/auth/use-authenticate.js +22 -27
  101. package/dist/hooks/auth/use-is-username-available.d.ts +19 -0
  102. package/dist/hooks/auth/use-is-username-available.js +12 -0
  103. package/dist/hooks/auth/use-request-password-reset.d.ts +5 -6
  104. package/dist/hooks/auth/use-request-password-reset.js +11 -13
  105. package/dist/hooks/auth/use-reset-password.d.ts +8 -9
  106. package/dist/hooks/auth/use-reset-password.js +11 -12
  107. package/dist/hooks/auth/use-send-verification-email.d.ts +5 -6
  108. package/dist/hooks/auth/use-send-verification-email.js +11 -12
  109. package/dist/hooks/auth/use-session.d.ts +2 -2
  110. package/dist/hooks/auth/use-session.js +14 -17
  111. package/dist/hooks/auth/use-sign-in-email.d.ts +6 -7
  112. package/dist/hooks/auth/use-sign-in-email.js +17 -23
  113. package/dist/hooks/auth/use-sign-in-magic-link.d.ts +5 -6
  114. package/dist/hooks/auth/use-sign-in-magic-link.js +11 -12
  115. package/dist/hooks/auth/use-sign-in-passkey.d.ts +58 -0
  116. package/dist/hooks/auth/use-sign-in-passkey.js +18 -0
  117. package/dist/hooks/auth/use-sign-in-social.d.ts +8 -9
  118. package/dist/hooks/auth/use-sign-in-social.js +11 -12
  119. package/dist/hooks/auth/use-sign-in-username.d.ts +53 -0
  120. package/dist/hooks/auth/use-sign-in-username.js +18 -0
  121. package/dist/hooks/auth/use-sign-out.d.ts +4 -5
  122. package/dist/hooks/auth/use-sign-out.js +17 -23
  123. package/dist/hooks/auth/use-sign-up-email.d.ts +822 -79
  124. package/dist/hooks/auth/use-sign-up-email.js +17 -23
  125. package/dist/hooks/auth/use-user.d.ts +58 -58
  126. package/dist/hooks/auth/use-user.js +10 -13
  127. package/dist/hooks/settings/use-account-info.d.ts +5 -5
  128. package/dist/hooks/settings/use-account-info.js +20 -24
  129. package/dist/hooks/settings/use-add-passkey.d.ts +43 -0
  130. package/dist/hooks/settings/use-add-passkey.js +18 -0
  131. package/dist/hooks/settings/use-change-email.d.ts +5 -5
  132. package/dist/hooks/settings/use-change-email.js +17 -22
  133. package/dist/hooks/settings/use-change-password.d.ts +6 -7
  134. package/dist/hooks/settings/use-change-password.js +11 -10
  135. package/dist/hooks/settings/use-delete-passkey.d.ts +21 -0
  136. package/dist/hooks/settings/use-delete-passkey.js +18 -0
  137. package/dist/hooks/settings/use-delete-user.d.ts +8 -9
  138. package/dist/hooks/settings/use-delete-user.js +11 -10
  139. package/dist/hooks/settings/use-link-social.d.ts +5 -5
  140. package/dist/hooks/settings/use-link-social.js +11 -9
  141. package/dist/hooks/settings/use-list-accounts.d.ts +4 -4
  142. package/dist/hooks/settings/use-list-accounts.js +20 -22
  143. package/dist/hooks/settings/use-list-device-sessions.d.ts +2 -2
  144. package/dist/hooks/settings/use-list-device-sessions.js +20 -21
  145. package/dist/hooks/settings/use-list-sessions.d.ts +4 -4
  146. package/dist/hooks/settings/use-list-sessions.js +20 -21
  147. package/dist/hooks/settings/use-list-user-passkeys.d.ts +11 -0
  148. package/dist/hooks/settings/use-list-user-passkeys.js +21 -0
  149. package/dist/hooks/settings/use-revoke-multi-session.d.ts +5 -5
  150. package/dist/hooks/settings/use-revoke-multi-session.js +17 -19
  151. package/dist/hooks/settings/use-revoke-session.d.ts +5 -5
  152. package/dist/hooks/settings/use-revoke-session.js +17 -20
  153. package/dist/hooks/settings/use-set-active-session.d.ts +5 -5
  154. package/dist/hooks/settings/use-set-active-session.js +20 -27
  155. package/dist/hooks/settings/use-unlink-account.d.ts +5 -5
  156. package/dist/hooks/settings/use-unlink-account.js +17 -20
  157. package/dist/hooks/settings/use-update-user.d.ts +2 -2
  158. package/dist/hooks/settings/use-update-user.js +24 -28
  159. package/dist/index.d.ts +40 -32
  160. package/dist/index.js +84 -32
  161. package/dist/lib/auth-client.d.ts +2953 -1241
  162. package/dist/lib/auth-client.js +11 -5
  163. package/dist/lib/auth-config.d.ts +3 -3
  164. package/dist/lib/auth-context.d.ts +2 -2
  165. package/dist/lib/auth-context.js +5 -2
  166. package/dist/lib/provider-icons.d.ts +2 -2
  167. package/dist/lib/provider-icons.js +75 -47
  168. package/dist/lib/utils.d.ts +1 -1
  169. package/dist/lib/utils.js +7 -4
  170. package/package.json +16 -9
  171. package/src/components/auth/auth-provider.tsx +4 -6
  172. package/src/hooks/auth/use-authenticate.ts +3 -1
  173. package/src/hooks/auth/use-is-username-available.ts +22 -0
  174. package/src/hooks/auth/use-request-password-reset.ts +4 -6
  175. package/src/hooks/auth/use-reset-password.ts +4 -6
  176. package/src/hooks/auth/use-send-verification-email.ts +4 -6
  177. package/src/hooks/auth/use-session.ts +2 -1
  178. package/src/hooks/auth/use-sign-in-email.ts +9 -10
  179. package/src/hooks/auth/use-sign-in-magic-link.ts +4 -6
  180. package/src/hooks/auth/use-sign-in-passkey.ts +34 -0
  181. package/src/hooks/auth/use-sign-in-social.ts +4 -6
  182. package/src/hooks/auth/use-sign-in-username.ts +34 -0
  183. package/src/hooks/auth/use-sign-out.ts +6 -7
  184. package/src/hooks/auth/use-sign-up-email.ts +9 -10
  185. package/src/hooks/auth/use-user.ts +1 -2
  186. package/src/hooks/settings/use-account-info.ts +2 -1
  187. package/src/hooks/settings/use-add-passkey.ts +32 -0
  188. package/src/hooks/settings/use-change-email.ts +6 -6
  189. package/src/hooks/settings/use-change-password.ts +4 -6
  190. package/src/hooks/settings/use-delete-passkey.ts +32 -0
  191. package/src/hooks/settings/use-delete-user.ts +4 -6
  192. package/src/hooks/settings/use-link-social.ts +4 -4
  193. package/src/hooks/settings/use-list-accounts.ts +3 -1
  194. package/src/hooks/settings/use-list-device-sessions.ts +3 -1
  195. package/src/hooks/settings/use-list-sessions.ts +3 -1
  196. package/src/hooks/settings/use-list-user-passkeys.ts +30 -0
  197. package/src/hooks/settings/use-revoke-multi-session.ts +6 -6
  198. package/src/hooks/settings/use-revoke-session.ts +4 -5
  199. package/src/hooks/settings/use-set-active-session.ts +9 -8
  200. package/src/hooks/settings/use-unlink-account.ts +4 -5
  201. package/src/hooks/settings/use-update-user.ts +8 -9
  202. package/src/index.ts +8 -0
  203. package/src/lib/auth-client.ts +7 -1
  204. package/src/lib/auth-config.ts +1 -1
  205. package/dist/hooks/auth/use-forgot-password.d.ts +0 -20
  206. package/dist/hooks/auth/use-forgot-password.js +0 -14
  207. package/dist/hooks/use-hydrated.d.ts +0 -6
  208. package/dist/hooks/use-hydrated.js +0 -18
  209. package/dist/lib/auth-config.js +0 -1
  210. package/dist/lib/auth-hook-options.d.ts +0 -8
  211. package/dist/lib/auth-hook-options.js +0 -1
@@ -1,22 +1,21 @@
1
- import { type AuthClient } from "@better-auth-ui/react";
2
- import type { UseAuthMutationOptions } from "../auth/use-auth-mutation";
3
- export { useAuthMutation } from "../auth/use-auth-mutation";
1
+ import { AuthClient } from '../../lib/auth-client';
2
+ import { UseAuthMutationOptions } from '../auth/use-auth-mutation';
4
3
  /**
5
4
  * Hook that creates a mutation for changing the authenticated user's password.
6
5
  *
7
6
  * @returns The `useMutation` result.
8
7
  */
9
- export declare function useChangePassword(options?: UseAuthMutationOptions<AuthClient["changePassword"]>): import("../auth/use-auth-mutation").UseAuthMutationResult<(<FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
8
+ export declare function useChangePassword(options?: UseAuthMutationOptions<AuthClient["changePassword"]>): import('../..').UseAuthMutationResult<(<FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
10
9
  newPassword: string;
11
10
  currentPassword: string;
12
11
  revokeOtherSessions?: boolean | undefined;
13
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
12
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
14
13
  newPassword: string;
15
14
  currentPassword: string;
16
15
  revokeOtherSessions?: boolean | undefined;
17
16
  } & {
18
17
  fetchOptions?: FetchOptions | undefined;
19
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<Omit<{
18
+ }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<Omit<{
20
19
  token: string | null;
21
20
  user: {
22
21
  id: string;
@@ -36,7 +35,7 @@ export declare function useChangePassword(options?: UseAuthMutationOptions<AuthC
36
35
  image?: string | null | undefined;
37
36
  };
38
37
  }, "user"> & {
39
- user: import("better-auth").StripEmptyObjects<{
38
+ user: import('better-auth').StripEmptyObjects<{
40
39
  id: string;
41
40
  createdAt: Date;
42
41
  updatedAt: Date;
@@ -1,11 +1,12 @@
1
- import { useAuth, useAuthMutation } from "@better-auth-ui/react";
2
- export { useAuthMutation } from "../auth/use-auth-mutation";
3
- /**
4
- * Hook that creates a mutation for changing the authenticated user's password.
5
- *
6
- * @returns The `useMutation` result.
7
- */
8
- export function useChangePassword(options) {
9
- const { authClient } = useAuth();
10
- return useAuthMutation({ authFn: authClient.changePassword, options });
1
+ import { useAuth as e } from "../../components/auth/auth-provider.js";
2
+ import { useAuthMutation as t } from "../auth/use-auth-mutation.js";
3
+ //#region src/hooks/settings/use-change-password.ts
4
+ function n(n) {
5
+ let { authClient: r } = e();
6
+ return t({
7
+ authFn: r.changePassword,
8
+ options: n
9
+ });
11
10
  }
11
+ //#endregion
12
+ export { n as useChangePassword };
@@ -0,0 +1,21 @@
1
+ import { AuthClient } from '../../lib/auth-client';
2
+ import { UseAuthMutationOptions } from '../auth/use-auth-mutation';
3
+ /**
4
+ * Hook that creates a mutation for deleting a passkey.
5
+ *
6
+ * Refetches the passkeys list on success.
7
+ *
8
+ * @returns The `useMutation` result.
9
+ */
10
+ export declare function useDeletePasskey(options?: UseAuthMutationOptions<AuthClient["passkey"]["deletePasskey"]>): import('../..').UseAuthMutationResult<(<FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
11
+ id: string;
12
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
13
+ id: string;
14
+ } & {
15
+ fetchOptions?: FetchOptions | undefined;
16
+ }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
17
+ status: boolean;
18
+ }, {
19
+ code?: string | undefined;
20
+ message?: string | undefined;
21
+ }, FetchOptions["throw"] extends true ? true : false>>)>;
@@ -0,0 +1,18 @@
1
+ import { useAuth as e } from "../../components/auth/auth-provider.js";
2
+ import { useAuthMutation as t } from "../auth/use-auth-mutation.js";
3
+ import { useListUserPasskeys as n } from "./use-list-user-passkeys.js";
4
+ //#region src/hooks/settings/use-delete-passkey.ts
5
+ function r(r) {
6
+ let { authClient: i } = e(), { refetch: a } = n();
7
+ return t({
8
+ authFn: i.passkey.deletePasskey,
9
+ options: {
10
+ ...r,
11
+ onSuccess: async (...e) => {
12
+ await a(), await r?.onSuccess?.(...e);
13
+ }
14
+ }
15
+ });
16
+ }
17
+ //#endregion
18
+ export { r as useDeletePasskey };
@@ -1,38 +1,37 @@
1
- import { type AuthClient } from "@better-auth-ui/react";
2
- import type { UseAuthMutationOptions } from "../auth/use-auth-mutation";
3
- export { useAuthMutation } from "../auth/use-auth-mutation";
1
+ import { AuthClient } from '../../lib/auth-client';
2
+ import { UseAuthMutationOptions } from '../auth/use-auth-mutation';
4
3
  /**
5
4
  * Hook that creates a mutation for deleting the authenticated user account.
6
5
  *
7
6
  * @returns The `useMutation` result.
8
7
  */
9
- export declare function useDeleteUser(options?: UseAuthMutationOptions<AuthClient["deleteUser"]>): import("../auth/use-auth-mutation").UseAuthMutationResult<(<FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
8
+ export declare function useDeleteUser(options?: UseAuthMutationOptions<AuthClient["deleteUser"]>): import('../..').UseAuthMutationResult<(<FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
10
9
  callbackURL?: string | undefined;
11
10
  password?: string | undefined;
12
11
  token?: string | undefined;
13
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
12
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import('better-auth').Prettify<{
14
13
  callbackURL?: string | undefined;
15
14
  password?: string | undefined;
16
15
  token?: string | undefined;
17
16
  } & {
18
17
  fetchOptions?: FetchOptions | undefined;
19
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
18
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
20
19
  success: boolean;
21
20
  message: string;
22
21
  }, {
23
22
  code?: string | undefined;
24
23
  message?: string | undefined;
25
24
  }, FetchOptions["throw"] extends true ? true : false>>) & {
26
- callback: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
25
+ callback: <FetchOptions extends import('better-auth').ClientFetchOption<never, Partial<{
27
26
  token: string;
28
27
  callbackURL?: string | undefined;
29
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
28
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
30
29
  query: {
31
30
  token: string;
32
31
  callbackURL?: string | undefined;
33
32
  };
34
33
  fetchOptions?: FetchOptions | undefined;
35
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
34
+ }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
36
35
  success: boolean;
37
36
  message: string;
38
37
  }, {
@@ -1,11 +1,12 @@
1
- import { useAuth, useAuthMutation } from "@better-auth-ui/react";
2
- export { useAuthMutation } from "../auth/use-auth-mutation";
3
- /**
4
- * Hook that creates a mutation for deleting the authenticated user account.
5
- *
6
- * @returns The `useMutation` result.
7
- */
8
- export function useDeleteUser(options) {
9
- const { authClient } = useAuth();
10
- return useAuthMutation({ authFn: authClient.deleteUser, options });
1
+ import { useAuth as e } from "../../components/auth/auth-provider.js";
2
+ import { useAuthMutation as t } from "../auth/use-auth-mutation.js";
3
+ //#region src/hooks/settings/use-delete-user.ts
4
+ function n(n) {
5
+ let { authClient: r } = e();
6
+ return t({
7
+ authFn: r.deleteUser,
8
+ options: n
9
+ });
11
10
  }
11
+ //#endregion
12
+ export { n as useDeleteUser };
@@ -1,11 +1,11 @@
1
- import { type AuthClient } from "@better-auth-ui/react";
2
- import type { UseAuthMutationOptions } from "../auth/use-auth-mutation";
1
+ import { AuthClient } from '../../lib/auth-client';
2
+ import { UseAuthMutationOptions } from '../auth/use-auth-mutation';
3
3
  /**
4
4
  * Hook that creates a mutation for linking a social provider to the current user.
5
5
  *
6
6
  * @returns The `useMutation` result.
7
7
  */
8
- export declare function useLinkSocial(options?: UseAuthMutationOptions<AuthClient["linkSocial"]>): import("../auth/use-auth-mutation").UseAuthMutationResult<(<FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
8
+ export declare function useLinkSocial(options?: UseAuthMutationOptions<AuthClient["linkSocial"]>): import('../..').UseAuthMutationResult<(<FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
9
9
  provider: unknown;
10
10
  callbackURL?: string | undefined;
11
11
  idToken?: {
@@ -20,7 +20,7 @@ export declare function useLinkSocial(options?: UseAuthMutationOptions<AuthClien
20
20
  errorCallbackURL?: string | undefined;
21
21
  disableRedirect?: boolean | undefined;
22
22
  additionalData?: Record<string, any> | undefined;
23
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
23
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
24
24
  provider: unknown;
25
25
  callbackURL?: string | undefined;
26
26
  idToken?: {
@@ -37,7 +37,7 @@ export declare function useLinkSocial(options?: UseAuthMutationOptions<AuthClien
37
37
  additionalData?: Record<string, any> | undefined;
38
38
  } & {
39
39
  fetchOptions?: FetchOptions | undefined;
40
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
40
+ }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
41
41
  url: string;
42
42
  redirect: boolean;
43
43
  }, {
@@ -1,10 +1,12 @@
1
- import { useAuth, useAuthMutation } from "@better-auth-ui/react";
2
- /**
3
- * Hook that creates a mutation for linking a social provider to the current user.
4
- *
5
- * @returns The `useMutation` result.
6
- */
7
- export function useLinkSocial(options) {
8
- const { authClient } = useAuth();
9
- return useAuthMutation({ authFn: authClient.linkSocial, options });
1
+ import { useAuth as e } from "../../components/auth/auth-provider.js";
2
+ import { useAuthMutation as t } from "../auth/use-auth-mutation.js";
3
+ //#region src/hooks/settings/use-link-social.ts
4
+ function n(n) {
5
+ let { authClient: r } = e();
6
+ return t({
7
+ authFn: r.linkSocial,
8
+ options: n
9
+ });
10
10
  }
11
+ //#endregion
12
+ export { n as useLinkSocial };
@@ -1,5 +1,5 @@
1
- import { type AuthClient } from "@better-auth-ui/react";
2
- import { type UseAuthQueryOptions } from "../auth/use-auth-query";
1
+ import { AuthClient } from '../../lib/auth-client';
2
+ import { UseAuthQueryOptions } from '../auth/use-auth-query';
3
3
  /**
4
4
  * Retrieve the current user's linked social accounts.
5
5
  *
@@ -9,7 +9,7 @@ import { type UseAuthQueryOptions } from "../auth/use-auth-query";
9
9
  * @param options - Optional react-query / initial-data options forwarded to `useSession` and `useQuery`
10
10
  * @returns The react-query result containing linked accounts data, loading state, and error state
11
11
  */
12
- export declare function useListAccounts(options?: Partial<UseAuthQueryOptions<AuthClient["listAccounts"]>>): import("@tanstack/react-query").UseQueryResult<{
12
+ export declare function useListAccounts(options?: Partial<UseAuthQueryOptions<AuthClient["listAccounts"]>>): import('@tanstack/react-query').UseQueryResult<{
13
13
  scopes: string[];
14
14
  id: string;
15
15
  createdAt: Date;
@@ -17,4 +17,4 @@ export declare function useListAccounts(options?: Partial<UseAuthQueryOptions<Au
17
17
  userId: string;
18
18
  providerId: string;
19
19
  accountId: string;
20
- }[] | null, import("better-auth/react").BetterFetchError>;
20
+ }[] | null, import('better-auth/client').BetterFetchError>;
@@ -1,23 +1,21 @@
1
- import { useAuth, useSession } from "@better-auth-ui/react";
2
- import { useAuthQuery } from "../auth/use-auth-query";
3
- /**
4
- * Retrieve the current user's linked social accounts.
5
- *
6
- * The query runs only when at least one social provider is configured and a session exists.
7
- * The provided `options` are forwarded to both `useSession` and `useQuery`, allowing customization of initial data and query behavior.
8
- *
9
- * @param options - Optional react-query / initial-data options forwarded to `useSession` and `useQuery`
10
- * @returns The react-query result containing linked accounts data, loading state, and error state
11
- */
12
- export function useListAccounts(options) {
13
- const { authClient } = useAuth();
14
- const { data: session } = useSession({ refetchOnMount: false });
15
- return useAuthQuery({
16
- authFn: authClient.listAccounts,
17
- options: {
18
- queryKey: ["auth", "listAccounts", session?.user.id],
19
- enabled: !!session,
20
- ...options
21
- }
22
- });
1
+ import { useAuth as e } from "../../components/auth/auth-provider.js";
2
+ import { useAuthQuery as t } from "../auth/use-auth-query.js";
3
+ import { useSession as n } from "../auth/use-session.js";
4
+ //#region src/hooks/settings/use-list-accounts.ts
5
+ function r(r) {
6
+ let { authClient: i } = e(), { data: a } = n({ refetchOnMount: !1 });
7
+ return t({
8
+ authFn: i.listAccounts,
9
+ options: {
10
+ queryKey: [
11
+ "auth",
12
+ "listAccounts",
13
+ a?.user.id
14
+ ],
15
+ enabled: !!a,
16
+ ...r
17
+ }
18
+ });
23
19
  }
20
+ //#endregion
21
+ export { r as useListAccounts };
@@ -1,5 +1,5 @@
1
- import { type AuthClient } from "@better-auth-ui/react";
2
- import { type UseAuthQueryOptions, type UseAuthQueryResult } from "../auth/use-auth-query";
1
+ import { AuthClient } from '../../lib/auth-client';
2
+ import { UseAuthQueryOptions, UseAuthQueryResult } from '../auth/use-auth-query';
3
3
  /**
4
4
  * Retrieve device sessions for multi-session account switching.
5
5
  *
@@ -1,22 +1,21 @@
1
- import { useAuth, useSession } from "@better-auth-ui/react";
2
- import { useAuthQuery } from "../auth/use-auth-query";
3
- /**
4
- * Retrieve device sessions for multi-session account switching.
5
- *
6
- * The query is enabled only when `multiSession` is true and session data is available.
7
- *
8
- * @param options - Optional React Query options to customize the query behavior.
9
- * @returns The React Query result for the device sessions list; `data` is the array of device session objects and includes loading and error states.
10
- */
11
- export function useListDeviceSessions(options) {
12
- const { authClient } = useAuth();
13
- const { data: session } = useSession({ refetchOnMount: false });
14
- return useAuthQuery({
15
- authFn: authClient.multiSession.listDeviceSessions,
16
- options: {
17
- queryKey: ["auth", "multiSession", "listDeviceSessions"],
18
- enabled: !!session,
19
- ...options
20
- }
21
- });
1
+ import { useAuth as e } from "../../components/auth/auth-provider.js";
2
+ import { useAuthQuery as t } from "../auth/use-auth-query.js";
3
+ import { useSession as n } from "../auth/use-session.js";
4
+ //#region src/hooks/settings/use-list-device-sessions.ts
5
+ function r(r) {
6
+ let { authClient: i } = e(), { data: a } = n({ refetchOnMount: !1 });
7
+ return t({
8
+ authFn: i.multiSession.listDeviceSessions,
9
+ options: {
10
+ queryKey: [
11
+ "auth",
12
+ "multiSession",
13
+ "listDeviceSessions"
14
+ ],
15
+ enabled: !!a,
16
+ ...r
17
+ }
18
+ });
22
19
  }
20
+ //#endregion
21
+ export { r as useListDeviceSessions };
@@ -1,5 +1,5 @@
1
- import { type AuthClient } from "@better-auth-ui/react";
2
- import { type UseAuthQueryOptions } from "../auth/use-auth-query";
1
+ import { AuthClient } from '../../lib/auth-client';
2
+ import { UseAuthQueryOptions } from '../auth/use-auth-query';
3
3
  /**
4
4
  * Retrieve the active sessions (devices where the current user is signed in).
5
5
  *
@@ -8,7 +8,7 @@ import { type UseAuthQueryOptions } from "../auth/use-auth-query";
8
8
  * @param options - Optional React Query options to customize the query behavior.
9
9
  * @returns The React Query result for the sessions list; `data` is the array of session objects, and the result includes loading and error states.
10
10
  */
11
- export declare function useListSessions(options?: Partial<UseAuthQueryOptions<AuthClient["listSessions"]>>): import("@tanstack/react-query").UseQueryResult<import("better-auth").Prettify<{
11
+ export declare function useListSessions(options?: Partial<UseAuthQueryOptions<AuthClient["listSessions"]>>): import('@tanstack/react-query').UseQueryResult<import('better-auth').Prettify<{
12
12
  id: string;
13
13
  createdAt: Date;
14
14
  updatedAt: Date;
@@ -17,4 +17,4 @@ export declare function useListSessions(options?: Partial<UseAuthQueryOptions<Au
17
17
  token: string;
18
18
  ipAddress?: string | null | undefined | undefined;
19
19
  userAgent?: string | null | undefined | undefined;
20
- }>[] | null, import("better-auth/react").BetterFetchError>;
20
+ }>[] | null, import('better-auth/client').BetterFetchError>;
@@ -1,22 +1,21 @@
1
- import { useAuth, useSession } from "@better-auth-ui/react";
2
- import { useAuthQuery } from "../auth/use-auth-query";
3
- /**
4
- * Retrieve the active sessions (devices where the current user is signed in).
5
- *
6
- * The underlying query is enabled only when session data is available.
7
- *
8
- * @param options - Optional React Query options to customize the query behavior.
9
- * @returns The React Query result for the sessions list; `data` is the array of session objects, and the result includes loading and error states.
10
- */
11
- export function useListSessions(options) {
12
- const { authClient } = useAuth();
13
- const { data: session } = useSession({ refetchOnMount: false });
14
- return useAuthQuery({
15
- authFn: authClient.listSessions,
16
- options: {
17
- queryKey: ["auth", "listSessions", session?.user.id],
18
- enabled: !!session,
19
- ...options
20
- }
21
- });
1
+ import { useAuth as e } from "../../components/auth/auth-provider.js";
2
+ import { useAuthQuery as t } from "../auth/use-auth-query.js";
3
+ import { useSession as n } from "../auth/use-session.js";
4
+ //#region src/hooks/settings/use-list-sessions.ts
5
+ function r(r) {
6
+ let { authClient: i } = e(), { data: a } = n({ refetchOnMount: !1 });
7
+ return t({
8
+ authFn: i.listSessions,
9
+ options: {
10
+ queryKey: [
11
+ "auth",
12
+ "listSessions",
13
+ a?.user.id
14
+ ],
15
+ enabled: !!a,
16
+ ...r
17
+ }
18
+ });
22
19
  }
20
+ //#endregion
21
+ export { r as useListSessions };
@@ -0,0 +1,11 @@
1
+ import { AuthClient } from '../../lib/auth-client';
2
+ import { UseAuthQueryOptions } from '../auth/use-auth-query';
3
+ /**
4
+ * Retrieve the passkeys registered for the current user.
5
+ *
6
+ * The underlying query is enabled only when session data is available.
7
+ *
8
+ * @param options - Optional React Query options to customize the query behavior.
9
+ * @returns The React Query result for the passkeys list.
10
+ */
11
+ export declare function useListUserPasskeys(options?: Partial<UseAuthQueryOptions<AuthClient["passkey"]["listUserPasskeys"]>>): import('@tanstack/react-query').UseQueryResult<import('@better-auth/passkey/client').Passkey[] | null, import('better-auth/client').BetterFetchError>;
@@ -0,0 +1,21 @@
1
+ import { useAuth as e } from "../../components/auth/auth-provider.js";
2
+ import { useAuthQuery as t } from "../auth/use-auth-query.js";
3
+ import { useSession as n } from "../auth/use-session.js";
4
+ //#region src/hooks/settings/use-list-user-passkeys.ts
5
+ function r(r) {
6
+ let { authClient: i } = e(), { data: a } = n({ refetchOnMount: !1 });
7
+ return t({
8
+ authFn: i.passkey.listUserPasskeys,
9
+ options: {
10
+ queryKey: [
11
+ "auth",
12
+ "listUserPasskeys",
13
+ a?.user.id
14
+ ],
15
+ enabled: !!a,
16
+ ...r
17
+ }
18
+ });
19
+ }
20
+ //#endregion
21
+ export { r as useListUserPasskeys };
@@ -1,17 +1,17 @@
1
- import { type AuthClient } from "@better-auth-ui/react";
2
- import type { UseAuthMutationOptions } from "../auth/use-auth-mutation";
1
+ import { AuthClient } from '../../lib/auth-client';
2
+ import { UseAuthMutationOptions } from '../auth/use-auth-mutation';
3
3
  /**
4
4
  * Hook that creates a mutation for revoking a device session in multi-session mode.
5
5
  *
6
6
  * @returns The `useMutation` result.
7
7
  */
8
- export declare function useRevokeMultiSession(options?: UseAuthMutationOptions<AuthClient["multiSession"]["revoke"]>): import("../auth/use-auth-mutation").UseAuthMutationResult<(<FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
8
+ export declare function useRevokeMultiSession(options?: UseAuthMutationOptions<AuthClient["multiSession"]["revoke"]>): import('../..').UseAuthMutationResult<(<FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
9
9
  sessionToken: string;
10
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
10
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
11
11
  sessionToken: string;
12
12
  } & {
13
13
  fetchOptions?: FetchOptions | undefined;
14
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
14
+ }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
15
15
  status: boolean;
16
16
  }, {
17
17
  code?: string | undefined;
@@ -1,20 +1,18 @@
1
- import { useAuth, useAuthMutation, useListDeviceSessions } from "@better-auth-ui/react";
2
- /**
3
- * Hook that creates a mutation for revoking a device session in multi-session mode.
4
- *
5
- * @returns The `useMutation` result.
6
- */
7
- export function useRevokeMultiSession(options) {
8
- const { authClient } = useAuth();
9
- const { refetch } = useListDeviceSessions({ refetchOnMount: false });
10
- return useAuthMutation({
11
- authFn: authClient.multiSession.revoke,
12
- options: {
13
- ...options,
14
- onSuccess: async (...args) => {
15
- await refetch();
16
- await options?.onSuccess?.(...args);
17
- }
18
- }
19
- });
1
+ import { useAuth as e } from "../../components/auth/auth-provider.js";
2
+ import { useAuthMutation as t } from "../auth/use-auth-mutation.js";
3
+ import { useListDeviceSessions as n } from "./use-list-device-sessions.js";
4
+ //#region src/hooks/settings/use-revoke-multi-session.ts
5
+ function r(r) {
6
+ let { authClient: i } = e(), { refetch: a } = n({ refetchOnMount: !1 });
7
+ return t({
8
+ authFn: i.multiSession.revoke,
9
+ options: {
10
+ ...r,
11
+ onSuccess: async (...e) => {
12
+ await a(), await r?.onSuccess?.(...e);
13
+ }
14
+ }
15
+ });
20
16
  }
17
+ //#endregion
18
+ export { r as useRevokeMultiSession };
@@ -1,17 +1,17 @@
1
- import { type AuthClient } from "@better-auth-ui/react";
2
- import type { UseAuthMutationOptions } from "../auth/use-auth-mutation";
1
+ import { AuthClient } from '../../lib/auth-client';
2
+ import { UseAuthMutationOptions } from '../auth/use-auth-mutation';
3
3
  /**
4
4
  * Hook that creates a mutation for revoking a user session.
5
5
  *
6
6
  * @returns The `useMutation` result.
7
7
  */
8
- export declare function useRevokeSession(options?: UseAuthMutationOptions<AuthClient["revokeSession"]>): import("../auth/use-auth-mutation").UseAuthMutationResult<(<FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
8
+ export declare function useRevokeSession(options?: UseAuthMutationOptions<AuthClient["revokeSession"]>): import('../..').UseAuthMutationResult<(<FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
9
9
  token: string;
10
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
10
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
11
11
  token: string;
12
12
  } & {
13
13
  fetchOptions?: FetchOptions | undefined;
14
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
14
+ }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
15
15
  status: boolean;
16
16
  }, {
17
17
  code?: string | undefined;
@@ -1,21 +1,18 @@
1
- import { useAuth, useAuthMutation } from "@better-auth-ui/react";
2
- import { useListSessions } from "./use-list-sessions";
3
- /**
4
- * Hook that creates a mutation for revoking a user session.
5
- *
6
- * @returns The `useMutation` result.
7
- */
8
- export function useRevokeSession(options) {
9
- const { authClient } = useAuth();
10
- const { refetch } = useListSessions({ refetchOnMount: false });
11
- return useAuthMutation({
12
- authFn: authClient.revokeSession,
13
- options: {
14
- ...options,
15
- onSuccess: async (...args) => {
16
- await refetch();
17
- await options?.onSuccess?.(...args);
18
- }
19
- }
20
- });
1
+ import { useAuth as e } from "../../components/auth/auth-provider.js";
2
+ import { useAuthMutation as t } from "../auth/use-auth-mutation.js";
3
+ import { useListSessions as n } from "./use-list-sessions.js";
4
+ //#region src/hooks/settings/use-revoke-session.ts
5
+ function r(r) {
6
+ let { authClient: i } = e(), { refetch: a } = n({ refetchOnMount: !1 });
7
+ return t({
8
+ authFn: i.revokeSession,
9
+ options: {
10
+ ...r,
11
+ onSuccess: async (...e) => {
12
+ await a(), await r?.onSuccess?.(...e);
13
+ }
14
+ }
15
+ });
21
16
  }
17
+ //#endregion
18
+ export { r as useRevokeSession };
@@ -1,17 +1,17 @@
1
- import { type AuthClient } from "@better-auth-ui/react";
2
- import type { UseAuthMutationOptions } from "../auth/use-auth-mutation";
1
+ import { AuthClient } from '../../lib/auth-client';
2
+ import { UseAuthMutationOptions } from '../auth/use-auth-mutation';
3
3
  /**
4
4
  * Hook that sets an active device session in multi-session mode.
5
5
  *
6
6
  * @returns The `useMutation` result.
7
7
  */
8
- export declare function useSetActiveSession(options?: UseAuthMutationOptions<AuthClient["multiSession"]["setActive"]>): import("../auth/use-auth-mutation").UseAuthMutationResult<(<FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
8
+ export declare function useSetActiveSession(options?: UseAuthMutationOptions<AuthClient["multiSession"]["setActive"]>): import('../..').UseAuthMutationResult<(<FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
9
9
  sessionToken: string;
10
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
10
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
11
11
  sessionToken: string;
12
12
  } & {
13
13
  fetchOptions?: FetchOptions | undefined;
14
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
14
+ }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
15
15
  session: {
16
16
  id: string;
17
17
  createdAt: Date;