@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,11 +1,9 @@
1
+ import { useAuth } from "../../components/auth/auth-provider"
2
+ import type { AuthClient } from "../../lib/auth-client"
1
3
  import {
2
- type AuthClient,
3
- useAuth,
4
+ type UseAuthMutationOptions,
4
5
  useAuthMutation
5
- } from "@better-auth-ui/react"
6
- import type { UseAuthMutationOptions } from "../auth/use-auth-mutation"
7
-
8
- export { useAuthMutation } from "../auth/use-auth-mutation"
6
+ } from "../auth/use-auth-mutation"
9
7
 
10
8
  /**
11
9
  * Hook that creates a mutation for changing the authenticated user's password.
@@ -0,0 +1,32 @@
1
+ import { useAuth } from "../../components/auth/auth-provider"
2
+ import type { AuthClient } from "../../lib/auth-client"
3
+ import {
4
+ type UseAuthMutationOptions,
5
+ useAuthMutation
6
+ } from "../auth/use-auth-mutation"
7
+ import { useListUserPasskeys } from "./use-list-user-passkeys"
8
+
9
+ /**
10
+ * Hook that creates a mutation for deleting a passkey.
11
+ *
12
+ * Refetches the passkeys list on success.
13
+ *
14
+ * @returns The `useMutation` result.
15
+ */
16
+ export function useDeletePasskey(
17
+ options?: UseAuthMutationOptions<AuthClient["passkey"]["deletePasskey"]>
18
+ ) {
19
+ const { authClient } = useAuth()
20
+ const { refetch } = useListUserPasskeys()
21
+
22
+ return useAuthMutation({
23
+ authFn: authClient.passkey.deletePasskey,
24
+ options: {
25
+ ...options,
26
+ onSuccess: async (...args) => {
27
+ await refetch()
28
+ await options?.onSuccess?.(...args)
29
+ }
30
+ }
31
+ })
32
+ }
@@ -1,11 +1,9 @@
1
+ import { useAuth } from "../../components/auth/auth-provider"
2
+ import type { AuthClient } from "../../lib/auth-client"
1
3
  import {
2
- type AuthClient,
3
- useAuth,
4
+ type UseAuthMutationOptions,
4
5
  useAuthMutation
5
- } from "@better-auth-ui/react"
6
- import type { UseAuthMutationOptions } from "../auth/use-auth-mutation"
7
-
8
- export { useAuthMutation } from "../auth/use-auth-mutation"
6
+ } from "../auth/use-auth-mutation"
9
7
 
