@better-auth-ui/react 1.6.3 → 1.6.5

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 (355) hide show
  1. package/dist/components/auth/auth-provider.d.ts +23 -8
  2. package/dist/components/auth/auth-provider.js +35 -19
  3. package/dist/components/{email → auth/email}/email-changed.js +2 -2
  4. package/dist/components/{email → auth/email}/email-localization.js +1 -1
  5. package/dist/components/{email → auth/email}/email-styles.js +1 -1
  6. package/dist/components/{email → auth/email}/email-verification.js +2 -2
  7. package/dist/components/{email → auth/email}/magic-link.js +2 -2
  8. package/dist/components/{email → auth/email}/new-device.js +2 -2
  9. package/dist/components/{email → auth/email}/otp-email.js +2 -2
  10. package/dist/components/{email → auth/email}/password-changed.js +2 -2
  11. package/dist/components/{email → auth/email}/reset-password.js +2 -2
  12. package/dist/components/auth/fetch-options-provider.d.ts +19 -0
  13. package/dist/components/auth/fetch-options-provider.js +30 -0
  14. package/dist/email.d.ts +1 -0
  15. package/dist/email.js +11 -0
  16. package/dist/hooks/auth/use-authenticate.d.ts +5 -28
  17. package/dist/hooks/auth/use-authenticate.js +12 -12
  18. package/dist/hooks/auth/use-user.d.ts +19 -314
  19. package/dist/hooks/auth/use-user.js +5 -5
  20. package/dist/hooks/use-auth-mutation.d.ts +12 -7
  21. package/dist/hooks/use-auth-plugin.d.ts +31 -0
  22. package/dist/hooks/use-auth-plugin.js +10 -0
  23. package/dist/hooks/use-auth-query.d.ts +3 -3
  24. package/dist/index.d.ts +34 -32
  25. package/dist/index.js +75 -83
  26. package/dist/lib/auth-client.d.ts +23 -3687
  27. package/dist/lib/auth-plugin.d.ts +61 -0
  28. package/dist/lib/auth-server.d.ts +16 -0
  29. package/dist/mutations/auth/request-password-reset-mutation.d.ts +26 -0
  30. package/dist/mutations/auth/request-password-reset-mutation.js +24 -0
  31. package/dist/mutations/auth/reset-password-mutation.d.ts +25 -0
  32. package/dist/mutations/auth/reset-password-mutation.js +24 -0
  33. package/dist/mutations/auth/send-verification-email-mutation.d.ts +24 -0
  34. package/dist/mutations/auth/send-verification-email-mutation.js +24 -0
  35. package/dist/mutations/auth/sign-in-email-mutation.d.ts +71 -0
  36. package/dist/mutations/auth/sign-in-email-mutation.js +29 -0
  37. package/dist/mutations/auth/sign-in-social-mutation.d.ts +77 -0
  38. package/dist/mutations/auth/sign-in-social-mutation.js +24 -0
  39. package/dist/mutations/auth/sign-out-mutation.d.ts +25 -0
  40. package/dist/mutations/auth/sign-out-mutation.js +28 -0
  41. package/dist/mutations/auth/sign-up-email-mutation.d.ts +105 -0
  42. package/dist/mutations/auth/sign-up-email-mutation.js +29 -0
  43. package/dist/mutations/auth-mutation-options.d.ts +37 -20
  44. package/dist/mutations/auth-mutation-options.js +2 -2
  45. package/dist/mutations/magic-link/sign-in-magic-link-mutation.d.ts +24 -0
  46. package/dist/mutations/magic-link/sign-in-magic-link-mutation.js +24 -0
  47. package/dist/mutations/multi-session/revoke-multi-session-mutation.d.ts +25 -0
  48. package/dist/mutations/multi-session/revoke-multi-session-mutation.js +29 -0
  49. package/dist/mutations/multi-session/set-active-session-mutation.d.ts +62 -0
  50. package/dist/mutations/multi-session/set-active-session-mutation.js +31 -0
  51. package/dist/mutations/passkey/add-passkey-mutation.d.ts +71 -0
  52. package/dist/mutations/passkey/add-passkey-mutation.js +29 -0
  53. package/dist/mutations/passkey/delete-passkey-mutation.d.ts +25 -0
  54. package/dist/mutations/passkey/delete-passkey-mutation.js +29 -0
  55. package/dist/mutations/passkey/sign-in-passkey-mutation.d.ts +105 -0
  56. package/dist/mutations/passkey/sign-in-passkey-mutation.js +29 -0
  57. package/dist/mutations/settings/change-email-mutation.d.ts +25 -0
  58. package/dist/mutations/settings/change-email-mutation.js +29 -0
  59. package/dist/mutations/settings/change-password-mutation.d.ts +78 -0
  60. package/dist/mutations/settings/change-password-mutation.js +24 -0
  61. package/dist/mutations/settings/delete-user-mutation.d.ts +26 -0
  62. package/dist/mutations/settings/delete-user-mutation.js +24 -0
  63. package/dist/mutations/settings/link-social-mutation.d.ts +26 -0
  64. package/dist/mutations/settings/link-social-mutation.js +24 -0
  65. package/dist/mutations/settings/revoke-session-mutation.d.ts +25 -0
  66. package/dist/mutations/settings/revoke-session-mutation.js +29 -0
  67. package/dist/mutations/settings/unlink-account-mutation.d.ts +25 -0
  68. package/dist/mutations/settings/unlink-account-mutation.js +29 -0
  69. package/dist/mutations/settings/update-user-mutation.d.ts +25 -0
  70. package/dist/mutations/settings/update-user-mutation.js +35 -0
  71. package/dist/mutations/username/is-username-available-mutation.d.ts +27 -0
  72. package/dist/mutations/username/is-username-available-mutation.js +24 -0
  73. package/dist/mutations/username/sign-in-username-mutation.d.ts +75 -0
  74. package/dist/mutations/username/sign-in-username-mutation.js +29 -0
  75. package/dist/plugins/captcha-plugin.d.ts +29 -0
  76. package/dist/plugins/captcha-plugin.js +29 -0
  77. package/dist/plugins.d.ts +1 -0
  78. package/dist/plugins.js +3 -0
  79. package/dist/queries/auth/session-query.d.ts +71 -0
  80. package/dist/queries/auth/session-query.js +30 -0
  81. package/dist/queries/auth-query-options.d.ts +26 -15
  82. package/dist/queries/multi-session/list-device-sessions-query.d.ts +76 -0
  83. package/dist/queries/multi-session/list-device-sessions-query.js +31 -0
  84. package/dist/queries/passkey/list-passkeys-query.d.ts +74 -0
  85. package/dist/queries/passkey/list-passkeys-query.js +31 -0
  86. package/dist/queries/settings/account-info-query.d.ts +85 -0
  87. package/dist/queries/settings/account-info-query.js +31 -0
  88. package/dist/queries/settings/list-accounts-query.d.ts +76 -0
  89. package/dist/queries/settings/list-accounts-query.js +31 -0
  90. package/dist/queries/settings/list-sessions-query.d.ts +74 -0
  91. package/dist/queries/settings/list-sessions-query.js +31 -0
  92. package/dist/server/queries/auth/session-query.d.ts +57 -0
  93. package/dist/server/queries/auth/session-query.js +13 -0
  94. package/dist/server/queries/multi-session/list-device-sessions-query.d.ts +60 -0
  95. package/dist/server/queries/multi-session/list-device-sessions-query.js +12 -0
  96. package/dist/server/queries/passkey/list-passkeys-query.d.ts +60 -0
  97. package/dist/server/queries/passkey/list-passkeys-query.js +12 -0
  98. package/dist/server/queries/settings/account-info-query.d.ts +68 -0
  99. package/dist/server/queries/settings/account-info-query.js +12 -0
  100. package/dist/server/queries/settings/list-accounts-query.d.ts +60 -0
  101. package/dist/server/queries/settings/list-accounts-query.js +12 -0
  102. package/dist/server/queries/settings/list-sessions-query.d.ts +60 -0
  103. package/dist/server/queries/settings/list-sessions-query.js +12 -0
  104. package/dist/server.d.ts +7 -0
  105. package/dist/server.js +7 -0
  106. package/package.json +28 -22
  107. package/src/components/auth/auth-provider.tsx +88 -25
  108. package/src/components/{email → auth/email}/email-changed.tsx +1 -1
  109. package/src/components/{email → auth/email}/email-verification.tsx +1 -1
  110. package/src/components/{email → auth/email}/magic-link.tsx +1 -1
  111. package/src/components/{email → auth/email}/new-device.tsx +1 -1
  112. package/src/components/{email → auth/email}/otp-email.tsx +1 -1
  113. package/src/components/{email → auth/email}/password-changed.tsx +1 -1
  114. package/src/components/{email → auth/email}/reset-password.tsx +1 -1
  115. package/src/components/auth/fetch-options-provider.tsx +77 -0
  116. package/src/email.ts +1 -0
  117. package/src/hooks/auth/use-authenticate.ts +12 -6
  118. package/src/hooks/auth/use-user.ts +14 -9
  119. package/src/hooks/use-auth-mutation.ts +30 -12
  120. package/src/hooks/use-auth-plugin.ts +50 -0
  121. package/src/hooks/use-auth-query.ts +11 -7
  122. package/src/index.ts +34 -32
  123. package/src/lib/auth-client.ts +33 -31
  124. package/src/lib/auth-plugin.ts +77 -0
  125. package/src/lib/auth-server.ts +30 -0
  126. package/src/mutations/auth/request-password-reset-mutation.ts +58 -0
  127. package/src/mutations/auth/reset-password-mutation.ts +60 -0
  128. package/src/mutations/auth/send-verification-email-mutation.ts +58 -0
  129. package/src/mutations/auth/sign-in-email-mutation.ts +78 -0
  130. package/src/mutations/auth/sign-in-social-mutation.ts +64 -0
  131. package/src/mutations/auth/sign-out-mutation.ts +71 -0
  132. package/src/mutations/auth/sign-up-email-mutation.ts +74 -0
  133. package/src/mutations/auth-mutation-options.ts +83 -38
  134. package/src/mutations/magic-link/sign-in-magic-link-mutation.ts +59 -0
  135. package/src/mutations/multi-session/revoke-multi-session-mutation.ts +70 -0
  136. package/src/mutations/multi-session/set-active-session-mutation.ts +98 -0
  137. package/src/mutations/passkey/add-passkey-mutation.ts +66 -0
  138. package/src/mutations/passkey/delete-passkey-mutation.ts +66 -0
  139. package/src/mutations/passkey/sign-in-passkey-mutation.ts +74 -0
  140. package/src/mutations/settings/change-email-mutation.ts +67 -0
  141. package/src/mutations/settings/change-password-mutation.ts +59 -0
  142. package/src/mutations/settings/delete-user-mutation.ts +59 -0
  143. package/src/mutations/settings/link-social-mutation.ts +59 -0
  144. package/src/mutations/settings/revoke-session-mutation.ts +69 -0
  145. package/src/mutations/settings/unlink-account-mutation.ts +67 -0
  146. package/src/mutations/settings/update-user-mutation.ts +82 -0
  147. package/src/mutations/username/is-username-available-mutation.ts +62 -0
  148. package/src/mutations/username/sign-in-username-mutation.ts +74 -0
  149. package/src/plugins/captcha-plugin.tsx +75 -0
  150. package/src/plugins.ts +3 -0
  151. package/src/queries/auth/session-query.ts +135 -0
  152. package/src/queries/auth-query-options.ts +61 -12
  153. package/src/queries/multi-session/list-device-sessions-query.ts +177 -0
  154. package/src/queries/passkey/list-passkeys-query.ts +154 -0
  155. package/src/queries/settings/account-info-query.ts +158 -0
  156. package/src/queries/settings/list-accounts-query.ts +156 -0
  157. package/src/queries/settings/list-sessions-query.ts +154 -0
  158. package/src/server/queries/auth/session-query.ts +94 -0
  159. package/src/server/queries/multi-session/list-device-sessions-query.ts +102 -0
  160. package/src/server/queries/passkey/list-passkeys-query.ts +100 -0
  161. package/src/server/queries/settings/account-info-query.ts +101 -0
  162. package/src/server/queries/settings/list-accounts-query.ts +101 -0
  163. package/src/server/queries/settings/list-sessions-query.ts +101 -0
  164. package/src/server.ts +7 -0
  165. package/dist/core.d.ts +0 -1
  166. package/dist/core.js +0 -1
  167. package/dist/hooks/auth/use-is-username-available.d.ts +0 -20
  168. package/dist/hooks/auth/use-is-username-available.js +0 -13
  169. package/dist/hooks/auth/use-request-password-reset.d.ts +0 -21
  170. package/dist/hooks/auth/use-request-password-reset.js +0 -13
  171. package/dist/hooks/auth/use-reset-password.d.ts +0 -23
  172. package/dist/hooks/auth/use-reset-password.js +0 -13
  173. package/dist/hooks/auth/use-send-verification-email.d.ts +0 -19
  174. package/dist/hooks/auth/use-send-verification-email.js +0 -13
  175. package/dist/hooks/auth/use-session.d.ts +0 -35
  176. package/dist/hooks/auth/use-session.js +0 -16
  177. package/dist/hooks/auth/use-sign-in-email.d.ts +0 -26
  178. package/dist/hooks/auth/use-sign-in-email.js +0 -17
  179. package/dist/hooks/auth/use-sign-in-magic-link.d.ts +0 -27
  180. package/dist/hooks/auth/use-sign-in-magic-link.js +0 -13
  181. package/dist/hooks/auth/use-sign-in-passkey.d.ts +0 -21
  182. package/dist/hooks/auth/use-sign-in-passkey.js +0 -17
  183. package/dist/hooks/auth/use-sign-in-social.d.ts +0 -63
  184. package/dist/hooks/auth/use-sign-in-social.js +0 -13
  185. package/dist/hooks/auth/use-sign-in-username.d.ts +0 -25
  186. package/dist/hooks/auth/use-sign-in-username.js +0 -17
  187. package/dist/hooks/auth/use-sign-out.d.ts +0 -18
  188. package/dist/hooks/auth/use-sign-out.js +0 -16
  189. package/dist/hooks/auth/use-sign-up-email.d.ts +0 -1186
  190. package/dist/hooks/auth/use-sign-up-email.js +0 -17
  191. package/dist/hooks/settings/use-account-info.d.ts +0 -17
  192. package/dist/hooks/settings/use-account-info.js +0 -18
  193. package/dist/hooks/settings/use-add-passkey.d.ts +0 -21
  194. package/dist/hooks/settings/use-add-passkey.js +0 -17
  195. package/dist/hooks/settings/use-change-email.d.ts +0 -21
  196. package/dist/hooks/settings/use-change-email.js +0 -17
  197. package/dist/hooks/settings/use-change-password.d.ts +0 -21
  198. package/dist/hooks/settings/use-change-password.js +0 -13
  199. package/dist/hooks/settings/use-delete-passkey.d.ts +0 -19
  200. package/dist/hooks/settings/use-delete-passkey.js +0 -17
  201. package/dist/hooks/settings/use-delete-user.d.ts +0 -24
  202. package/dist/hooks/settings/use-delete-user.js +0 -13
  203. package/dist/hooks/settings/use-link-social.d.ts +0 -43
  204. package/dist/hooks/settings/use-link-social.js +0 -13
  205. package/dist/hooks/settings/use-list-accounts.d.ts +0 -22
  206. package/dist/hooks/settings/use-list-accounts.js +0 -15
  207. package/dist/hooks/settings/use-list-device-sessions.d.ts +0 -34
  208. package/dist/hooks/settings/use-list-device-sessions.js +0 -15
  209. package/dist/hooks/settings/use-list-sessions.d.ts +0 -23
  210. package/dist/hooks/settings/use-list-sessions.js +0 -15
  211. package/dist/hooks/settings/use-list-user-passkeys.d.ts +0 -14
  212. package/dist/hooks/settings/use-list-user-passkeys.js +0 -15
  213. package/dist/hooks/settings/use-revoke-multi-session.d.ts +0 -19
  214. package/dist/hooks/settings/use-revoke-multi-session.js +0 -17
  215. package/dist/hooks/settings/use-revoke-session.d.ts +0 -19
  216. package/dist/hooks/settings/use-revoke-session.js +0 -17
  217. package/dist/hooks/settings/use-set-active-session.d.ts +0 -20
  218. package/dist/hooks/settings/use-set-active-session.js +0 -20
  219. package/dist/hooks/settings/use-unlink-account.d.ts +0 -21
  220. package/dist/hooks/settings/use-unlink-account.js +0 -17
  221. package/dist/hooks/settings/use-update-user.d.ts +0 -1185
  222. package/dist/hooks/settings/use-update-user.js +0 -24
  223. package/dist/lib/auth-client.js +0 -11
  224. package/dist/lib/auth-config.d.ts +0 -43
  225. package/dist/lib/auth-context.d.ts +0 -2
  226. package/dist/lib/auth-context.js +0 -6
  227. package/dist/mutations/auth/is-username-available-options.d.ts +0 -19
  228. package/dist/mutations/auth/is-username-available-options.js +0 -7
  229. package/dist/mutations/auth/request-password-reset-options.d.ts +0 -15
  230. package/dist/mutations/auth/request-password-reset-options.js +0 -7
  231. package/dist/mutations/auth/reset-password-options.d.ts +0 -17
  232. package/dist/mutations/auth/reset-password-options.js +0 -7
  233. package/dist/mutations/auth/send-verification-email-options.d.ts +0 -15
  234. package/dist/mutations/auth/send-verification-email-options.js +0 -7
  235. package/dist/mutations/auth/sign-in-email-options.d.ts +0 -23
  236. package/dist/mutations/auth/sign-in-email-options.js +0 -11
  237. package/dist/mutations/auth/sign-in-magic-link-options.d.ts +0 -23
  238. package/dist/mutations/auth/sign-in-magic-link-options.js +0 -11
  239. package/dist/mutations/auth/sign-in-passkey-options.d.ts +0 -15
  240. package/dist/mutations/auth/sign-in-passkey-options.js +0 -11
  241. package/dist/mutations/auth/sign-in-social-options.d.ts +0 -61
  242. package/dist/mutations/auth/sign-in-social-options.js +0 -11
  243. package/dist/mutations/auth/sign-in-username-options.d.ts +0 -19
  244. package/dist/mutations/auth/sign-in-username-options.js +0 -11
  245. package/dist/mutations/auth/sign-out-options.d.ts +0 -12
  246. package/dist/mutations/auth/sign-out-options.js +0 -7
  247. package/dist/mutations/auth/sign-up-email-options.d.ts +0 -1180
  248. package/dist/mutations/auth/sign-up-email-options.js +0 -11
  249. package/dist/mutations/settings/add-passkey-options.d.ts +0 -15
  250. package/dist/mutations/settings/add-passkey-options.js +0 -11
  251. package/dist/mutations/settings/change-email-options.d.ts +0 -15
  252. package/dist/mutations/settings/change-email-options.js +0 -7
  253. package/dist/mutations/settings/change-password-options.d.ts +0 -17
  254. package/dist/mutations/settings/change-password-options.js +0 -7
  255. package/dist/mutations/settings/delete-passkey-options.d.ts +0 -13
  256. package/dist/mutations/settings/delete-passkey-options.js +0 -11
  257. package/dist/mutations/settings/delete-user-options.d.ts +0 -20
  258. package/dist/mutations/settings/delete-user-options.js +0 -7
  259. package/dist/mutations/settings/link-social-options.d.ts +0 -39
  260. package/dist/mutations/settings/link-social-options.js +0 -7
  261. package/dist/mutations/settings/revoke-multi-session-options.d.ts +0 -13
  262. package/dist/mutations/settings/revoke-multi-session-options.js +0 -11
  263. package/dist/mutations/settings/revoke-session-options.d.ts +0 -13
  264. package/dist/mutations/settings/revoke-session-options.js +0 -7
  265. package/dist/mutations/settings/set-active-session-options.d.ts +0 -13
  266. package/dist/mutations/settings/set-active-session-options.js +0 -11
  267. package/dist/mutations/settings/unlink-account-options.d.ts +0 -15
  268. package/dist/mutations/settings/unlink-account-options.js +0 -7
  269. package/dist/mutations/settings/update-user-options.d.ts +0 -1182
  270. package/dist/mutations/settings/update-user-options.js +0 -7
  271. package/dist/queries/auth/session-options.d.ts +0 -110
  272. package/dist/queries/auth/session-options.js +0 -7
  273. package/dist/queries/settings/account-info-options.d.ts +0 -32
  274. package/dist/queries/settings/account-info-options.js +0 -12
  275. package/dist/queries/settings/list-accounts-options.d.ts +0 -53
  276. package/dist/queries/settings/list-accounts-options.js +0 -12
  277. package/dist/queries/settings/list-device-sessions-options.d.ts +0 -99
  278. package/dist/queries/settings/list-device-sessions-options.js +0 -12
  279. package/dist/queries/settings/list-sessions-options.d.ts +0 -54
  280. package/dist/queries/settings/list-sessions-options.js +0 -12
  281. package/dist/queries/settings/list-user-passkeys-options.d.ts +0 -18
  282. package/dist/queries/settings/list-user-passkeys-options.js +0 -12
  283. package/src/core.ts +0 -1
  284. package/src/hooks/auth/use-is-username-available.ts +0 -31
  285. package/src/hooks/auth/use-request-password-reset.ts +0 -33
  286. package/src/hooks/auth/use-reset-password.ts +0 -31
  287. package/src/hooks/auth/use-send-verification-email.ts +0 -31
  288. package/src/hooks/auth/use-session.ts +0 -31
  289. package/src/hooks/auth/use-sign-in-email.ts +0 -41
  290. package/src/hooks/auth/use-sign-in-magic-link.ts +0 -29
  291. package/src/hooks/auth/use-sign-in-passkey.ts +0 -40
  292. package/src/hooks/auth/use-sign-in-social.ts +0 -31
  293. package/src/hooks/auth/use-sign-in-username.ts +0 -40
  294. package/src/hooks/auth/use-sign-out.ts +0 -34
  295. package/src/hooks/auth/use-sign-up-email.ts +0 -40
  296. package/src/hooks/settings/use-account-info.ts +0 -40
  297. package/src/hooks/settings/use-add-passkey.ts +0 -37
  298. package/src/hooks/settings/use-change-email.ts +0 -37
  299. package/src/hooks/settings/use-change-password.ts +0 -29
  300. package/src/hooks/settings/use-delete-passkey.ts +0 -37
  301. package/src/hooks/settings/use-delete-user.ts +0 -29
  302. package/src/hooks/settings/use-link-social.ts +0 -29
  303. package/src/hooks/settings/use-list-accounts.ts +0 -39
  304. package/src/hooks/settings/use-list-device-sessions.ts +0 -39
  305. package/src/hooks/settings/use-list-sessions.ts +0 -39
  306. package/src/hooks/settings/use-list-user-passkeys.ts +0 -39
  307. package/src/hooks/settings/use-revoke-multi-session.ts +0 -39
  308. package/src/hooks/settings/use-revoke-session.ts +0 -39
  309. package/src/hooks/settings/use-set-active-session.ts +0 -58
  310. package/src/hooks/settings/use-unlink-account.ts +0 -37
  311. package/src/hooks/settings/use-update-user.ts +0 -50
  312. package/src/lib/auth-config.ts +0 -48
  313. package/src/lib/auth-context.ts +0 -6
  314. package/src/mutations/auth/is-username-available-options.ts +0 -18
  315. package/src/mutations/auth/request-password-reset-options.ts +0 -14
  316. package/src/mutations/auth/reset-password-options.ts +0 -14
  317. package/src/mutations/auth/send-verification-email-options.ts +0 -14
  318. package/src/mutations/auth/sign-in-email-options.ts +0 -19
  319. package/src/mutations/auth/sign-in-magic-link-options.ts +0 -15
  320. package/src/mutations/auth/sign-in-passkey-options.ts +0 -15
  321. package/src/mutations/auth/sign-in-social-options.ts +0 -19
  322. package/src/mutations/auth/sign-in-username-options.ts +0 -15
  323. package/src/mutations/auth/sign-out-options.ts +0 -11
  324. package/src/mutations/auth/sign-up-email-options.ts +0 -15
  325. package/src/mutations/settings/add-passkey-options.ts +0 -15
  326. package/src/mutations/settings/change-email-options.ts +0 -11
  327. package/src/mutations/settings/change-password-options.ts +0 -14
  328. package/src/mutations/settings/delete-passkey-options.ts +0 -15
  329. package/src/mutations/settings/delete-user-options.ts +0 -11
  330. package/src/mutations/settings/link-social-options.ts +0 -11
  331. package/src/mutations/settings/revoke-multi-session-options.ts +0 -15
  332. package/src/mutations/settings/revoke-session-options.ts +0 -14
  333. package/src/mutations/settings/set-active-session-options.ts +0 -15
  334. package/src/mutations/settings/unlink-account-options.ts +0 -14
  335. package/src/mutations/settings/update-user-options.ts +0 -15
  336. package/src/queries/auth/session-options.ts +0 -18
  337. package/src/queries/settings/account-info-options.ts +0 -25
  338. package/src/queries/settings/list-accounts-options.ts +0 -26
  339. package/src/queries/settings/list-device-sessions-options.ts +0 -24
  340. package/src/queries/settings/list-sessions-options.ts +0 -23
  341. package/src/queries/settings/list-user-passkeys-options.ts +0 -23
  342. /package/dist/components/{email → auth/email}/email-changed.d.ts +0 -0
  343. /package/dist/components/{email → auth/email}/email-localization.d.ts +0 -0
  344. /package/dist/components/{email → auth/email}/email-styles.d.ts +0 -0
  345. /package/dist/components/{email → auth/email}/email-verification.d.ts +0 -0
  346. /package/dist/components/{email → auth/email}/index.d.ts +0 -0
  347. /package/dist/components/{email → auth/email}/index.js +0 -0
  348. /package/dist/components/{email → auth/email}/magic-link.d.ts +0 -0
  349. /package/dist/components/{email → auth/email}/new-device.d.ts +0 -0
  350. /package/dist/components/{email → auth/email}/otp-email.d.ts +0 -0
  351. /package/dist/components/{email → auth/email}/password-changed.d.ts +0 -0
  352. /package/dist/components/{email → auth/email}/reset-password.d.ts +0 -0
  353. /package/src/components/{email → auth/email}/email-localization.tsx +0 -0
  354. /package/src/components/{email → auth/email}/email-styles.tsx +0 -0
  355. /package/src/components/{email → auth/email}/index.ts +0 -0