10
8
  /**
11
9
  * Hook that creates a mutation for deleting the authenticated user account.
@@ -1,9 +1,9 @@
1
+ import { useAuth } from "../../components/auth/auth-provider"
2
+ import type { AuthClient } from "../../lib/auth-client"
1
3
  import {
2
- type AuthClient,
3
- useAuth,
4
+ type UseAuthMutationOptions,
4
5
  useAuthMutation
5
- } from "@better-auth-ui/react"
6
- import type { UseAuthMutationOptions } from "../auth/use-auth-mutation"
6
+ } from "../auth/use-auth-mutation"
7
7
 
8
8
  /**
9
9
  * Hook that creates a mutation for linking a social provider to the current user.
@@ -1,5 +1,7 @@
1
- import { type AuthClient, useAuth, useSession } from "@better-auth-ui/react"
1
+ import { useAuth } from "../../components/auth/auth-provider"
2
+ import type { AuthClient } from "../../lib/auth-client"
2
3
  import { type UseAuthQueryOptions, useAuthQuery } from "../auth/use-auth-query"
4
+ import { useSession } from "../auth/use-session"
3
5
 
4
6
  /**
5
7
  * Retrieve the current user's linked social accounts.
@@ -1,9 +1,11 @@
1
- import { type AuthClient, useAuth, useSession } from "@better-auth-ui/react"
1
+ import { useAuth } from "../../components/auth/auth-provider"
2
+ import type { AuthClient } from "../../lib/auth-client"
2
3
  import {
3
4
  type UseAuthQueryOptions,
4
5
  type UseAuthQueryResult,
5
6
  useAuthQuery
6
7
  } from "../auth/use-auth-query"
8
+ import { useSession } from "../auth/use-session"
7
9
 
8
10
  /**
9
11
  * Retrieve device sessions for multi-session account switching.
@@ -1,5 +1,7 @@
1
- import { type AuthClient, useAuth, useSession } from "@better-auth-ui/react"
1
+ import { useAuth } from "../../components/auth/auth-provider"
2
+ import type { AuthClient } from "../../lib/auth-client"
2
3
  import { type UseAuthQueryOptions, useAuthQuery } from "../auth/use-auth-query"
4
+ import { useSession } from "../auth/use-session"
3
5
 
4
6
  /**
5
7
  * Retrieve the active sessions (devices where the current user is signed in).
@@ -0,0 +1,30 @@
1
+ import { useAuth } from "../../components/auth/auth-provider"
2
+ import type { AuthClient } from "../../lib/auth-client"
3
+ import { type UseAuthQueryOptions, useAuthQuery } from "../auth/use-auth-query"
4
+ import { useSession } from "../auth/use-session"
5
+
6
+ /**
7
+ * Retrieve the passkeys registered for the current user.
8
+ *
9
+ * The underlying query is enabled only when session data is available.
10
+ *
11
+ * @param options - Optional React Query options to customize the query behavior.
12
+ * @returns The React Query result for the passkeys list.
13
+ */
14
+ export function useListUserPasskeys(
15
+ options?: Partial<
16
+ UseAuthQueryOptions<AuthClient["passkey"]["listUserPasskeys"]>
17
+ >
18
+ ) {
19
+ const { authClient } = useAuth()
20
+ const { data: session } = useSession({ refetchOnMount: false })
21
+
22
+ return useAuthQuery({
23
+ authFn: authClient.passkey.listUserPasskeys,
24
+ options: {
25
+ queryKey: ["auth", "listUserPasskeys", session?.user.id],
26
+ enabled: !!session,
27
+ ...options
28
+ }
29
+ })
30
+ }
@@ -1,10 +1,10 @@
1
+ import { useAuth } from "../../components/auth/auth-provider"
2
+ import type { AuthClient } from "../../lib/auth-client"
1
3
  import {
2
- type AuthClient,
3
- useAuth,
4
- useAuthMutation,
5
- useListDeviceSessions
6
- } from "@better-auth-ui/react"
7
- import type { UseAuthMutationOptions } from "../auth/use-auth-mutation"
4
+ type UseAuthMutationOptions,
5
+ useAuthMutation
6
+ } from "../auth/use-auth-mutation"
7
+ import { useListDeviceSessions } from "./use-list-device-sessions"
8
8
 