@@ -1,3691 +1,27 @@
1
+ import { passkeyClient } from '@better-auth/passkey/client';
2
+ import { magicLinkClient, multiSessionClient, usernameClient } from 'better-auth/client/plugins';
1
3
  import { createAuthClient } from 'better-auth/react';
2
- import { AuthConfig } from './auth-config';
3
- export type { PathToObject } from 'better-auth/client';
4
+ export type AuthClient = ReturnType<typeof createAuthClient>;
5
+ export type MagicLinkAuthClient = ReturnType<typeof createAuthClient<{
6
+ plugins: [ReturnType<typeof magicLinkClient>];
7
+ }>>;
8
+ export type MultiSessionAuthClient = ReturnType<typeof createAuthClient<{
9
+ plugins: [ReturnType<typeof multiSessionClient>];
10
+ }>>;
11
+ export type PasskeyAuthClient = ReturnType<typeof createAuthClient<{
12
+ plugins: [ReturnType<typeof passkeyClient>];
13
+ }>>;
14
+ export type UsernameAuthClient = ReturnType<typeof createAuthClient<{
15
+ plugins: [ReturnType<typeof usernameClient>];
16
+ }>>;
4
17
  /**
5
- * Type representing any auth client created with `createAuthClient`.
18
+ * Unwraps a Better Auth client method's `data` payload.
6
19
  *
7
- * Used for type flexibility when accepting auth clients that may have different
8
- * plugin configurations or feature sets.
20
+ * Pass the method type directly, e.g. `TAuthClient["getSession"]` or
21
+ * `TAuthClient["passkey"]["listUserPasskeys"]`. Keeping it method-typed
22
+ * (instead of a path-string utility) preserves IntelliSense on the derived
23
+ * types.
9
24
  */
10
- export type AnyAuthClient = Omit<ReturnType<typeof createAuthClient>, "signUp">;
11
- declare const authClient: {
12
- useListPasskeys: () => {
13
- data: import('@better-auth/passkey/client').Passkey[] | null;
14
- error: null | import('better-auth/client').BetterFetchError;
15
- isPending: boolean;
16
- isRefetching: boolean;
17
- refetch: (queryParams?: {
18
- query?: import('better-auth').SessionQueryParams;
19
- } | undefined) => Promise<void>;
20
- };
21
- } & {
22
- signIn: {
23
- magicLink: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
24
- email: string;
25
- name?: string | undefined;
26
- callbackURL?: string | undefined;
27
- newUserCallbackURL?: string | undefined;
28
- errorCallbackURL?: string | undefined;
29
- metadata?: Record<string, any> | undefined;
30
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
31
- email: string;
32
- name?: string | undefined;
33
- callbackURL?: string | undefined;
34
- newUserCallbackURL?: string | undefined;
35
- errorCallbackURL?: string | undefined;
36
- metadata?: Record<string, any> | undefined;
37
- } & {
38
- fetchOptions?: FetchOptions | undefined;
39
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
40
- status: boolean;
41
- }, {
42
- code?: string | undefined;
43
- message?: string | undefined;
44
- }, FetchOptions["throw"] extends true ? true : false>>;
45
- };
46
- } & {
47
- magicLink: {
48
- verify: <FetchOptions extends import('better-auth').ClientFetchOption<never, Partial<{
49
- token: string;
50
- callbackURL?: string | undefined;
51
- errorCallbackURL?: string | undefined;
52
- newUserCallbackURL?: string | undefined;
53
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
54
- query: {
55
- token: string;
56
- callbackURL?: string | undefined;
57
- errorCallbackURL?: string | undefined;
58
- newUserCallbackURL?: string | undefined;
59
- };
60
- fetchOptions?: FetchOptions | undefined;
61
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<Omit<Omit<{
62
- token: string;
63
- user: {
64
- id: string;
65
- createdAt: Date;
66
- updatedAt: Date;
67
- email: string;
68
- emailVerified: boolean;
69
- name: string;
70
- image?: string | null | undefined;
71
- };
72
- session: {
73
- id: string;
74
- createdAt: Date;
75
- updatedAt: Date;
76
- userId: string;
77
- expiresAt: Date;
78
- token: string;
79
- ipAddress?: string | null | undefined;
80
- userAgent?: string | null | undefined;
81
- };
82
- }, "user"> & {
83
- user: import('better-auth').StripEmptyObjects<{
84
- id: string;
85
- createdAt: Date;
86
- updatedAt: Date;
87
- email: string;
88
- emailVerified: boolean;
89
- name: string;
90
- image?: string | null | undefined;
91
- } & {} & {
92
- username?: string | null | undefined;
93
- displayUsername?: string | null | undefined;
94
- }>;
95
- }, "session"> & {
96
- session: import('better-auth').StripEmptyObjects<{
97
- id: string;
98
- createdAt: Date;
99
- updatedAt: Date;
100
- userId: string;
101
- expiresAt: Date;
102
- token: string;
103
- ipAddress?: string | null | undefined;
104
- userAgent?: string | null | undefined;
105
- }>;
106
- }, {
107
- code?: string | undefined;
108
- message?: string | undefined;
109
- }, FetchOptions["throw"] extends true ? true : false>>;
110
- };
111
- } & {
112
- multiSession: {
113
- listDeviceSessions: <FetchOptions extends import('better-auth').ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import('better-auth').Prettify<{
114
- query?: Record<string, any> | undefined;
115
- fetchOptions?: FetchOptions | undefined;
116
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
117
- session: {
118
- id: string;
119
- createdAt: Date;
120
- updatedAt: Date;
121
- userId: string;
122
- expiresAt: Date;
123
- token: string;
124
- ipAddress?: string | null | undefined;
125
- userAgent?: string | null | undefined;
126
- };
127
- user: {
128
- id: string;
129
- createdAt: Date;
130
- updatedAt: Date;
131
- email: string;
132
- emailVerified: boolean;
133
- name: string;
134
- image?: string | null | undefined;
135
- };
136
- }[], {
137
- code?: string | undefined;
138
- message?: string | undefined;
139
- }, FetchOptions["throw"] extends true ? true : false>>;
140
- };
141
- } & {
142
- multiSession: {
143
- setActive: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
144
- sessionToken: string;
145
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
146
- sessionToken: string;
147
- } & {
148
- fetchOptions?: FetchOptions | undefined;
149
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
150
- session: {
151
- id: string;
152
- createdAt: Date;
153
- updatedAt: Date;
154
- userId: string;
155
- expiresAt: Date;
156
- token: string;
157
- ipAddress?: string | null | undefined;
158
- userAgent?: string | null | undefined;
159
- } & Record<string, any>;
160
- user: {
161
- id: string;
162
- createdAt: Date;
163
- updatedAt: Date;
164
- email: string;
165
- emailVerified: boolean;
166
- name: string;
167
- image?: string | null | undefined;
168
- } & Record<string, any>;
169
- }, {
170
- code?: string | undefined;
171
- message?: string | undefined;
172
- }, FetchOptions["throw"] extends true ? true : false>>;
173
- };
174
- } & {
175
- multiSession: {
176
- revoke: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
177
- sessionToken: string;
178
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
179
- sessionToken: string;
180
- } & {
181
- fetchOptions?: FetchOptions | undefined;
182
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
183
- status: boolean;
184
- }, {
185
- code?: string | undefined;
186
- message?: string | undefined;
187
- }, FetchOptions["throw"] extends true ? true : false>>;
188
- };
189
- } & {
190
- passkey: {
191
- generateRegisterOptions: <FetchOptions extends import('better-auth').ClientFetchOption<never, Partial<{
192
- authenticatorAttachment?: "platform" | "cross-platform" | undefined;
193
- name?: string | undefined;
194
- context?: string | undefined;
195
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import('better-auth').Prettify<{
196
- query?: {
197
- authenticatorAttachment?: "platform" | "cross-platform" | undefined;
198
- name?: string | undefined;
199
- context?: string | undefined;
200
- } | undefined;
201
- fetchOptions?: FetchOptions | undefined;
202
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<import('@better-auth/passkey/client').PublicKeyCredentialCreationOptionsJSON, {
203
- code?: string | undefined;
204
- message?: string | undefined;
205
- }, FetchOptions["throw"] extends true ? true : false>>;
206
- };
207
- } & {
208
- passkey: {
209
- generateAuthenticateOptions: <FetchOptions extends import('better-auth').ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import('better-auth').Prettify<{
210
- query?: Record<string, any> | undefined;
211
- fetchOptions?: FetchOptions | undefined;
212
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<import('@better-auth/passkey/client').PublicKeyCredentialRequestOptionsJSON, {
213
- code?: string | undefined;
214
- message?: string | undefined;
215
- }, FetchOptions["throw"] extends true ? true : false>>;
216
- };
217
- } & {
218
- passkey: {
219
- verifyRegistration: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
220
- response: any;
221
- name?: string | undefined;
222
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
223
- response: any;
224
- name?: string | undefined;
225
- } & {
226
- fetchOptions?: FetchOptions | undefined;
227
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<import('@better-auth/passkey/client').Passkey, {
228
- code?: string | undefined;
229
- message?: string | undefined;
230
- }, FetchOptions["throw"] extends true ? true : false>>;
231
- };
232
- } & {
233
- passkey: {
234
- verifyAuthentication: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
235
- response: import('@better-auth/passkey/client').AuthenticationResponseJSON;
236
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
237
- response: import('@better-auth/passkey/client').AuthenticationResponseJSON;
238
- } & {
239
- fetchOptions?: FetchOptions | undefined;
240
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
241
- session: {
242
- id: string;
243
- createdAt: Date;
244
- updatedAt: Date;
245
- userId: string;
246
- expiresAt: Date;
247
- token: string;
248
- ipAddress?: string | null | undefined;
249
- userAgent?: string | null | undefined;
250
- };
251
- }, {
252
- code?: string | undefined;
253
- message?: string | undefined;
254
- }, FetchOptions["throw"] extends true ? true : false>>;
255
- };
256
- } & {
257
- passkey: {
258
- listUserPasskeys: <FetchOptions extends import('better-auth').ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import('better-auth').Prettify<{
259
- query?: Record<string, any> | undefined;
260
- fetchOptions?: FetchOptions | undefined;
261
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<import('@better-auth/passkey/client').Passkey[], {
262
- code?: string | undefined;
263
- message?: string | undefined;
264
- }, FetchOptions["throw"] extends true ? true : false>>;
265
- };
266
- } & {
267
- passkey: {
268
- deletePasskey: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
269
- id: string;
270
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
271
- id: string;
272
- } & {
273
- fetchOptions?: FetchOptions | undefined;
274
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
275
- status: boolean;
276
- }, {
277
- code?: string | undefined;
278
- message?: string | undefined;
279
- }, FetchOptions["throw"] extends true ? true : false>>;
280
- };
281
- } & {
282
- passkey: {
283
- updatePasskey: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
284
- id: string;
285
- name: string;
286
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
287
- id: string;
288
- name: string;
289
- } & {
290
- fetchOptions?: FetchOptions | undefined;
291
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
292
- passkey: import('@better-auth/passkey/client').Passkey;
293
- }, {
294
- code?: string | undefined;
295
- message?: string | undefined;
296
- }, FetchOptions["throw"] extends true ? true : false>>;
297
- };
298
- } & {
299
- signIn: {
300
- username: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
301
- username: string;
302
- password: string;
303
- rememberMe?: boolean | undefined;
304
- callbackURL?: string | undefined;
305
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
306
- username: string;
307
- password: string;
308
- rememberMe?: boolean | undefined;
309
- callbackURL?: string | undefined;
310
- } & {
311
- fetchOptions?: FetchOptions | undefined;
312
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<Omit<{
313
- token: string;
314
- user: {
315
- id: string;
316
- createdAt: Date;
317
- updatedAt: Date;
318
- email: string;
319
- emailVerified: boolean;
320
- name: string;
321
- image?: string | null | undefined;
322
- } & {
323
- username: string;
324
- displayUsername: string;
325
- };
326
- }, "user"> & {
327
- user: import('better-auth').StripEmptyObjects<{
328
- id: string;
329
- createdAt: Date;
330
- updatedAt: Date;
331
- email: string;
332
- emailVerified: boolean;
333
- name: string;
334
- image?: string | null | undefined;
335
- } & {} & {
336
- username?: string | null | undefined;
337
- displayUsername?: string | null | undefined;
338
- }>;
339
- }, {
340
- code?: string | undefined;
341
- message?: string | undefined;
342
- }, FetchOptions["throw"] extends true ? true : false>>;
343
- };
344
- } & {
345
- isUsernameAvailable: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
346
- username: string;
347
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
348
- username: string;
349
- } & {
350
- fetchOptions?: FetchOptions | undefined;
351
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
352
- available: boolean;
353
- }, {
354
- code?: string | undefined;
355
- message?: string | undefined;
356
- }, FetchOptions["throw"] extends true ? true : false>>;
357
- } & {
358
- deleteUser: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
359
- callbackURL?: string | undefined;
360
- password?: string | undefined;
361
- token?: string | undefined;
362
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import('better-auth').Prettify<{
363
- callbackURL?: string | undefined;
364
- password?: string | undefined;
365
- token?: string | undefined;
366
- } & {
367
- fetchOptions?: FetchOptions | undefined;
368
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
369
- success: boolean;
370
- message: string;
371
- }, {
372
- code?: string | undefined;
373
- message?: string | undefined;
374
- }, FetchOptions["throw"] extends true ? true : false>>;
375
- } & {
376
- signIn: {
377
- social: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
378
- provider: (string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
379
- callbackURL?: string | undefined;
380
- newUserCallbackURL?: string | undefined;
381
- errorCallbackURL?: string | undefined;
382
- disableRedirect?: boolean | undefined;
383
- idToken?: {
384
- token: string;
385
- nonce?: string | undefined;
386
- accessToken?: string | undefined;
387
- refreshToken?: string | undefined;
388
- expiresAt?: number | undefined;
389
- user?: {
390
- name?: {
391
- firstName?: string | undefined;
392
- lastName?: string | undefined;
393
- } | undefined;
394
- email?: string | undefined;
395
- } | undefined;
396
- } | undefined;
397
- scopes?: string[] | undefined;
398
- requestSignUp?: boolean | undefined;
399
- loginHint?: string | undefined;
400
- additionalData?: Record<string, any> | undefined;
401
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
402
- provider: (string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
403
- callbackURL?: string | undefined;
404
- newUserCallbackURL?: string | undefined;
405
- errorCallbackURL?: string | undefined;
406
- disableRedirect?: boolean | undefined;
407
- idToken?: {
408
- token: string;
409
- nonce?: string | undefined;
410
- accessToken?: string | undefined;
411
- refreshToken?: string | undefined;
412
- expiresAt?: number | undefined;
413
- user?: {
414
- name?: {
415
- firstName?: string | undefined;
416
- lastName?: string | undefined;
417
- } | undefined;
418
- email?: string | undefined;
419
- } | undefined;
420
- } | undefined;
421
- scopes?: string[] | undefined;
422
- requestSignUp?: boolean | undefined;
423
- loginHint?: string | undefined;
424
- additionalData?: Record<string, any> | undefined;
425
- } & {
426
- fetchOptions?: FetchOptions | undefined;
427
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
428
- redirect: boolean;
429
- url: string;
430
- } | (Omit<{
431
- redirect: boolean;
432
- token: string;
433
- url: undefined;
434
- user: {
435
- id: string;
436
- createdAt: Date;
437
- updatedAt: Date;
438
- email: string;
439
- emailVerified: boolean;
440
- name: string;
441
- image?: string | null | undefined | undefined;
442
- };
443
- }, "user"> & {
444
- user: import('better-auth').StripEmptyObjects<{
445
- id: string;
446
- createdAt: Date;
447
- updatedAt: Date;
448
- email: string;
449
- emailVerified: boolean;
450
- name: string;
451
- image?: string | null | undefined;
452
- } & {} & {
453
- username?: string | null | undefined;
454
- displayUsername?: string | null | undefined;
455
- }>;
456
- }), {
457
- code?: string | undefined;
458
- message?: string | undefined;
459
- }, FetchOptions["throw"] extends true ? true : false>>;
460
- };
461
- } & {
462
- signOut: <FetchOptions extends import('better-auth').ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import('better-auth').Prettify<{
463
- query?: Record<string, any> | undefined;
464
- fetchOptions?: FetchOptions | undefined;
465
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
466
- success: boolean;
467
- }, {
468
- code?: string | undefined;
469
- message?: string | undefined;
470
- }, FetchOptions["throw"] extends true ? true : false>>;
471
- } & {
472
- signUp: {
473
- email: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
474
- name: string;
475
- email: string;
476
- password: string;
477
- image?: string | undefined;
478
- callbackURL?: string | undefined;
479
- rememberMe?: boolean | undefined;
480
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<import('better-auth/client').InferSignUpEmailCtx<{
481
- plugins: ({
482
- id: "magic-link";
483
- version: string;
484
- $InferServerPlugin: ReturnType<(options: import('better-auth/plugins/magic-link').MagicLinkOptions) => {
485
- id: "magic-link";
486
- version: string;
487
- endpoints: {
488
- signInMagicLink: import('better-auth').StrictEndpoint<"/sign-in/magic-link", {
489
- method: "POST";
490
- requireHeaders: true;
491
- body: import('zod').ZodObject<{
492
- email: import('zod').ZodEmail;
493
- name: import('zod').ZodOptional<import('zod').ZodString>;
494
- callbackURL: import('zod').ZodOptional<import('zod').ZodString>;
495
- newUserCallbackURL: import('zod').ZodOptional<import('zod').ZodString>;
496
- errorCallbackURL: import('zod').ZodOptional<import('zod').ZodString>;
497
- metadata: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodAny>>;
498
- }, import('zod/v4/core').$strip>;
499
- metadata: {
500
- openapi: {
501
- operationId: string;
502
- description: string;
503
- responses: {
504
- 200: {
505
- description: string;
506
- content: {
507
- "application/json": {
508
- schema: {
509
- type: "object";
510
- properties: {
511
- status: {
512
- type: string;
513
- };
514
- };
515
- };
516
- };
517
- };
518
- };
519
- };
520
- };
521
- };
522
- }, {
523
- status: boolean;
524
- }>;
525
- magicLinkVerify: import('better-auth').StrictEndpoint<"/magic-link/verify", {
526
- method: "GET";
527
- query: import('zod').ZodObject<{
528
- token: import('zod').ZodString;
529
- callbackURL: import('zod').ZodOptional<import('zod').ZodString>;
530
- errorCallbackURL: import('zod').ZodOptional<import('zod').ZodString>;
531
- newUserCallbackURL: import('zod').ZodOptional<import('zod').ZodString>;
532
- }, import('zod/v4/core').$strip>;
533
- use: ((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<void>)[];
534
- requireHeaders: true;
535
- metadata: {
536
- openapi: {
537
- operationId: string;
538
- description: string;
539
- responses: {
540
- 200: {
541
- description: string;
542
- content: {
543
- "application/json": {
544
- schema: {
545
- type: "object";
546
- properties: {
547
- session: {
548
- $ref: string;
549
- };
550
- user: {
551
- $ref: string;
552
- };
553
- };
554
- };
555
- };
556
- };
557
- };
558
- };
559
- };
560
- };
561
- }, {
562
- token: string;
563
- user: {
564
- id: string;
565
- createdAt: Date;
566
- updatedAt: Date;
567
- email: string;
568
- emailVerified: boolean;
569
- name: string;
570
- image?: string | null | undefined;
571
- };
572
- session: {
573
- id: string;
574
- createdAt: Date;
575
- updatedAt: Date;
576
- userId: string;
577
- expiresAt: Date;
578
- token: string;
579
- ipAddress?: string | null | undefined;
580
- userAgent?: string | null | undefined;
581
- };
582
- }>;
583
- };
584
- rateLimit: {
585
- pathMatcher(path: string): boolean;
586
- window: number;
587
- max: number;
588
- }[];
589
- options: import('better-auth/plugins/magic-link').MagicLinkOptions;
590
- }>;
591
- } | {
592
- id: "multi-session";
593
- version: string;
594
- $InferServerPlugin: ReturnType<(options?: import('better-auth/plugins/multi-session').MultiSessionConfig | undefined) => {
595
- id: "multi-session";
596
- version: string;
597
- endpoints: {
598
- listDeviceSessions: import('better-auth').StrictEndpoint<"/multi-session/list-device-sessions", {
599
- method: "GET";
600
- requireHeaders: true;
601
- }, {
602
- session: {
603
- id: string;
604
- createdAt: Date;
605
- updatedAt: Date;
606
- userId: string;
607
- expiresAt: Date;
608
- token: string;
609
- ipAddress?: string | null | undefined;
610
- userAgent?: string | null | undefined;
611
- };
612
- user: {
613
- id: string;
614
- createdAt: Date;
615
- updatedAt: Date;
616
- email: string;
617
- emailVerified: boolean;
618
- name: string;
619
- image?: string | null | undefined;
620
- };
621
- }[]>;
622
- setActiveSession: import('better-auth').StrictEndpoint<"/multi-session/set-active", {
623
- method: "POST";
624
- body: import('zod').ZodObject<{
625
- sessionToken: import('zod').ZodString;
626
- }, import('zod/v4/core').$strip>;
627
- requireHeaders: true;
628
- metadata: {
629
- openapi: {
630
- description: string;
631
- responses: {
632
- 200: {
633
- description: string;
634
- content: {
635
- "application/json": {
636
- schema: {
637
- type: "object";
638
- properties: {
639
- session: {
640
- $ref: string;
641
- };
642
- };
643
- };
644
- };
645
- };
646
- };
647
- };
648
- };
649
- };
650
- }, {
651
- session: {
652
- id: string;
653
- createdAt: Date;
654
- updatedAt: Date;
655
- userId: string;
656
- expiresAt: Date;
657
- token: string;
658
- ipAddress?: string | null | undefined;
659
- userAgent?: string | null | undefined;
660
- } & Record<string, any>;
661
- user: {
662
- id: string;
663
- createdAt: Date;
664
- updatedAt: Date;
665
- email: string;
666
- emailVerified: boolean;
667
- name: string;
668
- image?: string | null | undefined;
669
- } & Record<string, any>;
670
- }>;
671
- revokeDeviceSession: import('better-auth').StrictEndpoint<"/multi-session/revoke", {
672
- method: "POST";
673
- body: import('zod').ZodObject<{
674
- sessionToken: import('zod').ZodString;
675
- }, import('zod/v4/core').$strip>;
676
- requireHeaders: true;
677
- use: ((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<{
678
- session: {
679
- session: Record<string, any> & {
680
- id: string;
681
- createdAt: Date;
682
- updatedAt: Date;
683
- userId: string;
684
- expiresAt: Date;
685
- token: string;
686
- ipAddress?: string | null | undefined;
687
- userAgent?: string | null | undefined;
688
- };
689
- user: Record<string, any> & {
690
- id: string;
691
- createdAt: Date;
692
- updatedAt: Date;
693
- email: string;
694
- emailVerified: boolean;
695
- name: string;
696
- image?: string | null | undefined;
697
- };
698
- };
699
- }>)[];
700
- metadata: {
701
- openapi: {
702
- description: string;
703
- responses: {
704
- 200: {
705
- description: string;
706
- content: {
707
- "application/json": {
708
- schema: {
709
- type: "object";
710
- properties: {
711
- status: {
712
- type: string;
713
- };
714
- };
715
- };
716
- };
717
- };
718
- };
719
- };
720
- };
721
- };
722
- }, {
723
- status: boolean;
724
- }>;
725
- };
726
- hooks: {
727
- after: {
728
- matcher: (context: import('better-auth').HookEndpointContext) => boolean;
729
- handler: (inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<void>;
730
- }[];
731
- };
732
- options: import('better-auth/plugins/multi-session').MultiSessionConfig | undefined;
733
- $ERROR_CODES: {
734
- INVALID_SESSION_TOKEN: import('better-auth').RawError<"INVALID_SESSION_TOKEN">;
735
- };
736
- }>;
737
- atomListeners: {
738
- matcher(path: string): path is "/multi-session/set-active";
739
- signal: "$sessionSignal";
740
- }[];
741
- $ERROR_CODES: {
742
- INVALID_SESSION_TOKEN: import('better-auth').RawError<"INVALID_SESSION_TOKEN">;
743
- };
744
- } | {
745
- id: "passkey";
746
- version: string;
747
- $InferServerPlugin: ReturnType<(options?: import('@better-auth/passkey/client').PasskeyOptions | undefined) => {
748
- id: "passkey";
749
- version: string;
750
- endpoints: {
751
- generatePasskeyRegistrationOptions: import('better-auth').StrictEndpoint<"/passkey/generate-register-options", {
752
- method: "GET";
753
- use: ((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<{
754
- session: {
755
- session: Record<string, any> & {
756
- id: string;
757
- createdAt: Date;
758
- updatedAt: Date;
759
- userId: string;
760
- expiresAt: Date;
761
- token: string;
762
- ipAddress?: string | null | undefined;
763
- userAgent?: string | null | undefined;
764
- };
765
- user: Record<string, any> & {
766
- id: string;
767
- createdAt: Date;
768
- updatedAt: Date;
769
- email: string;
770
- emailVerified: boolean;
771
- name: string;
772
- image?: string | null | undefined;
773
- };
774
- };
775
- }>)[] | undefined;
776
- query: import('zod').ZodOptional<import('zod').ZodObject<{
777
- authenticatorAttachment: import('zod').ZodOptional<import('zod').ZodEnum<{
778
- platform: "platform";
779
- "cross-platform": "cross-platform";
780
- }>>;
781
- name: import('zod').ZodOptional<import('zod').ZodString>;
782
- context: import('zod').ZodOptional<import('zod').ZodString>;
783
- }, import('zod/v4/core').$strip>>;
784
- metadata: {
785
- openapi: {
786
- operationId: string;
787
- description: string;
788
- responses: {
789
- 200: {
790
- description: string;
791
- parameters: {
792
- query: {
793
- authenticatorAttachment: {
794
- description: string;
795
- required: boolean;
796
- };
797
- name: {
798
- description: string;
799
- required: boolean;
800
- };
801
- context: {
802
- description: string;
803
- required: boolean;
804
- };
805
- };
806
- };
807
- content: {
808
- "application/json": {
809
- schema: {
810
- type: "object";
811
- properties: {
812
- challenge: {
813
- type: string;
814
- };
815
- rp: {
816
- type: string;
817
- properties: {
818
- name: {
819
- type: string;
820
- };
821
- id: {
822
- type: string;
823
- };
824
- };
825
- };
826
- user: {
827
- type: string;
828
- properties: {
829
- id: {
830
- type: string;
831
- };
832
- name: {
833
- type: string;
834
- };
835
- displayName: {
836
- type: string;
837
- };
838
- };
839
- };
840
- pubKeyCredParams: {
841
- type: string;
842
- items: {
843
- type: string;
844
- properties: {
845
- type: {
846
- type: string;
847
- };
848
- alg: {
849
- type: string;
850
- };
851
- };
852
- };
853
- };
854
- timeout: {
855
- type: string;
856
- };
857
- excludeCredentials: {
858
- type: string;
859
- items: {
860
- type: string;
861
- properties: {
862
- id: {
863
- type: string;
864
- };
865
- type: {
866
- type: string;
867
- };
868
- transports: {
869
- type: string;
870
- items: {
871
- type: string;
872
- };
873
- };
874
- };
875
- };
876
- };
877
- authenticatorSelection: {
878
- type: string;
879
- properties: {
880
- authenticatorAttachment: {
881
- type: string;
882
- };
883
- requireResidentKey: {
884
- type: string;
885
- };
886
- userVerification: {
887
- type: string;
888
- };
889
- };
890
- };
891
- attestation: {
892
- type: string;
893
- };
894
- extensions: {
895
- type: string;
896
- };
897
- };
898
- };
899
- };
900
- };
901
- };
902
- };
903
- };
904
- };
905
- }, import('@better-auth/passkey/client').PublicKeyCredentialCreationOptionsJSON>;
906
- generatePasskeyAuthenticationOptions: import('better-auth').StrictEndpoint<"/passkey/generate-authenticate-options", {
907
- method: "GET";
908
- metadata: {
909
- openapi: {
910
- operationId: string;
911
- description: string;
912
- responses: {
913
- 200: {
914
- description: string;
915
- content: {
916
- "application/json": {
917
- schema: {
918
- type: "object";
919
- properties: {
920
- challenge: {
921
- type: string;
922
- };
923
- rp: {
924
- type: string;
925
- properties: {
926
- name: {
927
- type: string;
928
- };
929
- id: {
930
- type: string;
931
- };
932
- };
933
- };
934
- user: {
935
- type: string;
936
- properties: {
937
- id: {
938
- type: string;
939
- };
940
- name: {
941
- type: string;
942
- };
943
- displayName: {
944
- type: string;
945
- };
946
- };
947
- };
948
- timeout: {
949
- type: string;
950
- };
951
- allowCredentials: {
952
- type: string;
953
- items: {
954
- type: string;
955
- properties: {
956
- id: {
957
- type: string;
958
- };
959
- type: {
960
- type: string;
961
- };
962
- transports: {
963
- type: string;
964
- items: {
965
- type: string;
966
- };
967
- };
968
- };
969
- };
970
- };
971
- userVerification: {
972
- type: string;
973
- };
974
- authenticatorSelection: {
975
- type: string;
976
- properties: {
977
- authenticatorAttachment: {
978
- type: string;
979
- };
980
- requireResidentKey: {
981
- type: string;
982
- };
983
- userVerification: {
984
- type: string;
985
- };
986
- };
987
- };
988
- extensions: {
989
- type: string;
990
- };
991
- };
992
- };
993
- };
994
- };
995
- };
996
- };
997
- };
998
- };
999
- }, import('@better-auth/passkey/client').PublicKeyCredentialRequestOptionsJSON>;
1000
- verifyPasskeyRegistration: import('better-auth').StrictEndpoint<"/passkey/verify-registration", {
1001
- method: "POST";
1002
- body: import('zod').ZodObject<{
1003
- response: import('zod').ZodAny;
1004
- name: import('zod').ZodOptional<import('zod').ZodString>;
1005
- }, import('zod/v4/core').$strip>;
1006
- use: ((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<{
1007
- session: {
1008
- session: Record<string, any> & {
1009
- id: string;
1010
- createdAt: Date;
1011
- updatedAt: Date;
1012
- userId: string;
1013
- expiresAt: Date;
1014
- token: string;
1015
- ipAddress?: string | null | undefined;
1016
- userAgent?: string | null | undefined;
1017
- };
1018
- user: Record<string, any> & {
1019
- id: string;
1020
- createdAt: Date;
1021
- updatedAt: Date;
1022
- email: string;
1023
- emailVerified: boolean;
1024
- name: string;
1025
- image?: string | null | undefined;
1026
- };
1027
- };
1028
- }>)[] | undefined;
1029
- metadata: {
1030
- openapi: {
1031
- operationId: string;
1032
- description: string;
1033
- responses: {
1034
- 200: {
1035
- description: string;
1036
- content: {
1037
- "application/json": {
1038
- schema: {
1039
- $ref: string;
1040
- };
1041
- };
1042
- };
1043
- };
1044
- 400: {
1045
- description: string;
1046
- };
1047
- };
1048
- };
1049
- };
1050
- }, import('@better-auth/passkey/client').Passkey>;
1051
- verifyPasskeyAuthentication: import('better-auth').StrictEndpoint<"/passkey/verify-authentication", {
1052
- method: "POST";
1053
- body: import('zod').ZodObject<{
1054
- response: import('zod').ZodRecord<import('zod').ZodAny, import('zod').ZodAny>;
1055
- }, import('zod/v4/core').$strip>;
1056
- metadata: {
1057
- openapi: {
1058
- operationId: string;
1059
- description: string;
1060
- responses: {
1061
- 200: {
1062
- description: string;
1063
- content: {
1064
- "application/json": {
1065
- schema: {
1066
- type: "object";
1067
- properties: {
1068
- session: {
1069
- $ref: string;
1070
- };
1071
- user: {
1072
- $ref: string;
1073
- };
1074
- };
1075
- };
1076
- };
1077
- };
1078
- };
1079
- };
1080
- };
1081
- $Infer: {
1082
- body: {
1083
- response: import('@better-auth/passkey/client').AuthenticationResponseJSON;
1084
- };
1085
- };
1086
- };
1087
- }, {
1088
- session: {
1089
- id: string;
1090
- createdAt: Date;
1091
- updatedAt: Date;
1092
- userId: string;
1093
- expiresAt: Date;
1094
- token: string;
1095
- ipAddress?: string | null | undefined;
1096
- userAgent?: string | null | undefined;
1097
- };
1098
- }>;
1099
- listPasskeys: import('better-auth').StrictEndpoint<"/passkey/list-user-passkeys", {
1100
- method: "GET";
1101
- use: ((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<{
1102
- session: {
1103
- session: Record<string, any> & {
1104
- id: string;
1105
- createdAt: Date;
1106
- updatedAt: Date;
1107
- userId: string;
1108
- expiresAt: Date;
1109
- token: string;
1110
- ipAddress?: string | null | undefined;
1111
- userAgent?: string | null | undefined;
1112
- };
1113
- user: Record<string, any> & {
1114
- id: string;
1115
- createdAt: Date;
1116
- updatedAt: Date;
1117
- email: string;
1118
- emailVerified: boolean;
1119
- name: string;
1120
- image?: string | null | undefined;
1121
- };
1122
- };
1123
- }>)[];
1124
- metadata: {
1125
- openapi: {
1126
- description: string;
1127
- responses: {
1128
- "200": {
1129
- description: string;
1130
- content: {
1131
- "application/json": {
1132
- schema: {
1133
- type: "array";
1134
- items: {
1135
- $ref: string;
1136
- required: string[];
1137
- };
1138
- description: string;
1139
- };
1140
- };
1141
- };
1142
- };
1143
- };
1144
- };
1145
- };
1146
- }, import('@better-auth/passkey/client').Passkey[]>;
1147
- deletePasskey: import('better-auth').StrictEndpoint<"/passkey/delete-passkey", {
1148
- method: "POST";
1149
- body: import('zod').ZodObject<{
1150
- id: import('zod').ZodString;
1151
- }, import('zod/v4/core').$strip>;
1152
- use: (((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<{
1153
- session: {
1154
- session: Record<string, any> & {
1155
- id: string;
1156
- createdAt: Date;
1157
- updatedAt: Date;
1158
- userId: string;
1159
- expiresAt: Date;
1160
- token: string;
1161
- ipAddress?: string | null | undefined;
1162
- userAgent?: string | null | undefined;
1163
- };
1164
- user: Record<string, any> & {
1165
- id: string;
1166
- createdAt: Date;
1167
- updatedAt: Date;
1168
- email: string;
1169
- emailVerified: boolean;
1170
- name: string;
1171
- image?: string | null | undefined;
1172
- };
1173
- };
1174
- }>) | ((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<{
1175
- verifiedResource: {};
1176
- }>))[];
1177
- metadata: {
1178
- openapi: {
1179
- description: string;
1180
- responses: {
1181
- "200": {
1182
- description: string;
1183
- content: {
1184
- "application/json": {
1185
- schema: {
1186
- type: "object";
1187
- properties: {
1188
- status: {
1189
- type: string;
1190
- description: string;
1191
- };
1192
- };
1193
- required: string[];
1194
- };
1195
- };
1196
- };
1197
- };
1198
- };
1199
- };
1200
- };
1201
- }, {
1202
- status: boolean;
1203
- }>;
1204
- updatePasskey: import('better-auth').StrictEndpoint<"/passkey/update-passkey", {
1205
- method: "POST";
1206
- body: import('zod').ZodObject<{
1207
- id: import('zod').ZodString;
1208
- name: import('zod').ZodString;
1209
- }, import('zod/v4/core').$strip>;
1210
- use: (((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<{
1211
- session: {
1212
- session: Record<string, any> & {
1213
- id: string;
1214
- createdAt: Date;
1215
- updatedAt: Date;
1216
- userId: string;
1217
- expiresAt: Date;
1218
- token: string;
1219
- ipAddress?: string | null | undefined;
1220
- userAgent?: string | null | undefined;
1221
- };
1222
- user: Record<string, any> & {
1223
- id: string;
1224
- createdAt: Date;
1225
- updatedAt: Date;
1226
- email: string;
1227
- emailVerified: boolean;
1228
- name: string;
1229
- image?: string | null | undefined;
1230
- };
1231
- };
1232
- }>) | ((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<{
1233
- verifiedResource: {};
1234
- }>))[];
1235
- metadata: {
1236
- openapi: {
1237
- description: string;
1238
- responses: {
1239
- "200": {
1240
- description: string;
1241
- content: {
1242
- "application/json": {
1243
- schema: {
1244
- type: "object";
1245
- properties: {
1246
- passkey: {
1247
- $ref: string;
1248
- };
1249
- };
1250
- required: string[];
1251
- };
1252
- };
1253
- };
1254
- };
1255
- };
1256
- };
1257
- };
1258
- }, {
1259
- passkey: import('@better-auth/passkey/client').Passkey;
1260
- }>;
1261
- };
1262
- schema: {
1263
- passkey: {
1264
- fields: {
1265
- name: {
1266
- type: "string";
1267
- required: false;
1268
- };
1269
- publicKey: {
1270
- type: "string";
1271
- required: true;
1272
- };
1273
- userId: {
1274
- type: "string";
1275
- references: {
1276
- model: string;
1277
- field: string;
1278
- };
1279
- required: true;
1280
- index: true;
1281
- };
1282
- credentialID: {
1283
- type: "string";
1284
- required: true;
1285
- index: true;
1286
- };
1287
- counter: {
1288
- type: "number";
1289
- required: true;
1290
- };
1291
- deviceType: {
1292
- type: "string";
1293
- required: true;
1294
- };
1295
- backedUp: {
1296
- type: "boolean";
1297
- required: true;
1298
- };
1299
- transports: {
1300
- type: "string";
1301
- required: false;
1302
- };
1303
- createdAt: {
1304
- type: "date";
1305
- required: false;
1306
- };
1307
- aaguid: {
1308
- type: "string";
1309
- required: false;
1310
- };
1311
- };
1312
- };
1313
- };
1314
- $ERROR_CODES: {
1315
- CHALLENGE_NOT_FOUND: import('better-auth').RawError<"CHALLENGE_NOT_FOUND">;
1316
- YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: import('better-auth').RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
1317
- FAILED_TO_VERIFY_REGISTRATION: import('better-auth').RawError<"FAILED_TO_VERIFY_REGISTRATION">;
1318
- PASSKEY_NOT_FOUND: import('better-auth').RawError<"PASSKEY_NOT_FOUND">;
1319
- AUTHENTICATION_FAILED: import('better-auth').RawError<"AUTHENTICATION_FAILED">;
1320
- UNABLE_TO_CREATE_SESSION: import('better-auth').RawError<"UNABLE_TO_CREATE_SESSION">;
1321
- FAILED_TO_UPDATE_PASSKEY: import('better-auth').RawError<"FAILED_TO_UPDATE_PASSKEY">;
1322
- PREVIOUSLY_REGISTERED: import('better-auth').RawError<"PREVIOUSLY_REGISTERED">;
1323
- REGISTRATION_CANCELLED: import('better-auth').RawError<"REGISTRATION_CANCELLED">;
1324
- AUTH_CANCELLED: import('better-auth').RawError<"AUTH_CANCELLED">;
1325
- UNKNOWN_ERROR: import('better-auth').RawError<"UNKNOWN_ERROR">;
1326
- SESSION_REQUIRED: import('better-auth').RawError<"SESSION_REQUIRED">;
1327
- RESOLVE_USER_REQUIRED: import('better-auth').RawError<"RESOLVE_USER_REQUIRED">;
1328
- RESOLVED_USER_INVALID: import('better-auth').RawError<"RESOLVED_USER_INVALID">;
1329
- };
1330
- options: import('@better-auth/passkey/client').PasskeyOptions | undefined;
1331
- }>;
1332
- getActions: ($fetch: import('better-auth/client').BetterFetch, $store: import('better-auth').ClientStore) => {
1333
- signIn: {
1334
- passkey: (opts?: {
1335
- autoFill?: boolean;
1336
- extensions?: import('@better-auth/passkey/client').AuthenticationExtensionsClientInputs;
1337
- returnWebAuthnResponse?: boolean;
1338
- fetchOptions?: import('better-auth').ClientFetchOption;
1339
- } | undefined, options?: import('better-auth').ClientFetchOption | undefined) => Promise<{
1340
- data: null;
1341
- error: {
1342
- message?: string | undefined;
1343
- status: number;
1344
- statusText: string;
1345
- };
1346
- } | {
1347
- data: {
1348
- session: {
1349
- id: string;
1350
- createdAt: Date;
1351
- updatedAt: Date;
1352
- userId: string;
1353
- expiresAt: Date;
1354
- token: string;
1355
- ipAddress?: string | null | undefined;
1356
- userAgent?: string | null | undefined;
1357
- };
1358
- user: {
1359
- id: string;
1360
- createdAt: Date;
1361
- updatedAt: Date;
1362
- email: string;
1363
- emailVerified: boolean;
1364
- name: string;
1365
- image?: string | null | undefined;
1366
- };
1367
- };
1368
- error: null;
1369
- } | {
1370
- webauthn: {
1371
- response: import('@better-auth/passkey/client').AuthenticationResponseJSON;
1372
- clientExtensionResults: import('@better-auth/passkey/client').AuthenticationExtensionsClientOutputs;
1373
- };
1374
- data: null;
1375
- error: {
1376
- message?: string | undefined;
1377
- status: number;
1378
- statusText: string;
1379
- };
1380
- } | {
1381
- webauthn: {
1382
- response: import('@better-auth/passkey/client').AuthenticationResponseJSON;
1383
- clientExtensionResults: import('@better-auth/passkey/client').AuthenticationExtensionsClientOutputs;
1384
- };
1385
- data: {
1386
- session: {
1387
- id: string;
1388
- createdAt: Date;
1389
- updatedAt: Date;
1390
- userId: string;
1391
- expiresAt: Date;
1392
- token: string;
1393
- ipAddress?: string | null | undefined;
1394
- userAgent?: string | null | undefined;
1395
- };
1396
- user: {
1397
- id: string;
1398
- createdAt: Date;
1399
- updatedAt: Date;
1400
- email: string;
1401
- emailVerified: boolean;
1402
- name: string;
1403
- image?: string | null | undefined;
1404
- };
1405
- };
1406
- error: null;
1407
- } | {
1408
- data: null;
1409
- error: {
1410
- code: string;
1411
- message: string;
1412
- status: number;
1413
- statusText: string;
1414
- };
1415
- }>;
1416
- };
1417
- passkey: {
1418
- addPasskey: (opts?: {
1419
- fetchOptions?: import('better-auth').ClientFetchOption;
1420
- name?: string;
1421
- authenticatorAttachment?: "platform" | "cross-platform";
1422
- context?: string | null;
1423
- extensions?: import('@better-auth/passkey/client').AuthenticationExtensionsClientInputs;
1424
- useAutoRegister?: boolean;
1425
- returnWebAuthnResponse?: boolean;
1426
- } | undefined, fetchOpts?: import('better-auth').ClientFetchOption | undefined) => Promise<{
1427
- data: null;
1428
- error: {
1429
- message?: string | undefined;
1430
- status: number;
1431
- statusText: string;
1432
- };
1433
- } | {
1434
- data: import('@better-auth/passkey/client').Passkey;
1435
- error: null;
1436
- } | {
1437
- webauthn: {
1438
- response: import('@better-auth/passkey/client').RegistrationResponseJSON;
1439
- clientExtensionResults: import('@better-auth/passkey/client').AuthenticationExtensionsClientOutputs;
1440
- };
1441
- data: import('@better-auth/passkey/client').Passkey;
1442
- error: null;
1443
- } | {
1444
- data: null;
1445
- error: {
1446
- code: string;
1447
- message: string;
1448
- status: number;
1449
- statusText: string;
1450
- };
1451
- }>;
1452
- };
1453
- $Infer: {
1454
- Passkey: import('@better-auth/passkey/client').Passkey;
1455
- };
1456
- };
1457
- getAtoms($fetch: import('better-auth/client').BetterFetch): {
1458
- listPasskeys: import('better-auth/client').AuthQueryAtom<import('@better-auth/passkey/client').Passkey[]>;
1459
- $listPasskeys: import('better-auth/client').PreinitializedWritableAtom<any> & object;
1460
- };
1461
- pathMethods: {
1462
- "/passkey/register": "POST";
1463
- "/passkey/authenticate": "POST";
1464
- };
1465
- atomListeners: ({
1466
- matcher(path: string): path is "/passkey/delete-passkey" | "/passkey/update-passkey" | "/passkey/verify-registration" | "/sign-out";
1467
- signal: "$listPasskeys";
1468
- } | {
1469
- matcher: (path: string) => path is "/passkey/verify-authentication";
1470
- signal: "$sessionSignal";
1471
- })[];
1472
- $ERROR_CODES: {
1473
- CHALLENGE_NOT_FOUND: import('better-auth').RawError<"CHALLENGE_NOT_FOUND">;
1474
- YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: import('better-auth').RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
1475
- FAILED_TO_VERIFY_REGISTRATION: import('better-auth').RawError<"FAILED_TO_VERIFY_REGISTRATION">;
1476
- PASSKEY_NOT_FOUND: import('better-auth').RawError<"PASSKEY_NOT_FOUND">;
1477
- AUTHENTICATION_FAILED: import('better-auth').RawError<"AUTHENTICATION_FAILED">;
1478
- UNABLE_TO_CREATE_SESSION: import('better-auth').RawError<"UNABLE_TO_CREATE_SESSION">;
1479
- FAILED_TO_UPDATE_PASSKEY: import('better-auth').RawError<"FAILED_TO_UPDATE_PASSKEY">;
1480
- PREVIOUSLY_REGISTERED: import('better-auth').RawError<"PREVIOUSLY_REGISTERED">;
1481
- REGISTRATION_CANCELLED: import('better-auth').RawError<"REGISTRATION_CANCELLED">;
1482
- AUTH_CANCELLED: import('better-auth').RawError<"AUTH_CANCELLED">;
1483
- UNKNOWN_ERROR: import('better-auth').RawError<"UNKNOWN_ERROR">;
1484
- SESSION_REQUIRED: import('better-auth').RawError<"SESSION_REQUIRED">;
1485
- RESOLVE_USER_REQUIRED: import('better-auth').RawError<"RESOLVE_USER_REQUIRED">;
1486
- RESOLVED_USER_INVALID: import('better-auth').RawError<"RESOLVED_USER_INVALID">;
1487
- };
1488
- } | {
1489
- id: "username";
1490
- version: string;
1491
- $InferServerPlugin: ReturnType<(options?: import('better-auth/plugins/username').UsernameOptions | undefined) => {
1492
- id: "username";
1493
- version: string;
1494
- init(ctx: import('better-auth').AuthContext): {
1495
- options: {
1496
- databaseHooks: {
1497
- user: {
1498
- create: {
1499
- before(user: {
1500
- id: string;
1501
- createdAt: Date;
1502
- updatedAt: Date;
1503
- email: string;
1504
- emailVerified: boolean;
1505
- name: string;
1506
- image?: string | null | undefined;
1507
- } & Record<string, unknown>, context: import('better-auth').GenericEndpointContext | null): Promise<{
1508
- data: {
1509
- displayUsername?: string | undefined;
1510
- username?: string | undefined;
1511
- id: string;
1512
- createdAt: Date;
1513
- updatedAt: Date;
1514
- email: string;
1515
- emailVerified: boolean;
1516
- name: string;
1517
- image?: string | null | undefined;
1518
- };
1519
- }>;
1520
- };
1521
- update: {
1522
- before(user: Partial<{
1523
- id: string;
1524
- createdAt: Date;
1525
- updatedAt: Date;
1526
- email: string;
1527
- emailVerified: boolean;
1528
- name: string;
1529
- image?: string | null | undefined;
1530
- }> & Record<string, unknown>, context: import('better-auth').GenericEndpointContext | null): Promise<{
1531
- data: {
1532
- displayUsername?: string | undefined;
1533
- username?: string | undefined;
1534
- id?: string | undefined;
1535
- createdAt?: Date | undefined;
1536
- updatedAt?: Date | undefined;
1537
- email?: string | undefined;
1538
- emailVerified?: boolean | undefined;
1539
- name?: string | undefined;
1540
- image?: string | null | undefined;
1541
- };
1542
- }>;
1543
- };
1544
- };
1545
- };
1546
- };
1547
- };
1548
- endpoints: {
1549
- signInUsername: import('better-auth').StrictEndpoint<"/sign-in/username", {
1550
- method: "POST";
1551
- body: import('zod').ZodObject<{
1552
- username: import('zod').ZodString;
1553
- password: import('zod').ZodString;
1554
- rememberMe: import('zod').ZodOptional<import('zod').ZodBoolean>;
1555
- callbackURL: import('zod').ZodOptional<import('zod').ZodString>;
1556
- }, import('zod/v4/core').$strip>;
1557
- metadata: {
1558
- openapi: {
1559
- summary: string;
1560
- description: string;
1561
- responses: {
1562
- 200: {
1563
- description: string;
1564
- content: {
1565
- "application/json": {
1566
- schema: {
1567
- type: "object";
1568
- properties: {
1569
- token: {
1570
- type: string;
1571
- description: string;
1572
- };
1573
- user: {
1574
- $ref: string;
1575
- };
1576
- };
1577
- required: string[];
1578
- };
1579
- };
1580
- };
1581
- };
1582
- 422: {
1583
- description: string;
1584
- content: {
1585
- "application/json": {
1586
- schema: {
1587
- type: "object";
1588
- properties: {
1589
- message: {
1590
- type: string;
1591
- };
1592
- };
1593
- };
1594
- };
1595
- };
1596
- };
1597
- };
1598
- };
1599
- };
1600
- }, {
1601
- token: string;
1602
- user: {
1603
- id: string;
1604
- createdAt: Date;
1605
- updatedAt: Date;
1606
- email: string;
1607
- emailVerified: boolean;
1608
- name: string;
1609
- image?: string | null | undefined;
1610
- } & {
1611
- username: string;
1612
- displayUsername: string;
1613
- };
1614
- }>;
1615
- isUsernameAvailable: import('better-auth').StrictEndpoint<"/is-username-available", {
1616
- method: "POST";
1617
- body: import('zod').ZodObject<{
1618
- username: import('zod').ZodString;
1619
- }, import('zod/v4/core').$strip>;
1620
- }, {
1621
- available: boolean;
1622
- }>;
1623
- };
1624
- schema: {
1625
- user: {
1626
- fields: {
1627
- username: {
1628
- type: "string";
1629
- required: false;
1630
- sortable: true;
1631
- unique: true;
1632
- returned: true;
1633
- transform: {
1634
- input(value: import('better-auth').DBPrimitive): string | number | boolean | Date | Record<string, unknown> | unknown[] | null | undefined;
1635
- };
1636
- };
1637
- displayUsername: {
1638
- type: "string";
1639
- required: false;
1640
- transform: {
1641
- input(value: import('better-auth').DBPrimitive): string | number | boolean | Date | Record<string, unknown> | unknown[] | null | undefined;
1642
- };
1643
- };
1644
- };
1645
- };
1646
- };
1647
- hooks: {
1648
- before: {
1649
- matcher(context: import('better-auth').HookEndpointContext): boolean;
1650
- handler: (inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<void>;
1651
- }[];
1652
- };
1653
- options: import('better-auth/plugins/username').UsernameOptions | undefined;
1654
- $ERROR_CODES: {
1655
- EMAIL_NOT_VERIFIED: import('better-auth').RawError<"EMAIL_NOT_VERIFIED">;
1656
- UNEXPECTED_ERROR: import('better-auth').RawError<"UNEXPECTED_ERROR">;
1657
- INVALID_USERNAME_OR_PASSWORD: import('better-auth').RawError<"INVALID_USERNAME_OR_PASSWORD">;
1658
- USERNAME_IS_ALREADY_TAKEN: import('better-auth').RawError<"USERNAME_IS_ALREADY_TAKEN">;
1659
- USERNAME_TOO_SHORT: import('better-auth').RawError<"USERNAME_TOO_SHORT">;
1660
- USERNAME_TOO_LONG: import('better-auth').RawError<"USERNAME_TOO_LONG">;
1661
- INVALID_USERNAME: import('better-auth').RawError<"INVALID_USERNAME">;
1662
- INVALID_DISPLAY_USERNAME: import('better-auth').RawError<"INVALID_DISPLAY_USERNAME">;
1663
- };
1664
- }>;
1665
- atomListeners: {
1666
- matcher: (path: string) => path is "/sign-in/username";
1667
- signal: "$sessionSignal";
1668
- }[];
1669
- $ERROR_CODES: {
1670
- EMAIL_NOT_VERIFIED: import('better-auth').RawError<"EMAIL_NOT_VERIFIED">;
1671
- UNEXPECTED_ERROR: import('better-auth').RawError<"UNEXPECTED_ERROR">;
1672
- INVALID_USERNAME_OR_PASSWORD: import('better-auth').RawError<"INVALID_USERNAME_OR_PASSWORD">;
1673
- USERNAME_IS_ALREADY_TAKEN: import('better-auth').RawError<"USERNAME_IS_ALREADY_TAKEN">;
1674
- USERNAME_TOO_SHORT: import('better-auth').RawError<"USERNAME_TOO_SHORT">;
1675
- USERNAME_TOO_LONG: import('better-auth').RawError<"USERNAME_TOO_LONG">;
1676
- INVALID_USERNAME: import('better-auth').RawError<"INVALID_USERNAME">;
1677
- INVALID_DISPLAY_USERNAME: import('better-auth').RawError<"INVALID_DISPLAY_USERNAME">;
1678
- };
1679
- })[];
1680
- }, FetchOptions>>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<(Omit<{
1681
- token: null;
1682
- user: {
1683
- id: string;
1684
- createdAt: Date;
1685
- updatedAt: Date;
1686
- email: string;
1687
- emailVerified: boolean;
1688
- name: string;
1689
- image?: string | null | undefined | undefined;
1690
- };
1691
- }, "user"> & {
1692
- user: import('better-auth').StripEmptyObjects<{
1693
- id: string;
1694
- createdAt: Date;
1695
- updatedAt: Date;
1696
- email: string;
1697
- emailVerified: boolean;
1698
- name: string;
1699
- image?: string | null | undefined;
1700
- } & {} & {
1701
- username?: string | null | undefined;
1702
- displayUsername?: string | null | undefined;
1703
- }>;
1704
- }) | (Omit<{
1705
- token: string;
1706
- user: {
1707
- id: string;
1708
- createdAt: Date;
1709
- updatedAt: Date;
1710
- email: string;
1711
- emailVerified: boolean;
1712
- name: string;
1713
- image?: string | null | undefined | undefined;
1714
- };
1715
- }, "user"> & {
1716
- user: import('better-auth').StripEmptyObjects<{
1717
- id: string;
1718
- createdAt: Date;
1719
- updatedAt: Date;
1720
- email: string;
1721
- emailVerified: boolean;
1722
- name: string;
1723
- image?: string | null | undefined;
1724
- } & {} & {
1725
- username?: string | null | undefined;
1726
- displayUsername?: string | null | undefined;
1727
- }>;
1728
- }), {
1729
- code?: string | undefined;
1730
- message?: string | undefined;
1731
- }, FetchOptions["throw"] extends true ? true : false>>;
1732
- };
1733
- } & {
1734
- signIn: {
1735
- email: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
1736
- email: string;
1737
- password: string;
1738
- callbackURL?: string | undefined;
1739
- rememberMe?: boolean | undefined;
1740
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
1741
- email: string;
1742
- password: string;
1743
- callbackURL?: string | undefined;
1744
- rememberMe?: boolean | undefined;
1745
- } & {
1746
- fetchOptions?: FetchOptions | undefined;
1747
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<Omit<{
1748
- redirect: boolean;
1749
- token: string;
1750
- url?: string | undefined;
1751
- user: {
1752
- id: string;
1753
- createdAt: Date;
1754
- updatedAt: Date;
1755
- email: string;
1756
- emailVerified: boolean;
1757
- name: string;
1758
- image?: string | null | undefined | undefined;
1759
- };
1760
- }, "user"> & {
1761
- user: import('better-auth').StripEmptyObjects<{
1762
- id: string;
1763
- createdAt: Date;
1764
- updatedAt: Date;
1765
- email: string;
1766
- emailVerified: boolean;
1767
- name: string;
1768
- image?: string | null | undefined;
1769
- } & {} & {
1770
- username?: string | null | undefined;
1771
- displayUsername?: string | null | undefined;
1772
- }>;
1773
- }, {
1774
- code?: string | undefined;
1775
- message?: string | undefined;
1776
- }, FetchOptions["throw"] extends true ? true : false>>;
1777
- };
1778
- } & {
1779
- resetPassword: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
1780
- newPassword: string;
1781
- token?: string | undefined;
1782
- }> & Record<string, any>, Partial<{
1783
- token?: string | undefined;
1784
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
1785
- newPassword: string;
1786
- token?: string | undefined;
1787
- } & {
1788
- fetchOptions?: FetchOptions | undefined;
1789
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
1790
- status: boolean;
1791
- }, {
1792
- code?: string | undefined;
1793
- message?: string | undefined;
1794
- }, FetchOptions["throw"] extends true ? true : false>>;
1795
- } & {
1796
- verifyEmail: <FetchOptions extends import('better-auth').ClientFetchOption<never, Partial<{
1797
- token: string;
1798
- callbackURL?: string | undefined;
1799
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
1800
- query: {
1801
- token: string;
1802
- callbackURL?: string | undefined;
1803
- };
1804
- fetchOptions?: FetchOptions | undefined;
1805
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<NonNullable<void | {
1806
- status: boolean;
1807
- }>, {
1808
- code?: string | undefined;
1809
- message?: string | undefined;
1810
- }, FetchOptions["throw"] extends true ? true : false>>;
1811
- } & {
1812
- sendVerificationEmail: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
1813
- email: string;
1814
- callbackURL?: string | undefined;
1815
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
1816
- email: string;
1817
- callbackURL?: string | undefined;
1818
- } & {
1819
- fetchOptions?: FetchOptions | undefined;
1820
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
1821
- status: boolean;
1822
- }, {
1823
- code?: string | undefined;
1824
- message?: string | undefined;
1825
- }, FetchOptions["throw"] extends true ? true : false>>;
1826
- } & {
1827
- changeEmail: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
1828
- newEmail: string;
1829
- callbackURL?: string | undefined;
1830
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
1831
- newEmail: string;
1832
- callbackURL?: string | undefined;
1833
- } & {
1834
- fetchOptions?: FetchOptions | undefined;
1835
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
1836
- status: boolean;
1837
- }, {
1838
- code?: string | undefined;
1839
- message?: string | undefined;
1840
- }, FetchOptions["throw"] extends true ? true : false>>;
1841
- } & {
1842
- changePassword: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
1843
- newPassword: string;
1844
- currentPassword: string;
1845
- revokeOtherSessions?: boolean | undefined;
1846
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
1847
- newPassword: string;
1848
- currentPassword: string;
1849
- revokeOtherSessions?: boolean | undefined;
1850
- } & {
1851
- fetchOptions?: FetchOptions | undefined;
1852
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<Omit<{
1853
- token: string | null;
1854
- user: {
1855
- id: string;
1856
- createdAt: Date;
1857
- updatedAt: Date;
1858
- email: string;
1859
- emailVerified: boolean;
1860
- name: string;
1861
- image?: string | null | undefined;
1862
- } & Record<string, any> & {
1863
- id: string;
1864
- createdAt: Date;
1865
- updatedAt: Date;
1866
- email: string;
1867
- emailVerified: boolean;
1868
- name: string;
1869
- image?: string | null | undefined;
1870
- };
1871
- }, "user"> & {
1872
- user: import('better-auth').StripEmptyObjects<{
1873
- id: string;
1874
- createdAt: Date;
1875
- updatedAt: Date;
1876
- email: string;
1877
- emailVerified: boolean;
1878
- name: string;
1879
- image?: string | null | undefined;
1880
- } & {} & {
1881
- username?: string | null | undefined;
1882
- displayUsername?: string | null | undefined;
1883
- }>;
1884
- }, {
1885
- code?: string | undefined;
1886
- message?: string | undefined;
1887
- }, FetchOptions["throw"] extends true ? true : false>>;
1888
- } & {
1889
- updateSession: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<Partial<{}>> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import('better-auth').Prettify<Partial<{}> & {
1890
- fetchOptions?: FetchOptions | undefined;
1891
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
1892
- session: {
1893
- id: string;
1894
- createdAt: Date;
1895
- updatedAt: Date;
1896
- userId: string;
1897
- expiresAt: Date;
1898
- token: string;
1899
- ipAddress?: string | null | undefined;
1900
- userAgent?: string | null | undefined;
1901
- };
1902
- }, {
1903
- code?: string | undefined;
1904
- message?: string | undefined;
1905
- }, FetchOptions["throw"] extends true ? true : false>>;
1906
- } & {
1907
- updateUser: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<Partial<{}> & {
1908
- name?: string | undefined;
1909
- image?: string | undefined | null;
1910
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import('better-auth').Prettify<import('better-auth/client').InferUserUpdateCtx<{
1911
- plugins: ({
1912
- id: "magic-link";
1913
- version: string;
1914
- $InferServerPlugin: ReturnType<(options: import('better-auth/plugins/magic-link').MagicLinkOptions) => {
1915
- id: "magic-link";
1916
- version: string;
1917
- endpoints: {
1918
- signInMagicLink: import('better-auth').StrictEndpoint<"/sign-in/magic-link", {
1919
- method: "POST";
1920
- requireHeaders: true;
1921
- body: import('zod').ZodObject<{
1922
- email: import('zod').ZodEmail;
1923
- name: import('zod').ZodOptional<import('zod').ZodString>;
1924
- callbackURL: import('zod').ZodOptional<import('zod').ZodString>;
1925
- newUserCallbackURL: import('zod').ZodOptional<import('zod').ZodString>;
1926
- errorCallbackURL: import('zod').ZodOptional<import('zod').ZodString>;
1927
- metadata: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodAny>>;
1928
- }, import('zod/v4/core').$strip>;
1929
- metadata: {
1930
- openapi: {
1931
- operationId: string;
1932
- description: string;
1933
- responses: {
1934
- 200: {
1935
- description: string;
1936
- content: {
1937
- "application/json": {
1938
- schema: {
1939
- type: "object";
1940
- properties: {
1941
- status: {
1942
- type: string;
1943
- };
1944
- };
1945
- };
1946
- };
1947
- };
1948
- };
1949
- };
1950
- };
1951
- };
1952
- }, {
1953
- status: boolean;
1954
- }>;
1955
- magicLinkVerify: import('better-auth').StrictEndpoint<"/magic-link/verify", {
1956
- method: "GET";
1957
- query: import('zod').ZodObject<{
1958
- token: import('zod').ZodString;
1959
- callbackURL: import('zod').ZodOptional<import('zod').ZodString>;
1960
- errorCallbackURL: import('zod').ZodOptional<import('zod').ZodString>;
1961
- newUserCallbackURL: import('zod').ZodOptional<import('zod').ZodString>;
1962
- }, import('zod/v4/core').$strip>;
1963
- use: ((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<void>)[];
1964
- requireHeaders: true;
1965
- metadata: {
1966
- openapi: {
1967
- operationId: string;
1968
- description: string;
1969
- responses: {
1970
- 200: {
1971
- description: string;
1972
- content: {
1973
- "application/json": {
1974
- schema: {
1975
- type: "object";
1976
- properties: {
1977
- session: {
1978
- $ref: string;
1979
- };
1980
- user: {
1981
- $ref: string;
1982
- };
1983
- };
1984
- };
1985
- };
1986
- };
1987
- };
1988
- };
1989
- };
1990
- };
1991
- }, {
1992
- token: string;
1993
- user: {
1994
- id: string;
1995
- createdAt: Date;
1996
- updatedAt: Date;
1997
- email: string;
1998
- emailVerified: boolean;
1999
- name: string;
2000
- image?: string | null | undefined;
2001
- };
2002
- session: {
2003
- id: string;
2004
- createdAt: Date;
2005
- updatedAt: Date;
2006
- userId: string;
2007
- expiresAt: Date;
2008
- token: string;
2009
- ipAddress?: string | null | undefined;
2010
- userAgent?: string | null | undefined;
2011
- };
2012
- }>;
2013
- };
2014
- rateLimit: {
2015
- pathMatcher(path: string): boolean;
2016
- window: number;
2017
- max: number;
2018
- }[];
2019
- options: import('better-auth/plugins/magic-link').MagicLinkOptions;
2020
- }>;
2021
- } | {
2022
- id: "multi-session";
2023
- version: string;
2024
- $InferServerPlugin: ReturnType<(options?: import('better-auth/plugins/multi-session').MultiSessionConfig | undefined) => {
2025
- id: "multi-session";
2026
- version: string;
2027
- endpoints: {
2028
- listDeviceSessions: import('better-auth').StrictEndpoint<"/multi-session/list-device-sessions", {
2029
- method: "GET";
2030
- requireHeaders: true;
2031
- }, {
2032
- session: {
2033
- id: string;
2034
- createdAt: Date;
2035
- updatedAt: Date;
2036
- userId: string;
2037
- expiresAt: Date;
2038
- token: string;
2039
- ipAddress?: string | null | undefined;
2040
- userAgent?: string | null | undefined;
2041
- };
2042
- user: {
2043
- id: string;
2044
- createdAt: Date;
2045
- updatedAt: Date;
2046
- email: string;
2047
- emailVerified: boolean;
2048
- name: string;
2049
- image?: string | null | undefined;
2050
- };
2051
- }[]>;
2052
- setActiveSession: import('better-auth').StrictEndpoint<"/multi-session/set-active", {
2053
- method: "POST";
2054
- body: import('zod').ZodObject<{
2055
- sessionToken: import('zod').ZodString;
2056
- }, import('zod/v4/core').$strip>;
2057
- requireHeaders: true;
2058
- metadata: {
2059
- openapi: {
2060
- description: string;
2061
- responses: {
2062
- 200: {
2063
- description: string;
2064
- content: {
2065
- "application/json": {
2066
- schema: {
2067
- type: "object";
2068
- properties: {
2069
- session: {
2070
- $ref: string;
2071
- };
2072
- };
2073
- };
2074
- };
2075
- };
2076
- };
2077
- };
2078
- };
2079
- };
2080
- }, {
2081
- session: {
2082
- id: string;
2083
- createdAt: Date;
2084
- updatedAt: Date;
2085
- userId: string;
2086
- expiresAt: Date;
2087
- token: string;
2088
- ipAddress?: string | null | undefined;
2089
- userAgent?: string | null | undefined;
2090
- } & Record<string, any>;
2091
- user: {
2092
- id: string;
2093
- createdAt: Date;
2094
- updatedAt: Date;
2095
- email: string;
2096
- emailVerified: boolean;
2097
- name: string;
2098
- image?: string | null | undefined;
2099
- } & Record<string, any>;
2100
- }>;
2101
- revokeDeviceSession: import('better-auth').StrictEndpoint<"/multi-session/revoke", {
2102
- method: "POST";
2103
- body: import('zod').ZodObject<{
2104
- sessionToken: import('zod').ZodString;
2105
- }, import('zod/v4/core').$strip>;
2106
- requireHeaders: true;
2107
- use: ((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<{
2108
- session: {
2109
- session: Record<string, any> & {
2110
- id: string;
2111
- createdAt: Date;
2112
- updatedAt: Date;
2113
- userId: string;
2114
- expiresAt: Date;
2115
- token: string;
2116
- ipAddress?: string | null | undefined;
2117
- userAgent?: string | null | undefined;
2118
- };
2119
- user: Record<string, any> & {
2120
- id: string;
2121
- createdAt: Date;
2122
- updatedAt: Date;
2123
- email: string;
2124
- emailVerified: boolean;
2125
- name: string;
2126
- image?: string | null | undefined;
2127
- };
2128
- };
2129
- }>)[];
2130
- metadata: {
2131
- openapi: {
2132
- description: string;
2133
- responses: {
2134
- 200: {
2135
- description: string;
2136
- content: {
2137
- "application/json": {
2138
- schema: {
2139
- type: "object";
2140
- properties: {
2141
- status: {
2142
- type: string;
2143
- };
2144
- };
2145
- };
2146
- };
2147
- };
2148
- };
2149
- };
2150
- };
2151
- };
2152
- }, {
2153
- status: boolean;
2154
- }>;
2155
- };
2156
- hooks: {
2157
- after: {
2158
- matcher: (context: import('better-auth').HookEndpointContext) => boolean;
2159
- handler: (inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<void>;
2160
- }[];
2161
- };
2162
- options: import('better-auth/plugins/multi-session').MultiSessionConfig | undefined;
2163
- $ERROR_CODES: {
2164
- INVALID_SESSION_TOKEN: import('better-auth').RawError<"INVALID_SESSION_TOKEN">;
2165
- };
2166
- }>;
2167
- atomListeners: {
2168
- matcher(path: string): path is "/multi-session/set-active";
2169
- signal: "$sessionSignal";
2170
- }[];
2171
- $ERROR_CODES: {
2172
- INVALID_SESSION_TOKEN: import('better-auth').RawError<"INVALID_SESSION_TOKEN">;
2173
- };
2174
- } | {
2175
- id: "passkey";
2176
- version: string;
2177
- $InferServerPlugin: ReturnType<(options?: import('@better-auth/passkey/client').PasskeyOptions | undefined) => {
2178
- id: "passkey";
2179
- version: string;
2180
- endpoints: {
2181
- generatePasskeyRegistrationOptions: import('better-auth').StrictEndpoint<"/passkey/generate-register-options", {
2182
- method: "GET";
2183
- use: ((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<{
2184
- session: {
2185
- session: Record<string, any> & {
2186
- id: string;
2187
- createdAt: Date;
2188
- updatedAt: Date;
2189
- userId: string;
2190
- expiresAt: Date;
2191
- token: string;
2192
- ipAddress?: string | null | undefined;
2193
- userAgent?: string | null | undefined;
2194
- };
2195
- user: Record<string, any> & {
2196
- id: string;
2197
- createdAt: Date;
2198
- updatedAt: Date;
2199
- email: string;
2200
- emailVerified: boolean;
2201
- name: string;
2202
- image?: string | null | undefined;
2203
- };
2204
- };
2205
- }>)[] | undefined;
2206
- query: import('zod').ZodOptional<import('zod').ZodObject<{
2207
- authenticatorAttachment: import('zod').ZodOptional<import('zod').ZodEnum<{
2208
- platform: "platform";
2209
- "cross-platform": "cross-platform";
2210
- }>>;
2211
- name: import('zod').ZodOptional<import('zod').ZodString>;
2212
- context: import('zod').ZodOptional<import('zod').ZodString>;
2213
- }, import('zod/v4/core').$strip>>;
2214
- metadata: {
2215
- openapi: {
2216
- operationId: string;
2217
- description: string;
2218
- responses: {
2219
- 200: {
2220
- description: string;
2221
- parameters: {
2222
- query: {
2223
- authenticatorAttachment: {
2224
- description: string;
2225
- required: boolean;
2226
- };
2227
- name: {
2228
- description: string;
2229
- required: boolean;
2230
- };
2231
- context: {
2232
- description: string;
2233
- required: boolean;
2234
- };
2235
- };
2236
- };
2237
- content: {
2238
- "application/json": {
2239
- schema: {
2240
- type: "object";
2241
- properties: {
2242
- challenge: {
2243
- type: string;
2244
- };
2245
- rp: {
2246
- type: string;
2247
- properties: {
2248
- name: {
2249
- type: string;
2250
- };
2251
- id: {
2252
- type: string;
2253
- };
2254
- };
2255
- };
2256
- user: {
2257
- type: string;
2258
- properties: {
2259
- id: {
2260
- type: string;
2261
- };
2262
- name: {
2263
- type: string;
2264
- };
2265
- displayName: {
2266
- type: string;
2267
- };
2268
- };
2269
- };
2270
- pubKeyCredParams: {
2271
- type: string;
2272
- items: {
2273
- type: string;
2274
- properties: {
2275
- type: {
2276
- type: string;
2277
- };
2278
- alg: {
2279
- type: string;
2280
- };
2281
- };
2282
- };
2283
- };
2284
- timeout: {
2285
- type: string;
2286
- };
2287
- excludeCredentials: {
2288
- type: string;
2289
- items: {
2290
- type: string;
2291
- properties: {
2292
- id: {
2293
- type: string;
2294
- };
2295
- type: {
2296
- type: string;
2297
- };
2298
- transports: {
2299
- type: string;
2300
- items: {
2301
- type: string;
2302
- };
2303
- };
2304
- };
2305
- };
2306
- };
2307
- authenticatorSelection: {
2308
- type: string;
2309
- properties: {
2310
- authenticatorAttachment: {
2311
- type: string;
2312
- };
2313
- requireResidentKey: {
2314
- type: string;
2315
- };
2316
- userVerification: {
2317
- type: string;
2318
- };
2319
- };
2320
- };
2321
- attestation: {
2322
- type: string;
2323
- };
2324
- extensions: {
2325
- type: string;
2326
- };
2327
- };
2328
- };
2329
- };
2330
- };
2331
- };
2332
- };
2333
- };
2334
- };
2335
- }, import('@better-auth/passkey/client').PublicKeyCredentialCreationOptionsJSON>;
2336
- generatePasskeyAuthenticationOptions: import('better-auth').StrictEndpoint<"/passkey/generate-authenticate-options", {
2337
- method: "GET";
2338
- metadata: {
2339
- openapi: {
2340
- operationId: string;
2341
- description: string;
2342
- responses: {
2343
- 200: {
2344
- description: string;
2345
- content: {
2346
- "application/json": {
2347
- schema: {
2348
- type: "object";
2349
- properties: {
2350
- challenge: {
2351
- type: string;
2352
- };
2353
- rp: {
2354
- type: string;
2355
- properties: {
2356
- name: {
2357
- type: string;
2358
- };
2359
- id: {
2360
- type: string;
2361
- };
2362
- };
2363
- };
2364
- user: {
2365
- type: string;
2366
- properties: {
2367
- id: {
2368
- type: string;
2369
- };
2370
- name: {
2371
- type: string;
2372
- };
2373
- displayName: {
2374
- type: string;
2375
- };
2376
- };
2377
- };
2378
- timeout: {
2379
- type: string;
2380
- };
2381
- allowCredentials: {
2382
- type: string;
2383
- items: {
2384
- type: string;
2385
- properties: {
2386
- id: {
2387
- type: string;
2388
- };
2389
- type: {
2390
- type: string;
2391
- };
2392
- transports: {
2393
- type: string;
2394
- items: {
2395
- type: string;
2396
- };
2397
- };
2398
- };
2399
- };
2400
- };
2401
- userVerification: {
2402
- type: string;
2403
- };
2404
- authenticatorSelection: {
2405
- type: string;
2406
- properties: {
2407
- authenticatorAttachment: {
2408
- type: string;
2409
- };
2410
- requireResidentKey: {
2411
- type: string;
2412
- };
2413
- userVerification: {
2414
- type: string;
2415
- };
2416
- };
2417
- };
2418
- extensions: {
2419
- type: string;
2420
- };
2421
- };
2422
- };
2423
- };
2424
- };
2425
- };
2426
- };
2427
- };
2428
- };
2429
- }, import('@better-auth/passkey/client').PublicKeyCredentialRequestOptionsJSON>;
2430
- verifyPasskeyRegistration: import('better-auth').StrictEndpoint<"/passkey/verify-registration", {
2431
- method: "POST";
2432
- body: import('zod').ZodObject<{
2433
- response: import('zod').ZodAny;
2434
- name: import('zod').ZodOptional<import('zod').ZodString>;
2435
- }, import('zod/v4/core').$strip>;
2436
- use: ((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<{
2437
- session: {
2438
- session: Record<string, any> & {
2439
- id: string;
2440
- createdAt: Date;
2441
- updatedAt: Date;
2442
- userId: string;
2443
- expiresAt: Date;
2444
- token: string;
2445
- ipAddress?: string | null | undefined;
2446
- userAgent?: string | null | undefined;
2447
- };
2448
- user: Record<string, any> & {
2449
- id: string;
2450
- createdAt: Date;
2451
- updatedAt: Date;
2452
- email: string;
2453
- emailVerified: boolean;
2454
- name: string;
2455
- image?: string | null | undefined;
2456
- };
2457
- };
2458
- }>)[] | undefined;
2459
- metadata: {
2460
- openapi: {
2461
- operationId: string;
2462
- description: string;
2463
- responses: {
2464
- 200: {
2465
- description: string;
2466
- content: {
2467
- "application/json": {
2468
- schema: {
2469
- $ref: string;
2470
- };
2471
- };
2472
- };
2473
- };
2474
- 400: {
2475
- description: string;
2476
- };
2477
- };
2478
- };
2479
- };
2480
- }, import('@better-auth/passkey/client').Passkey>;
2481
- verifyPasskeyAuthentication: import('better-auth').StrictEndpoint<"/passkey/verify-authentication", {
2482
- method: "POST";
2483
- body: import('zod').ZodObject<{
2484
- response: import('zod').ZodRecord<import('zod').ZodAny, import('zod').ZodAny>;
2485
- }, import('zod/v4/core').$strip>;
2486
- metadata: {
2487
- openapi: {
2488
- operationId: string;
2489
- description: string;
2490
- responses: {
2491
- 200: {
2492
- description: string;
2493
- content: {
2494
- "application/json": {
2495
- schema: {
2496
- type: "object";
2497
- properties: {
2498
- session: {
2499
- $ref: string;
2500
- };
2501
- user: {
2502
- $ref: string;
2503
- };
2504
- };
2505
- };
2506
- };
2507
- };
2508
- };
2509
- };
2510
- };
2511
- $Infer: {
2512
- body: {
2513
- response: import('@better-auth/passkey/client').AuthenticationResponseJSON;
2514
- };
2515
- };
2516
- };
2517
- }, {
2518
- session: {
2519
- id: string;
2520
- createdAt: Date;
2521
- updatedAt: Date;
2522
- userId: string;
2523
- expiresAt: Date;
2524
- token: string;
2525
- ipAddress?: string | null | undefined;
2526
- userAgent?: string | null | undefined;
2527
- };
2528
- }>;
2529
- listPasskeys: import('better-auth').StrictEndpoint<"/passkey/list-user-passkeys", {
2530
- method: "GET";
2531
- use: ((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<{
2532
- session: {
2533
- session: Record<string, any> & {
2534
- id: string;
2535
- createdAt: Date;
2536
- updatedAt: Date;
2537
- userId: string;
2538
- expiresAt: Date;
2539
- token: string;
2540
- ipAddress?: string | null | undefined;
2541
- userAgent?: string | null | undefined;
2542
- };
2543
- user: Record<string, any> & {
2544
- id: string;
2545
- createdAt: Date;
2546
- updatedAt: Date;
2547
- email: string;
2548
- emailVerified: boolean;
2549
- name: string;
2550
- image?: string | null | undefined;
2551
- };
2552
- };
2553
- }>)[];
2554
- metadata: {
2555
- openapi: {
2556
- description: string;
2557
- responses: {
2558
- "200": {
2559
- description: string;
2560
- content: {
2561
- "application/json": {
2562
- schema: {
2563
- type: "array";
2564
- items: {
2565
- $ref: string;
2566
- required: string[];
2567
- };
2568
- description: string;
2569
- };
2570
- };
2571
- };
2572
- };
2573
- };
2574
- };
2575
- };
2576
- }, import('@better-auth/passkey/client').Passkey[]>;
2577
- deletePasskey: import('better-auth').StrictEndpoint<"/passkey/delete-passkey", {
2578
- method: "POST";
2579
- body: import('zod').ZodObject<{
2580
- id: import('zod').ZodString;
2581
- }, import('zod/v4/core').$strip>;
2582
- use: (((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<{
2583
- session: {
2584
- session: Record<string, any> & {
2585
- id: string;
2586
- createdAt: Date;
2587
- updatedAt: Date;
2588
- userId: string;
2589
- expiresAt: Date;
2590
- token: string;
2591
- ipAddress?: string | null | undefined;
2592
- userAgent?: string | null | undefined;
2593
- };
2594
- user: Record<string, any> & {
2595
- id: string;
2596
- createdAt: Date;
2597
- updatedAt: Date;
2598
- email: string;
2599
- emailVerified: boolean;
2600
- name: string;
2601
- image?: string | null | undefined;
2602
- };
2603
- };
2604
- }>) | ((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<{
2605
- verifiedResource: {};
2606
- }>))[];
2607
- metadata: {
2608
- openapi: {
2609
- description: string;
2610
- responses: {
2611
- "200": {
2612
- description: string;
2613
- content: {
2614
- "application/json": {
2615
- schema: {
2616
- type: "object";
2617
- properties: {
2618
- status: {
2619
- type: string;
2620
- description: string;
2621
- };
2622
- };
2623
- required: string[];
2624
- };
2625
- };
2626
- };
2627
- };
2628
- };
2629
- };
2630
- };
2631
- }, {
2632
- status: boolean;
2633
- }>;
2634
- updatePasskey: import('better-auth').StrictEndpoint<"/passkey/update-passkey", {
2635
- method: "POST";
2636
- body: import('zod').ZodObject<{
2637
- id: import('zod').ZodString;
2638
- name: import('zod').ZodString;
2639
- }, import('zod/v4/core').$strip>;
2640
- use: (((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<{
2641
- session: {
2642
- session: Record<string, any> & {
2643
- id: string;
2644
- createdAt: Date;
2645
- updatedAt: Date;
2646
- userId: string;
2647
- expiresAt: Date;
2648
- token: string;
2649
- ipAddress?: string | null | undefined;
2650
- userAgent?: string | null | undefined;
2651
- };
2652
- user: Record<string, any> & {
2653
- id: string;
2654
- createdAt: Date;
2655
- updatedAt: Date;
2656
- email: string;
2657
- emailVerified: boolean;
2658
- name: string;
2659
- image?: string | null | undefined;
2660
- };
2661
- };
2662
- }>) | ((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<{
2663
- verifiedResource: {};
2664
- }>))[];
2665
- metadata: {
2666
- openapi: {
2667
- description: string;
2668
- responses: {
2669
- "200": {
2670
- description: string;
2671
- content: {
2672
- "application/json": {
2673
- schema: {
2674
- type: "object";
2675
- properties: {
2676
- passkey: {
2677
- $ref: string;
2678
- };
2679
- };
2680
- required: string[];
2681
- };
2682
- };
2683
- };
2684
- };
2685
- };
2686
- };
2687
- };
2688
- }, {
2689
- passkey: import('@better-auth/passkey/client').Passkey;
2690
- }>;
2691
- };
2692
- schema: {
2693
- passkey: {
2694
- fields: {
2695
- name: {
2696
- type: "string";
2697
- required: false;
2698
- };
2699
- publicKey: {
2700
- type: "string";
2701
- required: true;
2702
- };
2703
- userId: {
2704
- type: "string";
2705
- references: {
2706
- model: string;
2707
- field: string;
2708
- };
2709
- required: true;
2710
- index: true;
2711
- };
2712
- credentialID: {
2713
- type: "string";
2714
- required: true;
2715
- index: true;
2716
- };
2717
- counter: {
2718
- type: "number";
2719
- required: true;
2720
- };
2721
- deviceType: {
2722
- type: "string";
2723
- required: true;
2724
- };
2725
- backedUp: {
2726
- type: "boolean";
2727
- required: true;
2728
- };
2729
- transports: {
2730
- type: "string";
2731
- required: false;
2732
- };
2733
- createdAt: {
2734
- type: "date";
2735
- required: false;
2736
- };
2737
- aaguid: {
2738
- type: "string";
2739
- required: false;
2740
- };
2741
- };
2742
- };
2743
- };
2744
- $ERROR_CODES: {
2745
- CHALLENGE_NOT_FOUND: import('better-auth').RawError<"CHALLENGE_NOT_FOUND">;
2746
- YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: import('better-auth').RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
2747
- FAILED_TO_VERIFY_REGISTRATION: import('better-auth').RawError<"FAILED_TO_VERIFY_REGISTRATION">;
2748
- PASSKEY_NOT_FOUND: import('better-auth').RawError<"PASSKEY_NOT_FOUND">;
2749
- AUTHENTICATION_FAILED: import('better-auth').RawError<"AUTHENTICATION_FAILED">;
2750
- UNABLE_TO_CREATE_SESSION: import('better-auth').RawError<"UNABLE_TO_CREATE_SESSION">;
2751
- FAILED_TO_UPDATE_PASSKEY: import('better-auth').RawError<"FAILED_TO_UPDATE_PASSKEY">;
2752
- PREVIOUSLY_REGISTERED: import('better-auth').RawError<"PREVIOUSLY_REGISTERED">;
2753
- REGISTRATION_CANCELLED: import('better-auth').RawError<"REGISTRATION_CANCELLED">;
2754
- AUTH_CANCELLED: import('better-auth').RawError<"AUTH_CANCELLED">;
2755
- UNKNOWN_ERROR: import('better-auth').RawError<"UNKNOWN_ERROR">;
2756
- SESSION_REQUIRED: import('better-auth').RawError<"SESSION_REQUIRED">;
2757
- RESOLVE_USER_REQUIRED: import('better-auth').RawError<"RESOLVE_USER_REQUIRED">;
2758
- RESOLVED_USER_INVALID: import('better-auth').RawError<"RESOLVED_USER_INVALID">;
2759
- };
2760
- options: import('@better-auth/passkey/client').PasskeyOptions | undefined;
2761
- }>;
2762
- getActions: ($fetch: import('better-auth/client').BetterFetch, $store: import('better-auth').ClientStore) => {
2763
- signIn: {
2764
- passkey: (opts?: {
2765
- autoFill?: boolean;
2766
- extensions?: import('@better-auth/passkey/client').AuthenticationExtensionsClientInputs;
2767
- returnWebAuthnResponse?: boolean;
2768
- fetchOptions?: import('better-auth').ClientFetchOption;
2769
- } | undefined, options?: import('better-auth').ClientFetchOption | undefined) => Promise<{
2770
- data: null;
2771
- error: {
2772
- message?: string | undefined;
2773
- status: number;
2774
- statusText: string;
2775
- };
2776
- } | {
2777
- data: {
2778
- session: {
2779
- id: string;
2780
- createdAt: Date;
2781
- updatedAt: Date;
2782
- userId: string;
2783
- expiresAt: Date;
2784
- token: string;
2785
- ipAddress?: string | null | undefined;
2786
- userAgent?: string | null | undefined;
2787
- };
2788
- user: {
2789
- id: string;
2790
- createdAt: Date;
2791
- updatedAt: Date;
2792
- email: string;
2793
- emailVerified: boolean;
2794
- name: string;
2795
- image?: string | null | undefined;
2796
- };
2797
- };
2798
- error: null;
2799
- } | {
2800
- webauthn: {
2801
- response: import('@better-auth/passkey/client').AuthenticationResponseJSON;
2802
- clientExtensionResults: import('@better-auth/passkey/client').AuthenticationExtensionsClientOutputs;
2803
- };
2804
- data: null;
2805
- error: {
2806
- message?: string | undefined;
2807
- status: number;
2808
- statusText: string;
2809
- };
2810
- } | {
2811
- webauthn: {
2812
- response: import('@better-auth/passkey/client').AuthenticationResponseJSON;
2813
- clientExtensionResults: import('@better-auth/passkey/client').AuthenticationExtensionsClientOutputs;
2814
- };
2815
- data: {
2816
- session: {
2817
- id: string;
2818
- createdAt: Date;
2819
- updatedAt: Date;
2820
- userId: string;
2821
- expiresAt: Date;
2822
- token: string;
2823
- ipAddress?: string | null | undefined;
2824
- userAgent?: string | null | undefined;
2825
- };
2826
- user: {
2827
- id: string;
2828
- createdAt: Date;
2829
- updatedAt: Date;
2830
- email: string;
2831
- emailVerified: boolean;
2832
- name: string;
2833
- image?: string | null | undefined;
2834
- };
2835
- };
2836
- error: null;
2837
- } | {
2838
- data: null;
2839
- error: {
2840
- code: string;
2841
- message: string;
2842
- status: number;
2843
- statusText: string;
2844
- };
2845
- }>;
2846
- };
2847
- passkey: {
2848
- addPasskey: (opts?: {
2849
- fetchOptions?: import('better-auth').ClientFetchOption;
2850
- name?: string;
2851
- authenticatorAttachment?: "platform" | "cross-platform";
2852
- context?: string | null;
2853
- extensions?: import('@better-auth/passkey/client').AuthenticationExtensionsClientInputs;
2854
- useAutoRegister?: boolean;
2855
- returnWebAuthnResponse?: boolean;
2856
- } | undefined, fetchOpts?: import('better-auth').ClientFetchOption | undefined) => Promise<{
2857
- data: null;
2858
- error: {
2859
- message?: string | undefined;
2860
- status: number;
2861
- statusText: string;
2862
- };
2863
- } | {
2864
- data: import('@better-auth/passkey/client').Passkey;
2865
- error: null;
2866
- } | {
2867
- webauthn: {
2868
- response: import('@better-auth/passkey/client').RegistrationResponseJSON;
2869
- clientExtensionResults: import('@better-auth/passkey/client').AuthenticationExtensionsClientOutputs;
2870
- };
2871
- data: import('@better-auth/passkey/client').Passkey;
2872
- error: null;
2873
- } | {
2874
- data: null;
2875
- error: {
2876
- code: string;
2877
- message: string;
2878
- status: number;
2879
- statusText: string;
2880
- };
2881
- }>;
2882
- };
2883
- $Infer: {
2884
- Passkey: import('@better-auth/passkey/client').Passkey;
2885
- };
2886
- };
2887
- getAtoms($fetch: import('better-auth/client').BetterFetch): {
2888
- listPasskeys: import('better-auth/client').AuthQueryAtom<import('@better-auth/passkey/client').Passkey[]>;
2889
- $listPasskeys: import('better-auth/client').PreinitializedWritableAtom<any> & object;
2890
- };
2891
- pathMethods: {
2892
- "/passkey/register": "POST";
2893
- "/passkey/authenticate": "POST";
2894
- };
2895
- atomListeners: ({
2896
- matcher(path: string): path is "/passkey/delete-passkey" | "/passkey/update-passkey" | "/passkey/verify-registration" | "/sign-out";
2897
- signal: "$listPasskeys";
2898
- } | {
2899
- matcher: (path: string) => path is "/passkey/verify-authentication";
2900
- signal: "$sessionSignal";
2901
- })[];
2902
- $ERROR_CODES: {
2903
- CHALLENGE_NOT_FOUND: import('better-auth').RawError<"CHALLENGE_NOT_FOUND">;
2904
- YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: import('better-auth').RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
2905
- FAILED_TO_VERIFY_REGISTRATION: import('better-auth').RawError<"FAILED_TO_VERIFY_REGISTRATION">;
2906
- PASSKEY_NOT_FOUND: import('better-auth').RawError<"PASSKEY_NOT_FOUND">;
2907
- AUTHENTICATION_FAILED: import('better-auth').RawError<"AUTHENTICATION_FAILED">;
2908
- UNABLE_TO_CREATE_SESSION: import('better-auth').RawError<"UNABLE_TO_CREATE_SESSION">;
2909
- FAILED_TO_UPDATE_PASSKEY: import('better-auth').RawError<"FAILED_TO_UPDATE_PASSKEY">;
2910
- PREVIOUSLY_REGISTERED: import('better-auth').RawError<"PREVIOUSLY_REGISTERED">;
2911
- REGISTRATION_CANCELLED: import('better-auth').RawError<"REGISTRATION_CANCELLED">;
2912
- AUTH_CANCELLED: import('better-auth').RawError<"AUTH_CANCELLED">;
2913
- UNKNOWN_ERROR: import('better-auth').RawError<"UNKNOWN_ERROR">;
2914
- SESSION_REQUIRED: import('better-auth').RawError<"SESSION_REQUIRED">;
2915
- RESOLVE_USER_REQUIRED: import('better-auth').RawError<"RESOLVE_USER_REQUIRED">;
2916
- RESOLVED_USER_INVALID: import('better-auth').RawError<"RESOLVED_USER_INVALID">;
2917
- };
2918
- } | {
2919
- id: "username";
2920
- version: string;
2921
- $InferServerPlugin: ReturnType<(options?: import('better-auth/plugins/username').UsernameOptions | undefined) => {
2922
- id: "username";
2923
- version: string;
2924
- init(ctx: import('better-auth').AuthContext): {
2925
- options: {
2926
- databaseHooks: {
2927
- user: {
2928
- create: {
2929
- before(user: {
2930
- id: string;
2931
- createdAt: Date;
2932
- updatedAt: Date;
2933
- email: string;
2934
- emailVerified: boolean;
2935
- name: string;
2936
- image?: string | null | undefined;
2937
- } & Record<string, unknown>, context: import('better-auth').GenericEndpointContext | null): Promise<{
2938
- data: {
2939
- displayUsername?: string | undefined;
2940
- username?: string | undefined;
2941
- id: string;
2942
- createdAt: Date;
2943
- updatedAt: Date;
2944
- email: string;
2945
- emailVerified: boolean;
2946
- name: string;
2947
- image?: string | null | undefined;
2948
- };
2949
- }>;
2950
- };
2951
- update: {
2952
- before(user: Partial<{
2953
- id: string;
2954
- createdAt: Date;
2955
- updatedAt: Date;
2956
- email: string;
2957
- emailVerified: boolean;
2958
- name: string;
2959
- image?: string | null | undefined;
2960
- }> & Record<string, unknown>, context: import('better-auth').GenericEndpointContext | null): Promise<{
2961
- data: {
2962
- displayUsername?: string | undefined;
2963
- username?: string | undefined;
2964
- id?: string | undefined;
2965
- createdAt?: Date | undefined;
2966
- updatedAt?: Date | undefined;
2967
- email?: string | undefined;
2968
- emailVerified?: boolean | undefined;
2969
- name?: string | undefined;
2970
- image?: string | null | undefined;
2971
- };
2972
- }>;
2973
- };
2974
- };
2975
- };
2976
- };
2977
- };
2978
- endpoints: {
2979
- signInUsername: import('better-auth').StrictEndpoint<"/sign-in/username", {
2980
- method: "POST";
2981
- body: import('zod').ZodObject<{
2982
- username: import('zod').ZodString;
2983
- password: import('zod').ZodString;
2984
- rememberMe: import('zod').ZodOptional<import('zod').ZodBoolean>;
2985
- callbackURL: import('zod').ZodOptional<import('zod').ZodString>;
2986
- }, import('zod/v4/core').$strip>;
2987
- metadata: {
2988
- openapi: {
2989
- summary: string;
2990
- description: string;
2991
- responses: {
2992
- 200: {
2993
- description: string;
2994
- content: {
2995
- "application/json": {
2996
- schema: {
2997
- type: "object";
2998
- properties: {
2999
- token: {
3000
- type: string;
3001
- description: string;
3002
- };
3003
- user: {
3004
- $ref: string;
3005
- };
3006
- };
3007
- required: string[];
3008
- };
3009
- };
3010
- };
3011
- };
3012
- 422: {
3013
- description: string;
3014
- content: {
3015
- "application/json": {
3016
- schema: {
3017
- type: "object";
3018
- properties: {
3019
- message: {
3020
- type: string;
3021
- };
3022
- };
3023
- };
3024
- };
3025
- };
3026
- };
3027
- };
3028
- };
3029
- };
3030
- }, {
3031
- token: string;
3032
- user: {
3033
- id: string;
3034
- createdAt: Date;
3035
- updatedAt: Date;
3036
- email: string;
3037
- emailVerified: boolean;
3038
- name: string;
3039
- image?: string | null | undefined;
3040
- } & {
3041
- username: string;
3042
- displayUsername: string;
3043
- };
3044
- }>;
3045
- isUsernameAvailable: import('better-auth').StrictEndpoint<"/is-username-available", {
3046
- method: "POST";
3047
- body: import('zod').ZodObject<{
3048
- username: import('zod').ZodString;
3049
- }, import('zod/v4/core').$strip>;
3050
- }, {
3051
- available: boolean;
3052
- }>;
3053
- };
3054
- schema: {
3055
- user: {
3056
- fields: {
3057
- username: {
3058
- type: "string";
3059
- required: false;
3060
- sortable: true;
3061
- unique: true;
3062
- returned: true;
3063
- transform: {
3064
- input(value: import('better-auth').DBPrimitive): string | number | boolean | Date | Record<string, unknown> | unknown[] | null | undefined;
3065
- };
3066
- };
3067
- displayUsername: {
3068
- type: "string";
3069
- required: false;
3070
- transform: {
3071
- input(value: import('better-auth').DBPrimitive): string | number | boolean | Date | Record<string, unknown> | unknown[] | null | undefined;
3072
- };
3073
- };
3074
- };
3075
- };
3076
- };
3077
- hooks: {
3078
- before: {
3079
- matcher(context: import('better-auth').HookEndpointContext): boolean;
3080
- handler: (inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<void>;
3081
- }[];
3082
- };
3083
- options: import('better-auth/plugins/username').UsernameOptions | undefined;
3084
- $ERROR_CODES: {
3085
- EMAIL_NOT_VERIFIED: import('better-auth').RawError<"EMAIL_NOT_VERIFIED">;
3086
- UNEXPECTED_ERROR: import('better-auth').RawError<"UNEXPECTED_ERROR">;
3087
- INVALID_USERNAME_OR_PASSWORD: import('better-auth').RawError<"INVALID_USERNAME_OR_PASSWORD">;
3088
- USERNAME_IS_ALREADY_TAKEN: import('better-auth').RawError<"USERNAME_IS_ALREADY_TAKEN">;
3089
- USERNAME_TOO_SHORT: import('better-auth').RawError<"USERNAME_TOO_SHORT">;
3090
- USERNAME_TOO_LONG: import('better-auth').RawError<"USERNAME_TOO_LONG">;
3091
- INVALID_USERNAME: import('better-auth').RawError<"INVALID_USERNAME">;
3092
- INVALID_DISPLAY_USERNAME: import('better-auth').RawError<"INVALID_DISPLAY_USERNAME">;
3093
- };
3094
- }>;
3095
- atomListeners: {
3096
- matcher: (path: string) => path is "/sign-in/username";
3097
- signal: "$sessionSignal";
3098
- }[];
3099
- $ERROR_CODES: {
3100
- EMAIL_NOT_VERIFIED: import('better-auth').RawError<"EMAIL_NOT_VERIFIED">;
3101
- UNEXPECTED_ERROR: import('better-auth').RawError<"UNEXPECTED_ERROR">;
3102
- INVALID_USERNAME_OR_PASSWORD: import('better-auth').RawError<"INVALID_USERNAME_OR_PASSWORD">;
3103
- USERNAME_IS_ALREADY_TAKEN: import('better-auth').RawError<"USERNAME_IS_ALREADY_TAKEN">;
3104
- USERNAME_TOO_SHORT: import('better-auth').RawError<"USERNAME_TOO_SHORT">;
3105
- USERNAME_TOO_LONG: import('better-auth').RawError<"USERNAME_TOO_LONG">;
3106
- INVALID_USERNAME: import('better-auth').RawError<"INVALID_USERNAME">;
3107
- INVALID_DISPLAY_USERNAME: import('better-auth').RawError<"INVALID_DISPLAY_USERNAME">;
3108
- };
3109
- })[];
3110
- }, FetchOptions>> | undefined, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
3111
- status: boolean;
3112
- }, {
3113
- code?: string | undefined;
3114
- message?: string | undefined;
3115
- }, FetchOptions["throw"] extends true ? true : false>>;
3116
- } & {
3117
- requestPasswordReset: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
3118
- email: string;
3119
- redirectTo?: string | undefined;
3120
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
3121
- email: string;
3122
- redirectTo?: string | undefined;
3123
- } & {
3124
- fetchOptions?: FetchOptions | undefined;
3125
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
3126
- status: boolean;
3127
- message: string;
3128
- }, {
3129
- code?: string | undefined;
3130
- message?: string | undefined;
3131
- }, FetchOptions["throw"] extends true ? true : false>>;
3132
- } & {
3133
- resetPassword: {
3134
- ":token": <FetchOptions extends import('better-auth').ClientFetchOption<never, Partial<{
3135
- callbackURL: string;
3136
- }> & Record<string, any>, {
3137
- token: string;
3138
- }>>(data_0: import('better-auth').Prettify<{
3139
- query: {
3140
- callbackURL: string;
3141
- };
3142
- fetchOptions?: FetchOptions | undefined;
3143
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<never, {
3144
- code?: string | undefined;
3145
- message?: string | undefined;
3146
- }, FetchOptions["throw"] extends true ? true : false>>;
3147
- };
3148
- } & {
3149
- listSessions: <FetchOptions extends import('better-auth').ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import('better-auth').Prettify<{
3150
- query?: Record<string, any> | undefined;
3151
- fetchOptions?: FetchOptions | undefined;
3152
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<import('better-auth').Prettify<{
3153
- id: string;
3154
- createdAt: Date;
3155
- updatedAt: Date;
3156
- userId: string;
3157
- expiresAt: Date;
3158
- token: string;
3159
- ipAddress?: string | null | undefined | undefined;
3160
- userAgent?: string | null | undefined | undefined;
3161
- }>[], {
3162
- code?: string | undefined;
3163
- message?: string | undefined;
3164
- }, FetchOptions["throw"] extends true ? true : false>>;
3165
- } & {
3166
- revokeSession: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
3167
- token: string;
3168
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
3169
- token: string;
3170
- } & {
3171
- fetchOptions?: FetchOptions | undefined;
3172
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
3173
- status: boolean;
3174
- }, {
3175
- code?: string | undefined;
3176
- message?: string | undefined;
3177
- }, FetchOptions["throw"] extends true ? true : false>>;
3178
- } & {
3179
- revokeSessions: <FetchOptions extends import('better-auth').ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import('better-auth').Prettify<{
3180
- query?: Record<string, any> | undefined;
3181
- fetchOptions?: FetchOptions | undefined;
3182
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
3183
- status: boolean;
3184
- }, {
3185
- code?: string | undefined;
3186
- message?: string | undefined;
3187
- }, FetchOptions["throw"] extends true ? true : false>>;
3188
- } & {
3189
- revokeOtherSessions: <FetchOptions extends import('better-auth').ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import('better-auth').Prettify<{
3190
- query?: Record<string, any> | undefined;
3191
- fetchOptions?: FetchOptions | undefined;
3192
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
3193
- status: boolean;
3194
- }, {
3195
- code?: string | undefined;
3196
- message?: string | undefined;
3197
- }, FetchOptions["throw"] extends true ? true : false>>;
3198
- } & {
3199
- linkSocial: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
3200
- provider: unknown;
3201
- callbackURL?: string | undefined;
3202
- idToken?: {
3203
- token: string;
3204
- nonce?: string | undefined;
3205
- accessToken?: string | undefined;
3206
- refreshToken?: string | undefined;
3207
- scopes?: string[] | undefined;
3208
- } | undefined;
3209
- requestSignUp?: boolean | undefined;
3210
- scopes?: string[] | undefined;
3211
- errorCallbackURL?: string | undefined;
3212
- disableRedirect?: boolean | undefined;
3213
- additionalData?: Record<string, any> | undefined;
3214
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
3215
- provider: unknown;
3216
- callbackURL?: string | undefined;
3217
- idToken?: {
3218
- token: string;
3219
- nonce?: string | undefined;
3220
- accessToken?: string | undefined;
3221
- refreshToken?: string | undefined;
3222
- scopes?: string[] | undefined;
3223
- } | undefined;
3224
- requestSignUp?: boolean | undefined;
3225
- scopes?: string[] | undefined;
3226
- errorCallbackURL?: string | undefined;
3227
- disableRedirect?: boolean | undefined;
3228
- additionalData?: Record<string, any> | undefined;
3229
- } & {
3230
- fetchOptions?: FetchOptions | undefined;
3231
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
3232
- url: string;
3233
- redirect: boolean;
3234
- }, {
3235
- code?: string | undefined;
3236
- message?: string | undefined;
3237
- }, FetchOptions["throw"] extends true ? true : false>>;
3238
- } & {
3239
- listAccounts: <FetchOptions extends import('better-auth').ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import('better-auth').Prettify<{
3240
- query?: Record<string, any> | undefined;
3241
- fetchOptions?: FetchOptions | undefined;
3242
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
3243
- scopes: string[];
3244
- id: string;
3245
- createdAt: Date;
3246
- updatedAt: Date;
3247
- userId: string;
3248
- providerId: string;
3249
- accountId: string;
3250
- }[], {
3251
- code?: string | undefined;
3252
- message?: string | undefined;
3253
- }, FetchOptions["throw"] extends true ? true : false>>;
3254
- } & {
3255
- deleteUser: {
3256
- callback: <FetchOptions extends import('better-auth').ClientFetchOption<never, Partial<{
3257
- token: string;
3258
- callbackURL?: string | undefined;
3259
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
3260
- query: {
3261
- token: string;
3262
- callbackURL?: string | undefined;
3263
- };
3264
- fetchOptions?: FetchOptions | undefined;
3265
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
3266
- success: boolean;
3267
- message: string;
3268
- }, {
3269
- code?: string | undefined;
3270
- message?: string | undefined;
3271
- }, FetchOptions["throw"] extends true ? true : false>>;
3272
- };
3273
- } & {
3274
- unlinkAccount: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
3275
- providerId: string;
3276
- accountId?: string | undefined;
3277
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
3278
- providerId: string;
3279
- accountId?: string | undefined;
3280
- } & {
3281
- fetchOptions?: FetchOptions | undefined;
3282
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
3283
- status: boolean;
3284
- }, {
3285
- code?: string | undefined;
3286
- message?: string | undefined;
3287
- }, FetchOptions["throw"] extends true ? true : false>>;
3288
- } & {
3289
- refreshToken: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
3290
- providerId: string;
3291
- accountId?: string | undefined;
3292
- userId?: string | undefined;
3293
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
3294
- providerId: string;
3295
- accountId?: string | undefined;
3296
- userId?: string | undefined;
3297
- } & {
3298
- fetchOptions?: FetchOptions | undefined;
3299
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
3300
- accessToken: string | undefined;
3301
- refreshToken: string;
3302
- accessTokenExpiresAt: Date | undefined;
3303
- refreshTokenExpiresAt: Date | null | undefined;
3304
- scope: string | null | undefined;
3305
- idToken: string | null | undefined;
3306
- providerId: string;
3307
- accountId: string;
3308
- }, {
3309
- code?: string | undefined;
3310
- message?: string | undefined;
3311
- }, FetchOptions["throw"] extends true ? true : false>>;
3312
- } & {
3313
- getAccessToken: <FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
3314
- providerId: string;
3315
- accountId?: string | undefined;
3316
- userId?: string | undefined;
3317
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
3318
- providerId: string;
3319
- accountId?: string | undefined;
3320
- userId?: string | undefined;
3321
- } & {
3322
- fetchOptions?: FetchOptions | undefined;
3323
- }>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
3324
- accessToken: string;
3325
- accessTokenExpiresAt: Date | undefined;
3326
- scopes: string[];
3327
- idToken: string | undefined;
3328
- }, {
3329
- code?: string | undefined;
3330
- message?: string | undefined;
3331
- }, FetchOptions["throw"] extends true ? true : false>>;
3332
- } & {
3333
- accountInfo: <FetchOptions extends import('better-auth').ClientFetchOption<never, Partial<{
3334
- accountId?: string | undefined;
3335
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import('better-auth').Prettify<{
3336
- query?: {
3337
- accountId?: string | undefined;
3338
- } | undefined;
3339
- fetchOptions?: FetchOptions | undefined;
3340
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
3341
- user: import('better-auth').OAuth2UserInfo;
3342
- data: Record<string, any>;
3343
- }, {
3344
- code?: string | undefined;
3345
- message?: string | undefined;
3346
- }, FetchOptions["throw"] extends true ? true : false>>;
3347
- } & {
3348
- getSession: <FetchOptions extends import('better-auth').ClientFetchOption<never, Partial<{
3349
- disableCookieCache?: unknown;
3350
- disableRefresh?: unknown;
3351
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import('better-auth').Prettify<{
3352
- query?: {
3353
- disableCookieCache?: unknown;
3354
- disableRefresh?: unknown;
3355
- } | undefined;
3356
- fetchOptions?: FetchOptions | undefined;
3357
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
3358
- user: import('better-auth').StripEmptyObjects<{
3359
- id: string;
3360
- createdAt: Date;
3361
- updatedAt: Date;
3362
- email: string;
3363
- emailVerified: boolean;
3364
- name: string;
3365
- image?: string | null | undefined;
3366
- } & {} & {
3367
- username?: string | null | undefined;
3368
- displayUsername?: string | null | undefined;
3369
- }>;
3370
- session: import('better-auth').StripEmptyObjects<{
3371
- id: string;
3372
- createdAt: Date;
3373
- updatedAt: Date;
3374
- userId: string;
3375
- expiresAt: Date;
3376
- token: string;
3377
- ipAddress?: string | null | undefined;
3378
- userAgent?: string | null | undefined;
3379
- }>;
3380
- } | null, {
3381
- code?: string | undefined;
3382
- message?: string | undefined;
3383
- }, FetchOptions["throw"] extends true ? true : false>>;
3384
- } & {
3385
- signIn: {
3386
- passkey: (opts?: {
3387
- autoFill?: boolean;
3388
- extensions?: import('@better-auth/passkey/client').AuthenticationExtensionsClientInputs;
3389
- returnWebAuthnResponse?: boolean;
3390
- fetchOptions?: import('better-auth').ClientFetchOption;
3391
- } | undefined, options?: import('better-auth').ClientFetchOption | undefined) => Promise<{
3392
- data: null;
3393
- error: {
3394
- message?: string | undefined;
3395
- status: number;
3396
- statusText: string;
3397
- };
3398
- } | {
3399
- data: {
3400
- session: import('better-auth').Session;
3401
- user: import('better-auth').User;
3402
- };
3403
- error: null;
3404
- } | {
3405
- webauthn: {
3406
- response: import('@better-auth/passkey/client').AuthenticationResponseJSON;
3407
- clientExtensionResults: import('@better-auth/passkey/client').AuthenticationExtensionsClientOutputs;
3408
- };
3409
- data: null;
3410
- error: {
3411
- message?: string | undefined;
3412
- status: number;
3413
- statusText: string;
3414
- };
3415
- } | {
3416
- webauthn: {
3417
- response: import('@better-auth/passkey/client').AuthenticationResponseJSON;
3418
- clientExtensionResults: import('@better-auth/passkey/client').AuthenticationExtensionsClientOutputs;
3419
- };
3420
- data: {
3421
- session: import('better-auth').Session;
3422
- user: import('better-auth').User;
3423
- };
3424
- error: null;
3425
- } | {
3426
- data: null;
3427
- error: {
3428
- code: string;
3429
- message: string;
3430
- status: number;
3431
- statusText: string;
3432
- };
3433
- }>;
3434
- };
3435
- passkey: {
3436
- addPasskey: (opts?: {
3437
- fetchOptions?: import('better-auth').ClientFetchOption;
3438
- name?: string;
3439
- authenticatorAttachment?: "platform" | "cross-platform";
3440
- context?: string | null;
3441
- extensions?: import('@better-auth/passkey/client').AuthenticationExtensionsClientInputs;
3442
- useAutoRegister?: boolean;
3443
- returnWebAuthnResponse?: boolean;
3444
- } | undefined, fetchOpts?: import('better-auth').ClientFetchOption | undefined) => Promise<{
3445
- data: null;
3446
- error: {
3447
- message?: string | undefined;
3448
- status: number;
3449
- statusText: string;
3450
- };
3451
- } | {
3452
- data: import('@better-auth/passkey/client').Passkey;
3453
- error: null;
3454
- } | {
3455
- webauthn: {
3456
- response: import('@better-auth/passkey/client').RegistrationResponseJSON;
3457
- clientExtensionResults: import('@better-auth/passkey/client').AuthenticationExtensionsClientOutputs;
3458
- };
3459
- data: import('@better-auth/passkey/client').Passkey;
3460
- error: null;
3461
- } | {
3462
- data: null;
3463
- error: {
3464
- code: string;
3465
- message: string;
3466
- status: number;
3467
- statusText: string;
3468
- };
3469
- }>;
3470
- };
3471
- $Infer: {
3472
- Passkey: import('@better-auth/passkey/client').Passkey;
3473
- };
3474
- } & {
3475
- useSession: () => {
3476
- data: {
3477
- user: import('better-auth').StripEmptyObjects<{
3478
- id: string;
3479
- createdAt: Date;
3480
- updatedAt: Date;
3481
- email: string;
3482
- emailVerified: boolean;
3483
- name: string;
3484
- image?: string | null | undefined;
3485
- } & {} & {
3486
- username?: string | null | undefined;
3487
- displayUsername?: string | null | undefined;
3488
- }>;
3489
- session: import('better-auth').StripEmptyObjects<{
3490
- id: string;
3491
- createdAt: Date;
3492
- updatedAt: Date;
3493
- userId: string;
3494
- expiresAt: Date;
3495
- token: string;
3496
- ipAddress?: string | null | undefined;
3497
- userAgent?: string | null | undefined;
3498
- }>;
3499
- } | null;
3500
- isPending: boolean;
3501
- isRefetching: boolean;
3502
- error: import('better-auth/client').BetterFetchError | null;
3503
- refetch: (queryParams?: {
3504
- query?: import('better-auth').SessionQueryParams;
3505
- } | undefined) => Promise<void>;
3506
- };
3507
- $Infer: {
3508
- Session: {
3509
- user: import('better-auth').StripEmptyObjects<{
3510
- id: string;
3511
- createdAt: Date;
3512
- updatedAt: Date;
3513
- email: string;
3514
- emailVerified: boolean;
3515
- name: string;
3516
- image?: string | null | undefined;
3517
- } & {} & {
3518
- username?: string | null | undefined;
3519
- displayUsername?: string | null | undefined;
3520
- }>;
3521
- session: import('better-auth').StripEmptyObjects<{
3522
- id: string;
3523
- createdAt: Date;
3524
- updatedAt: Date;
3525
- userId: string;
3526
- expiresAt: Date;
3527
- token: string;
3528
- ipAddress?: string | null | undefined;
3529
- userAgent?: string | null | undefined;
3530
- }>;
3531
- };
3532
- };
3533
- $fetch: import('better-auth/client').BetterFetch<{
3534
- plugins: (import('better-auth/client').BetterFetchPlugin<Record<string, any>> | {
3535
- id: string;
3536
- name: string;
3537
- hooks: {
3538
- onSuccess(context: import('better-auth/client').SuccessContext<any>): void;
3539
- };
3540
- } | {
3541
- id: string;
3542
- name: string;
3543
- hooks: {
3544
- onSuccess: ((context: import('better-auth/client').SuccessContext<any>) => Promise<void> | void) | undefined;
3545
- onError: ((context: import('better-auth/client').ErrorContext) => Promise<void> | void) | undefined;
3546
- onRequest: (<T extends Record<string, any>>(context: import('better-auth/client').RequestContext<T>) => Promise<import('better-auth/client').RequestContext | void> | import('better-auth/client').RequestContext | void) | undefined;
3547
- onResponse: ((context: import('better-auth/client').ResponseContext) => Promise<Response | void | import('better-auth/client').ResponseContext> | Response | import('better-auth/client').ResponseContext | void) | undefined;
3548
- };
3549
- })[];
3550
- priority?: RequestPriority | undefined;
3551
- cache?: RequestCache | undefined;
3552
- credentials?: RequestCredentials;
3553
- headers?: (HeadersInit & (HeadersInit | {
3554
- accept: "application/json" | "text/plain" | "application/octet-stream";
3555
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
3556
- authorization: "Bearer" | "Basic";
3557
- })) | undefined;
3558
- integrity?: string | undefined;
3559
- keepalive?: boolean | undefined;
3560
- method: string;
3561
- mode?: RequestMode | undefined;
3562
- redirect?: RequestRedirect | undefined;
3563
- referrer?: string | undefined;
3564
- referrerPolicy?: ReferrerPolicy | undefined;
3565
- signal?: (AbortSignal | null) | undefined;
3566
- window?: null | undefined;
3567
- onRetry?: ((response: import('better-auth/client').ResponseContext) => Promise<void> | void) | undefined;
3568
- hookOptions?: {
3569
- cloneResponse?: boolean;
3570
- } | undefined;
3571
- timeout?: number | undefined;
3572
- customFetchImpl: import('better-auth/client').FetchEsque;
3573
- baseURL: string;
3574
- throw?: boolean | undefined;
3575
- auth?: ({
3576
- type: "Bearer";
3577
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
3578
- } | {
3579
- type: "Basic";
3580
- username: string | (() => string | undefined) | undefined;
3581
- password: string | (() => string | undefined) | undefined;
3582
- } | {
3583
- type: "Custom";
3584
- prefix: string | (() => string | undefined) | undefined;
3585
- value: string | (() => string | undefined) | undefined;
3586
- }) | undefined;
3587
- body?: any;
3588
- query?: any;
3589
- params?: any;
3590
- duplex?: "full" | "half" | undefined;
3591
- jsonParser: (text: string) => Promise<any> | any;
3592
- retry?: import('better-auth/client').RetryOptions | undefined;
3593
- retryAttempt?: number | undefined;
3594
- output?: (import('better-auth/client').StandardSchemaV1 | typeof Blob | typeof File) | undefined;
3595
- errorSchema?: import('better-auth/client').StandardSchemaV1 | undefined;
3596
- disableValidation?: boolean | undefined;
3597
- disableSignal?: boolean | undefined;
3598
- }, unknown, unknown, {}>;
3599
- $store: {
3600
- notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
3601
- listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
3602
- atoms: Record<string, import('better-auth/client').WritableAtom<any>>;
3603
- };
3604
- $ERROR_CODES: {
3605
- INVALID_SESSION_TOKEN: import('better-auth').RawError<"INVALID_SESSION_TOKEN">;
3606
- } & {
3607
- CHALLENGE_NOT_FOUND: import('better-auth').RawError<"CHALLENGE_NOT_FOUND">;
3608
- YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: import('better-auth').RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
3609
- FAILED_TO_VERIFY_REGISTRATION: import('better-auth').RawError<"FAILED_TO_VERIFY_REGISTRATION">;
3610
- PASSKEY_NOT_FOUND: import('better-auth').RawError<"PASSKEY_NOT_FOUND">;
3611
- AUTHENTICATION_FAILED: import('better-auth').RawError<"AUTHENTICATION_FAILED">;
3612
- UNABLE_TO_CREATE_SESSION: import('better-auth').RawError<"UNABLE_TO_CREATE_SESSION">;
3613
- FAILED_TO_UPDATE_PASSKEY: import('better-auth').RawError<"FAILED_TO_UPDATE_PASSKEY">;
3614
- PREVIOUSLY_REGISTERED: import('better-auth').RawError<"PREVIOUSLY_REGISTERED">;
3615
- REGISTRATION_CANCELLED: import('better-auth').RawError<"REGISTRATION_CANCELLED">;
3616
- AUTH_CANCELLED: import('better-auth').RawError<"AUTH_CANCELLED">;
3617
- UNKNOWN_ERROR: import('better-auth').RawError<"UNKNOWN_ERROR">;
3618
- SESSION_REQUIRED: import('better-auth').RawError<"SESSION_REQUIRED">;
3619
- RESOLVE_USER_REQUIRED: import('better-auth').RawError<"RESOLVE_USER_REQUIRED">;
3620
- RESOLVED_USER_INVALID: import('better-auth').RawError<"RESOLVED_USER_INVALID">;
3621
- } & {
3622
- EMAIL_NOT_VERIFIED: import('better-auth').RawError<"EMAIL_NOT_VERIFIED">;
3623
- UNEXPECTED_ERROR: import('better-auth').RawError<"UNEXPECTED_ERROR">;
3624
- INVALID_USERNAME_OR_PASSWORD: import('better-auth').RawError<"INVALID_USERNAME_OR_PASSWORD">;
3625
- USERNAME_IS_ALREADY_TAKEN: import('better-auth').RawError<"USERNAME_IS_ALREADY_TAKEN">;
3626
- USERNAME_TOO_SHORT: import('better-auth').RawError<"USERNAME_TOO_SHORT">;
3627
- USERNAME_TOO_LONG: import('better-auth').RawError<"USERNAME_TOO_LONG">;
3628
- INVALID_USERNAME: import('better-auth').RawError<"INVALID_USERNAME">;
3629
- INVALID_DISPLAY_USERNAME: import('better-auth').RawError<"INVALID_DISPLAY_USERNAME">;
3630
- } & {
3631
- USER_NOT_FOUND: import('better-auth').RawError<"USER_NOT_FOUND">;
3632
- FAILED_TO_CREATE_USER: import('better-auth').RawError<"FAILED_TO_CREATE_USER">;
3633
- FAILED_TO_CREATE_SESSION: import('better-auth').RawError<"FAILED_TO_CREATE_SESSION">;
3634
- FAILED_TO_UPDATE_USER: import('better-auth').RawError<"FAILED_TO_UPDATE_USER">;
3635
- FAILED_TO_GET_SESSION: import('better-auth').RawError<"FAILED_TO_GET_SESSION">;
3636
- INVALID_PASSWORD: import('better-auth').RawError<"INVALID_PASSWORD">;
3637
- INVALID_EMAIL: import('better-auth').RawError<"INVALID_EMAIL">;
3638
- INVALID_EMAIL_OR_PASSWORD: import('better-auth').RawError<"INVALID_EMAIL_OR_PASSWORD">;
3639
- INVALID_USER: import('better-auth').RawError<"INVALID_USER">;
3640
- SOCIAL_ACCOUNT_ALREADY_LINKED: import('better-auth').RawError<"SOCIAL_ACCOUNT_ALREADY_LINKED">;
3641
- PROVIDER_NOT_FOUND: import('better-auth').RawError<"PROVIDER_NOT_FOUND">;
3642
- INVALID_TOKEN: import('better-auth').RawError<"INVALID_TOKEN">;
3643
- TOKEN_EXPIRED: import('better-auth').RawError<"TOKEN_EXPIRED">;
3644
- ID_TOKEN_NOT_SUPPORTED: import('better-auth').RawError<"ID_TOKEN_NOT_SUPPORTED">;
3645
- FAILED_TO_GET_USER_INFO: import('better-auth').RawError<"FAILED_TO_GET_USER_INFO">;
3646
- USER_EMAIL_NOT_FOUND: import('better-auth').RawError<"USER_EMAIL_NOT_FOUND">;
3647
- EMAIL_NOT_VERIFIED: import('better-auth').RawError<"EMAIL_NOT_VERIFIED">;
3648
- PASSWORD_TOO_SHORT: import('better-auth').RawError<"PASSWORD_TOO_SHORT">;
3649
- PASSWORD_TOO_LONG: import('better-auth').RawError<"PASSWORD_TOO_LONG">;
3650
- USER_ALREADY_EXISTS: import('better-auth').RawError<"USER_ALREADY_EXISTS">;
3651
- USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: import('better-auth').RawError<"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL">;
3652
- EMAIL_CAN_NOT_BE_UPDATED: import('better-auth').RawError<"EMAIL_CAN_NOT_BE_UPDATED">;
3653
- CREDENTIAL_ACCOUNT_NOT_FOUND: import('better-auth').RawError<"CREDENTIAL_ACCOUNT_NOT_FOUND">;
3654
- ACCOUNT_NOT_FOUND: import('better-auth').RawError<"ACCOUNT_NOT_FOUND">;
3655
- SESSION_EXPIRED: import('better-auth').RawError<"SESSION_EXPIRED">;
3656
- FAILED_TO_UNLINK_LAST_ACCOUNT: import('better-auth').RawError<"FAILED_TO_UNLINK_LAST_ACCOUNT">;
3657
- USER_ALREADY_HAS_PASSWORD: import('better-auth').RawError<"USER_ALREADY_HAS_PASSWORD">;
3658
- CROSS_SITE_NAVIGATION_LOGIN_BLOCKED: import('better-auth').RawError<"CROSS_SITE_NAVIGATION_LOGIN_BLOCKED">;
3659
- VERIFICATION_EMAIL_NOT_ENABLED: import('better-auth').RawError<"VERIFICATION_EMAIL_NOT_ENABLED">;
3660
- EMAIL_ALREADY_VERIFIED: import('better-auth').RawError<"EMAIL_ALREADY_VERIFIED">;
3661
- EMAIL_MISMATCH: import('better-auth').RawError<"EMAIL_MISMATCH">;
3662
- SESSION_NOT_FRESH: import('better-auth').RawError<"SESSION_NOT_FRESH">;
3663
- LINKED_ACCOUNT_ALREADY_EXISTS: import('better-auth').RawError<"LINKED_ACCOUNT_ALREADY_EXISTS">;
3664
- INVALID_ORIGIN: import('better-auth').RawError<"INVALID_ORIGIN">;
3665
- INVALID_CALLBACK_URL: import('better-auth').RawError<"INVALID_CALLBACK_URL">;
3666
- INVALID_REDIRECT_URL: import('better-auth').RawError<"INVALID_REDIRECT_URL">;
3667
- INVALID_ERROR_CALLBACK_URL: import('better-auth').RawError<"INVALID_ERROR_CALLBACK_URL">;
3668
- INVALID_NEW_USER_CALLBACK_URL: import('better-auth').RawError<"INVALID_NEW_USER_CALLBACK_URL">;
3669
- MISSING_OR_NULL_ORIGIN: import('better-auth').RawError<"MISSING_OR_NULL_ORIGIN">;
3670
- CALLBACK_URL_REQUIRED: import('better-auth').RawError<"CALLBACK_URL_REQUIRED">;
3671
- FAILED_TO_CREATE_VERIFICATION: import('better-auth').RawError<"FAILED_TO_CREATE_VERIFICATION">;
3672
- FIELD_NOT_ALLOWED: import('better-auth').RawError<"FIELD_NOT_ALLOWED">;
3673
- ASYNC_VALIDATION_NOT_SUPPORTED: import('better-auth').RawError<"ASYNC_VALIDATION_NOT_SUPPORTED">;
3674
- VALIDATION_ERROR: import('better-auth').RawError<"VALIDATION_ERROR">;
3675
- MISSING_FIELD: import('better-auth').RawError<"MISSING_FIELD">;
3676
- METHOD_NOT_ALLOWED_DEFER_SESSION_REQUIRED: import('better-auth').RawError<"METHOD_NOT_ALLOWED_DEFER_SESSION_REQUIRED">;
3677
- BODY_MUST_BE_AN_OBJECT: import('better-auth').RawError<"BODY_MUST_BE_AN_OBJECT">;
3678
- PASSWORD_ALREADY_SET: import('better-auth').RawError<"PASSWORD_ALREADY_SET">;
3679
- };
3680
- };
3681
- /**
3682
- * Type representing the default auth client with plugins enabled.
3683
- *
3684
- * This is the standard auth client type used throughout the React package
3685
- * and includes all required plugins enabled.
3686
- */
3687
- type ResolveAuthClient<T> = "AuthClient" extends keyof T ? T["AuthClient"] : typeof authClient;
3688
- /**
3689
- * The resolved auth client type, either from user augmentation or the default.
3690
- */
3691
- export type AuthClient = ResolveAuthClient<AuthConfig>;
25
+ export type InferData<TMethod> = TMethod extends (...args: infer _Args) => Promise<infer TResult extends {
26
+ data: unknown;
27
+ }> ? TResult["data"] : never;