9
9
  /**
10
10
  * Hook that creates a mutation for revoking a device session in multi-session mode.
@@ -1,10 +1,9 @@
1
+ import { useAuth } from "../../components/auth/auth-provider"
2
+ import type { AuthClient } from "../../lib/auth-client"
1
3
  import {
2
- type AuthClient,
3
- useAuth,
4
+ type UseAuthMutationOptions,
4
5
  useAuthMutation
5
- } from "@better-auth-ui/react"
6
- import type { UseAuthMutationOptions } from "../auth/use-auth-mutation"
7
-
6
+ } from "../auth/use-auth-mutation"
8
7
  import { useListSessions } from "./use-list-sessions"
9
8
 
10
9
  /**
@@ -1,12 +1,13 @@
1
- import {
2
- type AuthClient,
3
- useAuth,
4
- useAuthMutation,
5
- useListDeviceSessions,
6
- useSession
7
- } from "@better-auth-ui/react"
8
1
  import { useQueryClient } from "@tanstack/react-query"
9
- import type { UseAuthMutationOptions } from "../auth/use-auth-mutation"
2
+
3
+ import { useAuth } from "../../components/auth/auth-provider"
4
+ import type { AuthClient } from "../../lib/auth-client"
5
+ import {
6
+ type UseAuthMutationOptions,
7
+ useAuthMutation
8
+ } from "../auth/use-auth-mutation"
9
+ import { useSession } from "../auth/use-session"
10
+ import { useListDeviceSessions } from "./use-list-device-sessions"
10
11
 
11
12
  /**
12
13
  * Hook that sets an active device session in multi-session mode.
@@ -1,10 +1,9 @@
1
+ import { useAuth } from "../../components/auth/auth-provider"
2
+ import type { AuthClient } from "../../lib/auth-client"
1
3
  import {
2
- type AuthClient,
3
- useAuth,
4
+ type UseAuthMutationOptions,
4
5
  useAuthMutation
5
- } from "@better-auth-ui/react"
6
- import type { UseAuthMutationOptions } from "../auth/use-auth-mutation"
7
-
6
+ } from "../auth/use-auth-mutation"
8
7
  import { useListAccounts } from "./use-list-accounts"
9
8
 
10
9
  /**
@@ -1,14 +1,13 @@
1
- import {
2
- type AuthClient,
3
- useAuth,
4
- useAuthMutation,
5
- useSession
6
- } from "@better-auth-ui/react"
7
1
  import { useQueryClient } from "@tanstack/react-query"
8
- import type {
9
- UseAuthMutationOptions,
10
- UseAuthMutationResult
2
+
3
+ import { useAuth } from "../../components/auth/auth-provider"
4
+ import type { AuthClient } from "../../lib/auth-client"
5
+ import {
6
+ type UseAuthMutationOptions,
7
+ type UseAuthMutationResult,
8
+ useAuthMutation
11
9
  } from "../auth/use-auth-mutation"
10
+ import { useSession } from "../auth/use-session"
12
11
 
13
12
  /**
14
13
  * Hook that creates a mutation for updating the authenticated user's profile.
package/src/index.ts CHANGED
@@ -4,25 +4,33 @@ export * from "./components/auth/auth-provider"
4
4
  export * from "./components/email"
5
5
  export * from "./components/icons"
6
6
  export * from "./components/settings/account/theme-preview"
7
+ export * from "./hooks/auth/use-auth-mutation"
8
+ export * from "./hooks/auth/use-auth-query"
7
9
  export * from "./hooks/auth/use-authenticate"
10
+ export * from "./hooks/auth/use-is-username-available"
8
11
  export * from "./hooks/auth/use-request-password-reset"
9
12
  export * from "./hooks/auth/use-reset-password"
10
13
  export * from "./hooks/auth/use-send-verification-email"
11
14
  export * from "./hooks/auth/use-session"
12
15
  export * from "./hooks/auth/use-sign-in-email"
13
16
  export * from "./hooks/auth/use-sign-in-magic-link"
17
+ export * from "./hooks/auth/use-sign-in-passkey"
14
18
  export * from "./hooks/auth/use-sign-in-social"
19
+ export * from "./hooks/auth/use-sign-in-username"
15
20
  export * from "./hooks/auth/use-sign-out"
16
21
  export * from "./hooks/auth/use-sign-up-email"
17
22
  export * from "./hooks/auth/use-user"
18
23
  export * from "./hooks/settings/use-account-info"
24
+ export * from "./hooks/settings/use-add-passkey"
19
25
  export * from "./hooks/settings/use-change-email"
20
26
  export * from "./hooks/settings/use-change-password"
27
+ export * from "./hooks/settings/use-delete-passkey"
21
28
  export * from "./hooks/settings/use-delete-user"
22
29
  export * from "./hooks/settings/use-link-social"
23
30
  export * from "./hooks/settings/use-list-accounts"
24
31
  export * from "./hooks/settings/use-list-device-sessions"
25
32
  export * from "./hooks/settings/use-list-sessions"
33
+ export * from "./hooks/settings/use-list-user-passkeys"
26
34
  export * from "./hooks/settings/use-revoke-multi-session"
27
35
  export * from "./hooks/settings/use-revoke-session"
28
36
  export * from "./hooks/settings/use-set-active-session"
@@ -1,3 +1,4 @@
1
+ import { passkeyClient } from "@better-auth/passkey/client"
1
2
  import {
2
3
  magicLinkClient,
3
4
  multiSessionClient,
@@ -17,7 +18,12 @@ export type { PathToObject } from "better-auth/client"
17
18
  export type AnyAuthClient = Omit<ReturnType<typeof createAuthClient>, "signUp">
18
19
 
19
20
  const authClient = createAuthClient({
20
- plugins: [magicLinkClient(), multiSessionClient(), usernameClient()]
21
+ plugins: [
22
+ magicLinkClient(),
23
+ multiSessionClient(),
24
+ passkeyClient(),
25
+ usernameClient()
26
+ ]
21
27
  })
22
28
 
23
29
  /**
@@ -1,4 +1,4 @@
1
- import type { AuthConfig as BaseAuthConfig } from "@better-auth-ui/react/core"
1
+ import type { AuthConfig as BaseAuthConfig } from "@better-auth-ui/core"
2
2
  import type { ComponentType, PropsWithChildren } from "react"
3
3
  import type { AnyAuthClient, AuthClient } from "./auth-client"
4
4
 
@@ -1,20 +0,0 @@
1
- import { type AuthClient } from "@better-auth-ui/react";
2
- import type { UseAuthMutationOptions } from "./use-auth-mutation";
3
- export { useAuthMutation } from "./use-auth-mutation";
4
- /**
5
- * Hook that creates a mutation for the forgot-password flow.
6
- *
7
- * The mutation sends a password reset request for the submitted email,
8
- * and navigates to the sign-in view on success.
9
- *
10
- * @returns The `useMutation` result.
11
- */
12
- export declare function useRequestPasswordReset(options?: UseAuthMutationOptions<AuthClient["requestPasswordReset"]>): import("@tanstack/react-query").UseMutationResult<any, import("better-auth/react").BetterFetchError, Omit<import("better-auth").Prettify<{
13
- email: string;
14
- redirectTo?: string | undefined;
15
- } & {
16
- fetchOptions?: import("better-auth").ClientFetchOption<Partial<{
17
- email: string;
18
- redirectTo?: string | undefined;
19
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined> | undefined;
20
- }>, "fetchOptions">>;
@@ -1,14 +0,0 @@
1
- import { useAuth, useAuthMutation } from "@better-auth-ui/react";
2
- export { useAuthMutation } from "./use-auth-mutation";
3
- /**
4
- * Hook that creates a mutation for the forgot-password flow.
5
- *
6
- * The mutation sends a password reset request for the submitted email,
7
- * and navigates to the sign-in view on success.
8
- *
9
- * @returns The `useMutation` result.
10
- */
11
- export function useRequestPasswordReset(options) {
12
- const { authClient } = useAuth();
13
- return useAuthMutation(authClient.requestPasswordReset, options);
14
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * Indicates whether the current rendering context is hydrated (client-side).
3
- *
4
- * @returns `true` when running on the client (hydrated), `false` when rendering on the server
5
- */
6
- export declare function useHydrated(): boolean;
@@ -1,18 +0,0 @@
1
- "use client";
2
- import { useSyncExternalStore } from "react";
3
- /**
4
- * Indicates whether the current rendering context is hydrated (client-side).
5
- *
6
- * @returns `true` when running on the client (hydrated), `false` when rendering on the server
7
- */
8
- export function useHydrated() {
9
- return useSyncExternalStore(subscribe, () => true, () => false);
10
- }
11
- /**
12
- * Create a subscription handler that does nothing and returns a no-op cleanup.
13
- *
14
- * @returns A cleanup function that performs no action when invoked.
15
- */
16
- function subscribe() {
17
- return () => { };
18
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
1
- import type { AuthError } from "@better-auth-ui/core";
2
- /**
3
- * Common options for auth hooks.
4
- */
5
- export interface AuthHookOptions {
6
- onError?: (error: AuthError) => unknown | Promise<unknown>;
7
- onSuccess?: () => unknown | Promise<unknown>;
8
- }
@@ -1 +0,0 @@
1
- export {};