@better-auth-ui/react 1.6.2 → 1.6.4

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 (271) hide show
  1. package/dist/components/auth/auth-provider.d.ts +23 -8
  2. package/dist/components/auth/auth-provider.js +32 -17
  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/email.d.ts +1 -0
  13. package/dist/email.js +11 -0
  14. package/dist/hooks/auth/use-authenticate.d.ts +6 -5
  15. package/dist/hooks/auth/use-authenticate.js +12 -12
  16. package/dist/hooks/auth/use-user.d.ts +18 -311
  17. package/dist/hooks/auth/use-user.js +5 -5
  18. package/dist/hooks/use-auth-mutation.d.ts +17 -0
  19. package/dist/hooks/use-auth-mutation.js +11 -0
  20. package/dist/hooks/use-auth-plugin.d.ts +31 -0
  21. package/dist/hooks/use-auth-plugin.js +10 -0
  22. package/dist/hooks/use-auth-query.d.ts +14 -0
  23. package/dist/hooks/use-auth-query.js +15 -0
  24. package/dist/index.d.ts +35 -34
  25. package/dist/index.js +74 -83
  26. package/dist/lib/auth-client.d.ts +23 -3687
  27. package/dist/lib/auth-plugin.d.ts +59 -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 +42 -0
  44. package/dist/mutations/auth-mutation-options.js +19 -0
  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/queries/auth/session-query.d.ts +71 -0
  76. package/dist/queries/auth/session-query.js +30 -0
  77. package/dist/queries/auth-query-options.d.ts +40 -0
  78. package/dist/queries/auth-query-options.js +17 -0
  79. package/dist/queries/multi-session/list-device-sessions-query.d.ts +76 -0
  80. package/dist/queries/multi-session/list-device-sessions-query.js +31 -0
  81. package/dist/queries/passkey/list-passkeys-query.d.ts +74 -0
  82. package/dist/queries/passkey/list-passkeys-query.js +31 -0
  83. package/dist/queries/settings/account-info-query.d.ts +85 -0
  84. package/dist/queries/settings/account-info-query.js +31 -0
  85. package/dist/queries/settings/list-accounts-query.d.ts +76 -0
  86. package/dist/queries/settings/list-accounts-query.js +31 -0
  87. package/dist/queries/settings/list-sessions-query.d.ts +74 -0
  88. package/dist/queries/settings/list-sessions-query.js +31 -0
  89. package/dist/server/queries/auth/session-query.d.ts +57 -0
  90. package/dist/server/queries/auth/session-query.js +13 -0
  91. package/dist/server/queries/multi-session/list-device-sessions-query.d.ts +60 -0
  92. package/dist/server/queries/multi-session/list-device-sessions-query.js +12 -0
  93. package/dist/server/queries/passkey/list-passkeys-query.d.ts +60 -0
  94. package/dist/server/queries/passkey/list-passkeys-query.js +12 -0
  95. package/dist/server/queries/settings/account-info-query.d.ts +68 -0
  96. package/dist/server/queries/settings/account-info-query.js +12 -0
  97. package/dist/server/queries/settings/list-accounts-query.d.ts +60 -0
  98. package/dist/server/queries/settings/list-accounts-query.js +12 -0
  99. package/dist/server/queries/settings/list-sessions-query.d.ts +60 -0
  100. package/dist/server/queries/settings/list-sessions-query.js +12 -0
  101. package/dist/server.d.ts +7 -0
  102. package/dist/server.js +7 -0
  103. package/package.json +24 -22
  104. package/src/components/auth/auth-provider.tsx +87 -24
  105. package/src/components/{email → auth/email}/email-changed.tsx +1 -1
  106. package/src/components/{email → auth/email}/email-verification.tsx +1 -1
  107. package/src/components/{email → auth/email}/magic-link.tsx +1 -1
  108. package/src/components/{email → auth/email}/new-device.tsx +1 -1
  109. package/src/components/{email → auth/email}/otp-email.tsx +1 -1
  110. package/src/components/{email → auth/email}/password-changed.tsx +1 -1
  111. package/src/components/{email → auth/email}/reset-password.tsx +1 -1
  112. package/src/email.ts +1 -0
  113. package/src/hooks/auth/use-authenticate.ts +13 -10
  114. package/src/hooks/auth/use-user.ts +12 -8
  115. package/src/hooks/use-auth-mutation.ts +47 -0
  116. package/src/hooks/use-auth-plugin.ts +50 -0
  117. package/src/hooks/use-auth-query.ts +40 -0
  118. package/src/index.ts +35 -34
  119. package/src/lib/auth-client.ts +33 -31
  120. package/src/lib/auth-plugin.ts +75 -0
  121. package/src/lib/auth-server.ts +30 -0
  122. package/src/mutations/auth/request-password-reset-mutation.ts +58 -0
  123. package/src/mutations/auth/reset-password-mutation.ts +60 -0
  124. package/src/mutations/auth/send-verification-email-mutation.ts +58 -0
  125. package/src/mutations/auth/sign-in-email-mutation.ts +78 -0
  126. package/src/mutations/auth/sign-in-social-mutation.ts +64 -0
  127. package/src/mutations/auth/sign-out-mutation.ts +71 -0
  128. package/src/mutations/auth/sign-up-email-mutation.ts +74 -0
  129. package/src/mutations/auth-mutation-options.ts +94 -0
  130. package/src/mutations/magic-link/sign-in-magic-link-mutation.ts +59 -0
  131. package/src/mutations/multi-session/revoke-multi-session-mutation.ts +70 -0
  132. package/src/mutations/multi-session/set-active-session-mutation.ts +98 -0
  133. package/src/mutations/passkey/add-passkey-mutation.ts +66 -0
  134. package/src/mutations/passkey/delete-passkey-mutation.ts +66 -0
  135. package/src/mutations/passkey/sign-in-passkey-mutation.ts +74 -0
  136. package/src/mutations/settings/change-email-mutation.ts +67 -0
  137. package/src/mutations/settings/change-password-mutation.ts +59 -0
  138. package/src/mutations/settings/delete-user-mutation.ts +59 -0
  139. package/src/mutations/settings/link-social-mutation.ts +59 -0
  140. package/src/mutations/settings/revoke-session-mutation.ts +69 -0
  141. package/src/mutations/settings/unlink-account-mutation.ts +67 -0
  142. package/src/mutations/settings/update-user-mutation.ts +82 -0
  143. package/src/mutations/username/is-username-available-mutation.ts +62 -0
  144. package/src/mutations/username/sign-in-username-mutation.ts +74 -0
  145. package/src/queries/auth/session-query.ts +135 -0
  146. package/src/queries/auth-query-options.ts +83 -0
  147. package/src/queries/multi-session/list-device-sessions-query.ts +177 -0
  148. package/src/queries/passkey/list-passkeys-query.ts +154 -0
  149. package/src/queries/settings/account-info-query.ts +158 -0
  150. package/src/queries/settings/list-accounts-query.ts +156 -0
  151. package/src/queries/settings/list-sessions-query.ts +154 -0
  152. package/src/server/queries/auth/session-query.ts +94 -0
  153. package/src/server/queries/multi-session/list-device-sessions-query.ts +102 -0
  154. package/src/server/queries/passkey/list-passkeys-query.ts +100 -0
  155. package/src/server/queries/settings/account-info-query.ts +101 -0
  156. package/src/server/queries/settings/list-accounts-query.ts +101 -0
  157. package/src/server/queries/settings/list-sessions-query.ts +101 -0
  158. package/src/server.ts +7 -0
  159. package/dist/core.d.ts +0 -1
  160. package/dist/core.js +0 -1
  161. package/dist/hooks/auth/use-auth-mutation.d.ts +0 -18
  162. package/dist/hooks/auth/use-auth-mutation.js +0 -13
  163. package/dist/hooks/auth/use-auth-query.d.ts +0 -24
  164. package/dist/hooks/auth/use-auth-query.js +0 -13
  165. package/dist/hooks/auth/use-is-username-available.d.ts +0 -19
  166. package/dist/hooks/auth/use-is-username-available.js +0 -12
  167. package/dist/hooks/auth/use-request-password-reset.d.ts +0 -25
  168. package/dist/hooks/auth/use-request-password-reset.js +0 -12
  169. package/dist/hooks/auth/use-reset-password.d.ts +0 -39
  170. package/dist/hooks/auth/use-reset-password.js +0 -12
  171. package/dist/hooks/auth/use-send-verification-email.d.ts +0 -23
  172. package/dist/hooks/auth/use-send-verification-email.js +0 -12
  173. package/dist/hooks/auth/use-session.d.ts +0 -9
  174. package/dist/hooks/auth/use-session.js +0 -15
  175. package/dist/hooks/auth/use-sign-in-email.d.ts +0 -52
  176. package/dist/hooks/auth/use-sign-in-email.js +0 -18
  177. package/dist/hooks/auth/use-sign-in-magic-link.d.ts +0 -31
  178. package/dist/hooks/auth/use-sign-in-magic-link.js +0 -12
  179. package/dist/hooks/auth/use-sign-in-passkey.d.ts +0 -58
  180. package/dist/hooks/auth/use-sign-in-passkey.js +0 -18
  181. package/dist/hooks/auth/use-sign-in-social.d.ts +0 -92
  182. package/dist/hooks/auth/use-sign-in-social.js +0 -12
  183. package/dist/hooks/auth/use-sign-in-username.d.ts +0 -53
  184. package/dist/hooks/auth/use-sign-in-username.js +0 -18
  185. package/dist/hooks/auth/use-sign-out.d.ts +0 -18
  186. package/dist/hooks/auth/use-sign-out.js +0 -18
  187. package/dist/hooks/auth/use-sign-up-email.d.ts +0 -1269
  188. package/dist/hooks/auth/use-sign-up-email.js +0 -18
  189. package/dist/hooks/settings/use-account-info.d.ts +0 -17
  190. package/dist/hooks/settings/use-account-info.js +0 -21
  191. package/dist/hooks/settings/use-add-passkey.d.ts +0 -43
  192. package/dist/hooks/settings/use-add-passkey.js +0 -18
  193. package/dist/hooks/settings/use-change-email.d.ts +0 -24
  194. package/dist/hooks/settings/use-change-email.js +0 -18
  195. package/dist/hooks/settings/use-change-password.d.ts +0 -53
  196. package/dist/hooks/settings/use-change-password.js +0 -12
  197. package/dist/hooks/settings/use-delete-passkey.d.ts +0 -21
  198. package/dist/hooks/settings/use-delete-passkey.js +0 -18
  199. package/dist/hooks/settings/use-delete-user.d.ts +0 -41
  200. package/dist/hooks/settings/use-delete-user.js +0 -12
  201. package/dist/hooks/settings/use-link-social.d.ts +0 -46
  202. package/dist/hooks/settings/use-link-social.js +0 -12
  203. package/dist/hooks/settings/use-list-accounts.d.ts +0 -20
  204. package/dist/hooks/settings/use-list-accounts.js +0 -21
  205. package/dist/hooks/settings/use-list-device-sessions.d.ts +0 -11
  206. package/dist/hooks/settings/use-list-device-sessions.js +0 -21
  207. package/dist/hooks/settings/use-list-sessions.d.ts +0 -20
  208. package/dist/hooks/settings/use-list-sessions.js +0 -21
  209. package/dist/hooks/settings/use-list-user-passkeys.d.ts +0 -11
  210. package/dist/hooks/settings/use-list-user-passkeys.js +0 -21
  211. package/dist/hooks/settings/use-revoke-multi-session.d.ts +0 -19
  212. package/dist/hooks/settings/use-revoke-multi-session.js +0 -18
  213. package/dist/hooks/settings/use-revoke-session.d.ts +0 -19
  214. package/dist/hooks/settings/use-revoke-session.js +0 -18
  215. package/dist/hooks/settings/use-set-active-session.d.ts +0 -37
  216. package/dist/hooks/settings/use-set-active-session.js +0 -21
  217. package/dist/hooks/settings/use-unlink-account.d.ts +0 -21
  218. package/dist/hooks/settings/use-unlink-account.js +0 -18
  219. package/dist/hooks/settings/use-update-user.d.ts +0 -11
  220. package/dist/hooks/settings/use-update-user.js +0 -25
  221. package/dist/lib/auth-client.js +0 -11
  222. package/dist/lib/auth-config.d.ts +0 -43
  223. package/dist/lib/auth-context.d.ts +0 -2
  224. package/dist/lib/auth-context.js +0 -6
  225. package/src/core.ts +0 -1
  226. package/src/hooks/auth/use-auth-mutation.ts +0 -56
  227. package/src/hooks/auth/use-auth-query.ts +0 -50
  228. package/src/hooks/auth/use-is-username-available.ts +0 -22
  229. package/src/hooks/auth/use-request-password-reset.ts +0 -22
  230. package/src/hooks/auth/use-reset-password.ts +0 -21
  231. package/src/hooks/auth/use-send-verification-email.ts +0 -21
  232. package/src/hooks/auth/use-session.ts +0 -27
  233. package/src/hooks/auth/use-sign-in-email.ts +0 -34
  234. package/src/hooks/auth/use-sign-in-magic-link.ts +0 -21
  235. package/src/hooks/auth/use-sign-in-passkey.ts +0 -34
  236. package/src/hooks/auth/use-sign-in-social.ts +0 -21
  237. package/src/hooks/auth/use-sign-in-username.ts +0 -34
  238. package/src/hooks/auth/use-sign-out.ts +0 -33
  239. package/src/hooks/auth/use-sign-up-email.ts +0 -34
  240. package/src/hooks/settings/use-account-info.ts +0 -31
  241. package/src/hooks/settings/use-add-passkey.ts +0 -32
  242. package/src/hooks/settings/use-change-email.ts +0 -33
  243. package/src/hooks/settings/use-change-password.ts +0 -19
  244. package/src/hooks/settings/use-delete-passkey.ts +0 -32
  245. package/src/hooks/settings/use-delete-user.ts +0 -19
  246. package/src/hooks/settings/use-link-social.ts +0 -19
  247. package/src/hooks/settings/use-list-accounts.ts +0 -29
  248. package/src/hooks/settings/use-list-device-sessions.ts +0 -34
  249. package/src/hooks/settings/use-list-sessions.ts +0 -28
  250. package/src/hooks/settings/use-list-user-passkeys.ts +0 -30
  251. package/src/hooks/settings/use-revoke-multi-session.ts +0 -30
  252. package/src/hooks/settings/use-revoke-session.ts +0 -30
  253. package/src/hooks/settings/use-set-active-session.ts +0 -47
  254. package/src/hooks/settings/use-unlink-account.ts +0 -30
  255. package/src/hooks/settings/use-update-user.ts +0 -43
  256. package/src/lib/auth-config.ts +0 -48
  257. package/src/lib/auth-context.ts +0 -6
  258. /package/dist/components/{email → auth/email}/email-changed.d.ts +0 -0
  259. /package/dist/components/{email → auth/email}/email-localization.d.ts +0 -0
  260. /package/dist/components/{email → auth/email}/email-styles.d.ts +0 -0
  261. /package/dist/components/{email → auth/email}/email-verification.d.ts +0 -0
  262. /package/dist/components/{email → auth/email}/index.d.ts +0 -0
  263. /package/dist/components/{email → auth/email}/index.js +0 -0
  264. /package/dist/components/{email → auth/email}/magic-link.d.ts +0 -0
  265. /package/dist/components/{email → auth/email}/new-device.d.ts +0 -0
  266. /package/dist/components/{email → auth/email}/otp-email.d.ts +0 -0
  267. /package/dist/components/{email → auth/email}/password-changed.d.ts +0 -0
  268. /package/dist/components/{email → auth/email}/reset-password.d.ts +0 -0
  269. /package/src/components/{email → auth/email}/email-localization.tsx +0 -0
  270. /package/src/components/{email → auth/email}/email-styles.tsx +0 -0
  271. /package/src/components/{email → auth/email}/index.ts +0 -0
@@ -1,1269 +0,0 @@
1
- import { AuthClient } from '../../lib/auth-client';
2
- import { UseAuthMutationOptions } from './use-auth-mutation';
3
- /**
4
- * Hook that creates a mutation for email/password sign-up.
5
- *
6
- * The mutation sends an email/password sign-up request and
7
- * refetches the session on success.
8
- *
9
- * @returns The `useMutation` result.
10
- */
11
- export declare function useSignUpEmail(options?: UseAuthMutationOptions<AuthClient["signUp"]["email"]>): import('./use-auth-mutation').UseAuthMutationResult<(<FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
12
- name: string;
13
- email: string;
14
- password: string;
15
- image?: string | undefined;
16
- callbackURL?: string | undefined;
17
- rememberMe?: boolean | undefined;
18
- }> & 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<{
19
- plugins: ({
20
- id: "magic-link";
21
- version: string;
22
- $InferServerPlugin: ReturnType<(options: import('better-auth/plugins/magic-link').MagicLinkOptions) => {
23
- id: "magic-link";
24
- version: string;
25
- endpoints: {
26
- signInMagicLink: import('better-auth').StrictEndpoint<"/sign-in/magic-link", {
27
- method: "POST";
28
- requireHeaders: true;
29
- body: import('zod').ZodObject<{
30
- email: import('zod').ZodEmail;
31
- name: import('zod').ZodOptional<import('zod').ZodString>;
32
- callbackURL: import('zod').ZodOptional<import('zod').ZodString>;
33
- newUserCallbackURL: import('zod').ZodOptional<import('zod').ZodString>;
34
- errorCallbackURL: import('zod').ZodOptional<import('zod').ZodString>;
35
- metadata: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodAny>>;
36
- }, import('zod/v4/core').$strip>;
37
- metadata: {
38
- openapi: {
39
- operationId: string;
40
- description: string;
41
- responses: {
42
- 200: {
43
- description: string;
44
- content: {
45
- "application/json": {
46
- schema: {
47
- type: "object";
48
- properties: {
49
- status: {
50
- type: string;
51
- };
52
- };
53
- };
54
- };
55
- };
56
- };
57
- };
58
- };
59
- };
60
- }, {
61
- status: boolean;
62
- }>;
63
- magicLinkVerify: import('better-auth').StrictEndpoint<"/magic-link/verify", {
64
- method: "GET";
65
- query: import('zod').ZodObject<{
66
- token: import('zod').ZodString;
67
- callbackURL: import('zod').ZodOptional<import('zod').ZodString>;
68
- errorCallbackURL: import('zod').ZodOptional<import('zod').ZodString>;
69
- newUserCallbackURL: import('zod').ZodOptional<import('zod').ZodString>;
70
- }, import('zod/v4/core').$strip>;
71
- use: ((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<void>)[];
72
- requireHeaders: true;
73
- metadata: {
74
- openapi: {
75
- operationId: string;
76
- description: string;
77
- responses: {
78
- 200: {
79
- description: string;
80
- content: {
81
- "application/json": {
82
- schema: {
83
- type: "object";
84
- properties: {
85
- session: {
86
- $ref: string;
87
- };
88
- user: {
89
- $ref: string;
90
- };
91
- };
92
- };
93
- };
94
- };
95
- };
96
- };
97
- };
98
- };
99
- }, {
100
- token: string;
101
- user: {
102
- id: string;
103
- createdAt: Date;
104
- updatedAt: Date;
105
- email: string;
106
- emailVerified: boolean;
107
- name: string;
108
- image?: string | null | undefined;
109
- };
110
- session: {
111
- id: string;
112
- createdAt: Date;
113
- updatedAt: Date;
114
- userId: string;
115
- expiresAt: Date;
116
- token: string;
117
- ipAddress?: string | null | undefined;
118
- userAgent?: string | null | undefined;
119
- };
120
- }>;
121
- };
122
- rateLimit: {
123
- pathMatcher(path: string): boolean;
124
- window: number;
125
- max: number;
126
- }[];
127
- options: import('better-auth/plugins/magic-link').MagicLinkOptions;
128
- }>;
129
- } | {
130
- id: "multi-session";
131
- version: string;
132
- $InferServerPlugin: ReturnType<(options?: import('better-auth/plugins/multi-session').MultiSessionConfig | undefined) => {
133
- id: "multi-session";
134
- version: string;
135
- endpoints: {
136
- listDeviceSessions: import('better-auth').StrictEndpoint<"/multi-session/list-device-sessions", {
137
- method: "GET";
138
- requireHeaders: true;
139
- }, {
140
- session: {
141
- id: string;
142
- createdAt: Date;
143
- updatedAt: Date;
144
- userId: string;
145
- expiresAt: Date;
146
- token: string;
147
- ipAddress?: string | null | undefined;
148
- userAgent?: string | null | undefined;
149
- };
150
- user: {
151
- id: string;
152
- createdAt: Date;
153
- updatedAt: Date;
154
- email: string;
155
- emailVerified: boolean;
156
- name: string;
157
- image?: string | null | undefined;
158
- };
159
- }[]>;
160
- setActiveSession: import('better-auth').StrictEndpoint<"/multi-session/set-active", {
161
- method: "POST";
162
- body: import('zod').ZodObject<{
163
- sessionToken: import('zod').ZodString;
164
- }, import('zod/v4/core').$strip>;
165
- requireHeaders: true;
166
- metadata: {
167
- openapi: {
168
- description: string;
169
- responses: {
170
- 200: {
171
- description: string;
172
- content: {
173
- "application/json": {
174
- schema: {
175
- type: "object";
176
- properties: {
177
- session: {
178
- $ref: string;
179
- };
180
- };
181
- };
182
- };
183
- };
184
- };
185
- };
186
- };
187
- };
188
- }, {
189
- session: {
190
- id: string;
191
- createdAt: Date;
192
- updatedAt: Date;
193
- userId: string;
194
- expiresAt: Date;
195
- token: string;
196
- ipAddress?: string | null | undefined;
197
- userAgent?: string | null | undefined;
198
- } & Record<string, any>;
199
- user: {
200
- id: string;
201
- createdAt: Date;
202
- updatedAt: Date;
203
- email: string;
204
- emailVerified: boolean;
205
- name: string;
206
- image?: string | null | undefined;
207
- } & Record<string, any>;
208
- }>;
209
- revokeDeviceSession: import('better-auth').StrictEndpoint<"/multi-session/revoke", {
210
- method: "POST";
211
- body: import('zod').ZodObject<{
212
- sessionToken: import('zod').ZodString;
213
- }, import('zod/v4/core').$strip>;
214
- requireHeaders: true;
215
- use: ((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<{
216
- session: {
217
- session: Record<string, any> & {
218
- id: string;
219
- createdAt: Date;
220
- updatedAt: Date;
221
- userId: string;
222
- expiresAt: Date;
223
- token: string;
224
- ipAddress?: string | null | undefined;
225
- userAgent?: string | null | undefined;
226
- };
227
- user: Record<string, any> & {
228
- id: string;
229
- createdAt: Date;
230
- updatedAt: Date;
231
- email: string;
232
- emailVerified: boolean;
233
- name: string;
234
- image?: string | null | undefined;
235
- };
236
- };
237
- }>)[];
238
- metadata: {
239
- openapi: {
240
- description: string;
241
- responses: {
242
- 200: {
243
- description: string;
244
- content: {
245
- "application/json": {
246
- schema: {
247
- type: "object";
248
- properties: {
249
- status: {
250
- type: string;
251
- };
252
- };
253
- };
254
- };
255
- };
256
- };
257
- };
258
- };
259
- };
260
- }, {
261
- status: boolean;
262
- }>;
263
- };
264
- hooks: {
265
- after: {
266
- matcher: (context: import('better-auth').HookEndpointContext) => boolean;
267
- handler: (inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<void>;
268
- }[];
269
- };
270
- options: import('better-auth/plugins/multi-session').MultiSessionConfig | undefined;
271
- $ERROR_CODES: {
272
- INVALID_SESSION_TOKEN: import('better-auth').RawError<"INVALID_SESSION_TOKEN">;
273
- };
274
- }>;
275
- atomListeners: {
276
- matcher(path: string): path is "/multi-session/set-active";
277
- signal: "$sessionSignal";
278
- }[];
279
- $ERROR_CODES: {
280
- INVALID_SESSION_TOKEN: import('better-auth').RawError<"INVALID_SESSION_TOKEN">;
281
- };
282
- } | {
283
- id: "passkey";
284
- version: string;
285
- $InferServerPlugin: ReturnType<(options?: import('@better-auth/passkey/client').PasskeyOptions | undefined) => {
286
- id: "passkey";
287
- version: string;
288
- endpoints: {
289
- generatePasskeyRegistrationOptions: import('better-auth').StrictEndpoint<"/passkey/generate-register-options", {
290
- method: "GET";
291
- use: ((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<{
292
- session: {
293
- session: Record<string, any> & {
294
- id: string;
295
- createdAt: Date;
296
- updatedAt: Date;
297
- userId: string;
298
- expiresAt: Date;
299
- token: string;
300
- ipAddress?: string | null | undefined;
301
- userAgent?: string | null | undefined;
302
- };
303
- user: Record<string, any> & {
304
- id: string;
305
- createdAt: Date;
306
- updatedAt: Date;
307
- email: string;
308
- emailVerified: boolean;
309
- name: string;
310
- image?: string | null | undefined;
311
- };
312
- };
313
- }>)[] | undefined;
314
- query: import('zod').ZodOptional<import('zod').ZodObject<{
315
- authenticatorAttachment: import('zod').ZodOptional<import('zod').ZodEnum<{
316
- platform: "platform";
317
- "cross-platform": "cross-platform";
318
- }>>;
319
- name: import('zod').ZodOptional<import('zod').ZodString>;
320
- context: import('zod').ZodOptional<import('zod').ZodString>;
321
- }, import('zod/v4/core').$strip>>;
322
- metadata: {
323
- openapi: {
324
- operationId: string;
325
- description: string;
326
- responses: {
327
- 200: {
328
- description: string;
329
- parameters: {
330
- query: {
331
- authenticatorAttachment: {
332
- description: string;
333
- required: boolean;
334
- };
335
- name: {
336
- description: string;
337
- required: boolean;
338
- };
339
- context: {
340
- description: string;
341
- required: boolean;
342
- };
343
- };
344
- };
345
- content: {
346
- "application/json": {
347
- schema: {
348
- type: "object";
349
- properties: {
350
- challenge: {
351
- type: string;
352
- };
353
- rp: {
354
- type: string;
355
- properties: {
356
- name: {
357
- type: string;
358
- };
359
- id: {
360
- type: string;
361
- };
362
- };
363
- };
364
- user: {
365
- type: string;
366
- properties: {
367
- id: {
368
- type: string;
369
- };
370
- name: {
371
- type: string;
372
- };
373
- displayName: {
374
- type: string;
375
- };
376
- };
377
- };
378
- pubKeyCredParams: {
379
- type: string;
380
- items: {
381
- type: string;
382
- properties: {
383
- type: {
384
- type: string;
385
- };
386
- alg: {
387
- type: string;
388
- };
389
- };
390
- };
391
- };
392
- timeout: {
393
- type: string;
394
- };
395
- excludeCredentials: {
396
- type: string;
397
- items: {
398
- type: string;
399
- properties: {
400
- id: {
401
- type: string;
402
- };
403
- type: {
404
- type: string;
405
- };
406
- transports: {
407
- type: string;
408
- items: {
409
- type: string;
410
- };
411
- };
412
- };
413
- };
414
- };
415
- authenticatorSelection: {
416
- type: string;
417
- properties: {
418
- authenticatorAttachment: {
419
- type: string;
420
- };
421
- requireResidentKey: {
422
- type: string;
423
- };
424
- userVerification: {
425
- type: string;
426
- };
427
- };
428
- };
429
- attestation: {
430
- type: string;
431
- };
432
- extensions: {
433
- type: string;
434
- };
435
- };
436
- };
437
- };
438
- };
439
- };
440
- };
441
- };
442
- };
443
- }, import('@better-auth/passkey/client').PublicKeyCredentialCreationOptionsJSON>;
444
- generatePasskeyAuthenticationOptions: import('better-auth').StrictEndpoint<"/passkey/generate-authenticate-options", {
445
- method: "GET";
446
- metadata: {
447
- openapi: {
448
- operationId: string;
449
- description: string;
450
- responses: {
451
- 200: {
452
- description: string;
453
- content: {
454
- "application/json": {
455
- schema: {
456
- type: "object";
457
- properties: {
458
- challenge: {
459
- type: string;
460
- };
461
- rp: {
462
- type: string;
463
- properties: {
464
- name: {
465
- type: string;
466
- };
467
- id: {
468
- type: string;
469
- };
470
- };
471
- };
472
- user: {
473
- type: string;
474
- properties: {
475
- id: {
476
- type: string;
477
- };
478
- name: {
479
- type: string;
480
- };
481
- displayName: {
482
- type: string;
483
- };
484
- };
485
- };
486
- timeout: {
487
- type: string;
488
- };
489
- allowCredentials: {
490
- type: string;
491
- items: {
492
- type: string;
493
- properties: {
494
- id: {
495
- type: string;
496
- };
497
- type: {
498
- type: string;
499
- };
500
- transports: {
501
- type: string;
502
- items: {
503
- type: string;
504
- };
505
- };
506
- };
507
- };
508
- };
509
- userVerification: {
510
- type: string;
511
- };
512
- authenticatorSelection: {
513
- type: string;
514
- properties: {
515
- authenticatorAttachment: {
516
- type: string;
517
- };
518
- requireResidentKey: {
519
- type: string;
520
- };
521
- userVerification: {
522
- type: string;
523
- };
524
- };
525
- };
526
- extensions: {
527
- type: string;
528
- };
529
- };
530
- };
531
- };
532
- };
533
- };
534
- };
535
- };
536
- };
537
- }, import('@better-auth/passkey/client').PublicKeyCredentialRequestOptionsJSON>;
538
- verifyPasskeyRegistration: import('better-auth').StrictEndpoint<"/passkey/verify-registration", {
539
- method: "POST";
540
- body: import('zod').ZodObject<{
541
- response: import('zod').ZodAny;
542
- name: import('zod').ZodOptional<import('zod').ZodString>;
543
- }, import('zod/v4/core').$strip>;
544
- use: ((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<{
545
- session: {
546
- session: Record<string, any> & {
547
- id: string;
548
- createdAt: Date;
549
- updatedAt: Date;
550
- userId: string;
551
- expiresAt: Date;
552
- token: string;
553
- ipAddress?: string | null | undefined;
554
- userAgent?: string | null | undefined;
555
- };
556
- user: Record<string, any> & {
557
- id: string;
558
- createdAt: Date;
559
- updatedAt: Date;
560
- email: string;
561
- emailVerified: boolean;
562
- name: string;
563
- image?: string | null | undefined;
564
- };
565
- };
566
- }>)[] | undefined;
567
- metadata: {
568
- openapi: {
569
- operationId: string;
570
- description: string;
571
- responses: {
572
- 200: {
573
- description: string;
574
- content: {
575
- "application/json": {
576
- schema: {
577
- $ref: string;
578
- };
579
- };
580
- };
581
- };
582
- 400: {
583
- description: string;
584
- };
585
- };
586
- };
587
- };
588
- }, import('@better-auth/passkey/client').Passkey>;
589
- verifyPasskeyAuthentication: import('better-auth').StrictEndpoint<"/passkey/verify-authentication", {
590
- method: "POST";
591
- body: import('zod').ZodObject<{
592
- response: import('zod').ZodRecord<import('zod').ZodAny, import('zod').ZodAny>;
593
- }, import('zod/v4/core').$strip>;
594
- metadata: {
595
- openapi: {
596
- operationId: string;
597
- description: string;
598
- responses: {
599
- 200: {
600
- description: string;
601
- content: {
602
- "application/json": {
603
- schema: {
604
- type: "object";
605
- properties: {
606
- session: {
607
- $ref: string;
608
- };
609
- user: {
610
- $ref: string;
611
- };
612
- };
613
- };
614
- };
615
- };
616
- };
617
- };
618
- };
619
- $Infer: {
620
- body: {
621
- response: import('@better-auth/passkey/client').AuthenticationResponseJSON;
622
- };
623
- };
624
- };
625
- }, {
626
- session: {
627
- id: string;
628
- createdAt: Date;
629
- updatedAt: Date;
630
- userId: string;
631
- expiresAt: Date;
632
- token: string;
633
- ipAddress?: string | null | undefined;
634
- userAgent?: string | null | undefined;
635
- };
636
- }>;
637
- listPasskeys: import('better-auth').StrictEndpoint<"/passkey/list-user-passkeys", {
638
- method: "GET";
639
- use: ((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<{
640
- session: {
641
- session: Record<string, any> & {
642
- id: string;
643
- createdAt: Date;
644
- updatedAt: Date;
645
- userId: string;
646
- expiresAt: Date;
647
- token: string;
648
- ipAddress?: string | null | undefined;
649
- userAgent?: string | null | undefined;
650
- };
651
- user: Record<string, any> & {
652
- id: string;
653
- createdAt: Date;
654
- updatedAt: Date;
655
- email: string;
656
- emailVerified: boolean;
657
- name: string;
658
- image?: string | null | undefined;
659
- };
660
- };
661
- }>)[];
662
- metadata: {
663
- openapi: {
664
- description: string;
665
- responses: {
666
- "200": {
667
- description: string;
668
- content: {
669
- "application/json": {
670
- schema: {
671
- type: "array";
672
- items: {
673
- $ref: string;
674
- required: string[];
675
- };
676
- description: string;
677
- };
678
- };
679
- };
680
- };
681
- };
682
- };
683
- };
684
- }, import('@better-auth/passkey/client').Passkey[]>;
685
- deletePasskey: import('better-auth').StrictEndpoint<"/passkey/delete-passkey", {
686
- method: "POST";
687
- body: import('zod').ZodObject<{
688
- id: import('zod').ZodString;
689
- }, import('zod/v4/core').$strip>;
690
- use: (((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<{
691
- session: {
692
- session: Record<string, any> & {
693
- id: string;
694
- createdAt: Date;
695
- updatedAt: Date;
696
- userId: string;
697
- expiresAt: Date;
698
- token: string;
699
- ipAddress?: string | null | undefined;
700
- userAgent?: string | null | undefined;
701
- };
702
- user: Record<string, any> & {
703
- id: string;
704
- createdAt: Date;
705
- updatedAt: Date;
706
- email: string;
707
- emailVerified: boolean;
708
- name: string;
709
- image?: string | null | undefined;
710
- };
711
- };
712
- }>) | ((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<{
713
- verifiedResource: {};
714
- }>))[];
715
- metadata: {
716
- openapi: {
717
- description: string;
718
- responses: {
719
- "200": {
720
- description: string;
721
- content: {
722
- "application/json": {
723
- schema: {
724
- type: "object";
725
- properties: {
726
- status: {
727
- type: string;
728
- description: string;
729
- };
730
- };
731
- required: string[];
732
- };
733
- };
734
- };
735
- };
736
- };
737
- };
738
- };
739
- }, {
740
- status: boolean;
741
- }>;
742
- updatePasskey: import('better-auth').StrictEndpoint<"/passkey/update-passkey", {
743
- method: "POST";
744
- body: import('zod').ZodObject<{
745
- id: import('zod').ZodString;
746
- name: import('zod').ZodString;
747
- }, import('zod/v4/core').$strip>;
748
- use: (((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<{
749
- session: {
750
- session: Record<string, any> & {
751
- id: string;
752
- createdAt: Date;
753
- updatedAt: Date;
754
- userId: string;
755
- expiresAt: Date;
756
- token: string;
757
- ipAddress?: string | null | undefined;
758
- userAgent?: string | null | undefined;
759
- };
760
- user: Record<string, any> & {
761
- id: string;
762
- createdAt: Date;
763
- updatedAt: Date;
764
- email: string;
765
- emailVerified: boolean;
766
- name: string;
767
- image?: string | null | undefined;
768
- };
769
- };
770
- }>) | ((inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<{
771
- verifiedResource: {};
772
- }>))[];
773
- metadata: {
774
- openapi: {
775
- description: string;
776
- responses: {
777
- "200": {
778
- description: string;
779
- content: {
780
- "application/json": {
781
- schema: {
782
- type: "object";
783
- properties: {
784
- passkey: {
785
- $ref: string;
786
- };
787
- };
788
- required: string[];
789
- };
790
- };
791
- };
792
- };
793
- };
794
- };
795
- };
796
- }, {
797
- passkey: import('@better-auth/passkey/client').Passkey;
798
- }>;
799
- };
800
- schema: {
801
- passkey: {
802
- fields: {
803
- name: {
804
- type: "string";
805
- required: false;
806
- };
807
- publicKey: {
808
- type: "string";
809
- required: true;
810
- };
811
- userId: {
812
- type: "string";
813
- references: {
814
- model: string;
815
- field: string;
816
- };
817
- required: true;
818
- index: true;
819
- };
820
- credentialID: {
821
- type: "string";
822
- required: true;
823
- index: true;
824
- };
825
- counter: {
826
- type: "number";
827
- required: true;
828
- };
829
- deviceType: {
830
- type: "string";
831
- required: true;
832
- };
833
- backedUp: {
834
- type: "boolean";
835
- required: true;
836
- };
837
- transports: {
838
- type: "string";
839
- required: false;
840
- };
841
- createdAt: {
842
- type: "date";
843
- required: false;
844
- };
845
- aaguid: {
846
- type: "string";
847
- required: false;
848
- };
849
- };
850
- };
851
- };
852
- $ERROR_CODES: {
853
- CHALLENGE_NOT_FOUND: import('better-auth').RawError<"CHALLENGE_NOT_FOUND">;
854
- YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: import('better-auth').RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
855
- FAILED_TO_VERIFY_REGISTRATION: import('better-auth').RawError<"FAILED_TO_VERIFY_REGISTRATION">;
856
- PASSKEY_NOT_FOUND: import('better-auth').RawError<"PASSKEY_NOT_FOUND">;
857
- AUTHENTICATION_FAILED: import('better-auth').RawError<"AUTHENTICATION_FAILED">;
858
- UNABLE_TO_CREATE_SESSION: import('better-auth').RawError<"UNABLE_TO_CREATE_SESSION">;
859
- FAILED_TO_UPDATE_PASSKEY: import('better-auth').RawError<"FAILED_TO_UPDATE_PASSKEY">;
860
- PREVIOUSLY_REGISTERED: import('better-auth').RawError<"PREVIOUSLY_REGISTERED">;
861
- REGISTRATION_CANCELLED: import('better-auth').RawError<"REGISTRATION_CANCELLED">;
862
- AUTH_CANCELLED: import('better-auth').RawError<"AUTH_CANCELLED">;
863
- UNKNOWN_ERROR: import('better-auth').RawError<"UNKNOWN_ERROR">;
864
- SESSION_REQUIRED: import('better-auth').RawError<"SESSION_REQUIRED">;
865
- RESOLVE_USER_REQUIRED: import('better-auth').RawError<"RESOLVE_USER_REQUIRED">;
866
- RESOLVED_USER_INVALID: import('better-auth').RawError<"RESOLVED_USER_INVALID">;
867
- };
868
- options: import('@better-auth/passkey/client').PasskeyOptions | undefined;
869
- }>;
870
- getActions: ($fetch: import('better-auth/client').BetterFetch, $store: import('better-auth').ClientStore) => {
871
- signIn: {
872
- passkey: (opts?: {
873
- autoFill?: boolean;
874
- extensions?: import('@better-auth/passkey/client').AuthenticationExtensionsClientInputs;
875
- returnWebAuthnResponse?: boolean;
876
- fetchOptions?: import('better-auth').ClientFetchOption;
877
- } | undefined, options?: import('better-auth').ClientFetchOption | undefined) => Promise<{
878
- data: null;
879
- error: {
880
- message?: string | undefined;
881
- status: number;
882
- statusText: string;
883
- };
884
- } | {
885
- data: {
886
- session: {
887
- id: string;
888
- createdAt: Date;
889
- updatedAt: Date;
890
- userId: string;
891
- expiresAt: Date;
892
- token: string;
893
- ipAddress?: string | null | undefined;
894
- userAgent?: string | null | undefined;
895
- };
896
- user: {
897
- id: string;
898
- createdAt: Date;
899
- updatedAt: Date;
900
- email: string;
901
- emailVerified: boolean;
902
- name: string;
903
- image?: string | null | undefined;
904
- };
905
- };
906
- error: null;
907
- } | {
908
- webauthn: {
909
- response: import('@better-auth/passkey/client').AuthenticationResponseJSON;
910
- clientExtensionResults: import('@better-auth/passkey/client').AuthenticationExtensionsClientOutputs;
911
- };
912
- data: null;
913
- error: {
914
- message?: string | undefined;
915
- status: number;
916
- statusText: string;
917
- };
918
- } | {
919
- webauthn: {
920
- response: import('@better-auth/passkey/client').AuthenticationResponseJSON;
921
- clientExtensionResults: import('@better-auth/passkey/client').AuthenticationExtensionsClientOutputs;
922
- };
923
- data: {
924
- session: {
925
- id: string;
926
- createdAt: Date;
927
- updatedAt: Date;
928
- userId: string;
929
- expiresAt: Date;
930
- token: string;
931
- ipAddress?: string | null | undefined;
932
- userAgent?: string | null | undefined;
933
- };
934
- user: {
935
- id: string;
936
- createdAt: Date;
937
- updatedAt: Date;
938
- email: string;
939
- emailVerified: boolean;
940
- name: string;
941
- image?: string | null | undefined;
942
- };
943
- };
944
- error: null;
945
- } | {
946
- data: null;
947
- error: {
948
- code: string;
949
- message: string;
950
- status: number;
951
- statusText: string;
952
- };
953
- }>;
954
- };
955
- passkey: {
956
- addPasskey: (opts?: {
957
- fetchOptions?: import('better-auth').ClientFetchOption;
958
- name?: string;
959
- authenticatorAttachment?: "platform" | "cross-platform";
960
- context?: string | null;
961
- extensions?: import('@better-auth/passkey/client').AuthenticationExtensionsClientInputs;
962
- useAutoRegister?: boolean;
963
- returnWebAuthnResponse?: boolean;
964
- } | undefined, fetchOpts?: import('better-auth').ClientFetchOption | undefined) => Promise<{
965
- data: null;
966
- error: {
967
- message?: string | undefined;
968
- status: number;
969
- statusText: string;
970
- };
971
- } | {
972
- data: import('@better-auth/passkey/client').Passkey;
973
- error: null;
974
- } | {
975
- webauthn: {
976
- response: import('@better-auth/passkey/client').RegistrationResponseJSON;
977
- clientExtensionResults: import('@better-auth/passkey/client').AuthenticationExtensionsClientOutputs;
978
- };
979
- data: import('@better-auth/passkey/client').Passkey;
980
- error: null;
981
- } | {
982
- data: null;
983
- error: {
984
- code: string;
985
- message: string;
986
- status: number;
987
- statusText: string;
988
- };
989
- }>;
990
- };
991
- $Infer: {
992
- Passkey: import('@better-auth/passkey/client').Passkey;
993
- };
994
- };
995
- getAtoms($fetch: import('better-auth/client').BetterFetch): {
996
- listPasskeys: import('better-auth/client').AuthQueryAtom<import('@better-auth/passkey/client').Passkey[]>;
997
- $listPasskeys: import('better-auth/client').PreinitializedWritableAtom<any> & object;
998
- };
999
- pathMethods: {
1000
- "/passkey/register": "POST";
1001
- "/passkey/authenticate": "POST";
1002
- };
1003
- atomListeners: ({
1004
- matcher(path: string): path is "/passkey/delete-passkey" | "/passkey/update-passkey" | "/passkey/verify-registration" | "/sign-out";
1005
- signal: "$listPasskeys";
1006
- } | {
1007
- matcher: (path: string) => path is "/passkey/verify-authentication";
1008
- signal: "$sessionSignal";
1009
- })[];
1010
- $ERROR_CODES: {
1011
- CHALLENGE_NOT_FOUND: import('better-auth').RawError<"CHALLENGE_NOT_FOUND">;
1012
- YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: import('better-auth').RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
1013
- FAILED_TO_VERIFY_REGISTRATION: import('better-auth').RawError<"FAILED_TO_VERIFY_REGISTRATION">;
1014
- PASSKEY_NOT_FOUND: import('better-auth').RawError<"PASSKEY_NOT_FOUND">;
1015
- AUTHENTICATION_FAILED: import('better-auth').RawError<"AUTHENTICATION_FAILED">;
1016
- UNABLE_TO_CREATE_SESSION: import('better-auth').RawError<"UNABLE_TO_CREATE_SESSION">;
1017
- FAILED_TO_UPDATE_PASSKEY: import('better-auth').RawError<"FAILED_TO_UPDATE_PASSKEY">;
1018
- PREVIOUSLY_REGISTERED: import('better-auth').RawError<"PREVIOUSLY_REGISTERED">;
1019
- REGISTRATION_CANCELLED: import('better-auth').RawError<"REGISTRATION_CANCELLED">;
1020
- AUTH_CANCELLED: import('better-auth').RawError<"AUTH_CANCELLED">;
1021
- UNKNOWN_ERROR: import('better-auth').RawError<"UNKNOWN_ERROR">;
1022
- SESSION_REQUIRED: import('better-auth').RawError<"SESSION_REQUIRED">;
1023
- RESOLVE_USER_REQUIRED: import('better-auth').RawError<"RESOLVE_USER_REQUIRED">;
1024
- RESOLVED_USER_INVALID: import('better-auth').RawError<"RESOLVED_USER_INVALID">;
1025
- };
1026
- } | {
1027
- id: "username";
1028
- version: string;
1029
- $InferServerPlugin: ReturnType<(options?: import('better-auth/plugins/username').UsernameOptions | undefined) => {
1030
- id: "username";
1031
- version: string;
1032
- init(ctx: import('better-auth').AuthContext): {
1033
- options: {
1034
- databaseHooks: {
1035
- user: {
1036
- create: {
1037
- before(user: {
1038
- id: string;
1039
- createdAt: Date;
1040
- updatedAt: Date;
1041
- email: string;
1042
- emailVerified: boolean;
1043
- name: string;
1044
- image?: string | null | undefined;
1045
- } & Record<string, unknown>, context: import('better-auth').GenericEndpointContext | null): Promise<{
1046
- data: {
1047
- displayUsername?: string | undefined;
1048
- username?: string | undefined;
1049
- id: string;
1050
- createdAt: Date;
1051
- updatedAt: Date;
1052
- email: string;
1053
- emailVerified: boolean;
1054
- name: string;
1055
- image?: string | null | undefined;
1056
- };
1057
- }>;
1058
- };
1059
- update: {
1060
- before(user: Partial<{
1061
- id: string;
1062
- createdAt: Date;
1063
- updatedAt: Date;
1064
- email: string;
1065
- emailVerified: boolean;
1066
- name: string;
1067
- image?: string | null | undefined;
1068
- }> & Record<string, unknown>, context: import('better-auth').GenericEndpointContext | null): Promise<{
1069
- data: {
1070
- displayUsername?: string | undefined;
1071
- username?: string | undefined;
1072
- id?: string | undefined;
1073
- createdAt?: Date | undefined;
1074
- updatedAt?: Date | undefined;
1075
- email?: string | undefined;
1076
- emailVerified?: boolean | undefined;
1077
- name?: string | undefined;
1078
- image?: string | null | undefined;
1079
- };
1080
- }>;
1081
- };
1082
- };
1083
- };
1084
- };
1085
- };
1086
- endpoints: {
1087
- signInUsername: import('better-auth').StrictEndpoint<"/sign-in/username", {
1088
- method: "POST";
1089
- body: import('zod').ZodObject<{
1090
- username: import('zod').ZodString;
1091
- password: import('zod').ZodString;
1092
- rememberMe: import('zod').ZodOptional<import('zod').ZodBoolean>;
1093
- callbackURL: import('zod').ZodOptional<import('zod').ZodString>;
1094
- }, import('zod/v4/core').$strip>;
1095
- metadata: {
1096
- openapi: {
1097
- summary: string;
1098
- description: string;
1099
- responses: {
1100
- 200: {
1101
- description: string;
1102
- content: {
1103
- "application/json": {
1104
- schema: {
1105
- type: "object";
1106
- properties: {
1107
- token: {
1108
- type: string;
1109
- description: string;
1110
- };
1111
- user: {
1112
- $ref: string;
1113
- };
1114
- };
1115
- required: string[];
1116
- };
1117
- };
1118
- };
1119
- };
1120
- 422: {
1121
- description: string;
1122
- content: {
1123
- "application/json": {
1124
- schema: {
1125
- type: "object";
1126
- properties: {
1127
- message: {
1128
- type: string;
1129
- };
1130
- };
1131
- };
1132
- };
1133
- };
1134
- };
1135
- };
1136
- };
1137
- };
1138
- }, {
1139
- token: string;
1140
- user: {
1141
- id: string;
1142
- createdAt: Date;
1143
- updatedAt: Date;
1144
- email: string;
1145
- emailVerified: boolean;
1146
- name: string;
1147
- image?: string | null | undefined;
1148
- } & {
1149
- username: string;
1150
- displayUsername: string;
1151
- };
1152
- }>;
1153
- isUsernameAvailable: import('better-auth').StrictEndpoint<"/is-username-available", {
1154
- method: "POST";
1155
- body: import('zod').ZodObject<{
1156
- username: import('zod').ZodString;
1157
- }, import('zod/v4/core').$strip>;
1158
- }, {
1159
- available: boolean;
1160
- }>;
1161
- };
1162
- schema: {
1163
- user: {
1164
- fields: {
1165
- username: {
1166
- type: "string";
1167
- required: false;
1168
- sortable: true;
1169
- unique: true;
1170
- returned: true;
1171
- transform: {
1172
- input(value: import('better-auth').DBPrimitive): string | number | boolean | Date | Record<string, unknown> | unknown[] | null | undefined;
1173
- };
1174
- };
1175
- displayUsername: {
1176
- type: "string";
1177
- required: false;
1178
- transform: {
1179
- input(value: import('better-auth').DBPrimitive): string | number | boolean | Date | Record<string, unknown> | unknown[] | null | undefined;
1180
- };
1181
- };
1182
- };
1183
- };
1184
- };
1185
- hooks: {
1186
- before: {
1187
- matcher(context: import('better-auth').HookEndpointContext): boolean;
1188
- handler: (inputContext: import('better-auth').MiddlewareInputContext<import('better-auth').MiddlewareOptions>) => Promise<void>;
1189
- }[];
1190
- };
1191
- options: import('better-auth/plugins/username').UsernameOptions | undefined;
1192
- $ERROR_CODES: {
1193
- EMAIL_NOT_VERIFIED: import('better-auth').RawError<"EMAIL_NOT_VERIFIED">;
1194
- UNEXPECTED_ERROR: import('better-auth').RawError<"UNEXPECTED_ERROR">;
1195
- INVALID_USERNAME_OR_PASSWORD: import('better-auth').RawError<"INVALID_USERNAME_OR_PASSWORD">;
1196
- USERNAME_IS_ALREADY_TAKEN: import('better-auth').RawError<"USERNAME_IS_ALREADY_TAKEN">;
1197
- USERNAME_TOO_SHORT: import('better-auth').RawError<"USERNAME_TOO_SHORT">;
1198
- USERNAME_TOO_LONG: import('better-auth').RawError<"USERNAME_TOO_LONG">;
1199
- INVALID_USERNAME: import('better-auth').RawError<"INVALID_USERNAME">;
1200
- INVALID_DISPLAY_USERNAME: import('better-auth').RawError<"INVALID_DISPLAY_USERNAME">;
1201
- };
1202
- }>;
1203
- atomListeners: {
1204
- matcher: (path: string) => path is "/sign-in/username";
1205
- signal: "$sessionSignal";
1206
- }[];
1207
- $ERROR_CODES: {
1208
- EMAIL_NOT_VERIFIED: import('better-auth').RawError<"EMAIL_NOT_VERIFIED">;
1209
- UNEXPECTED_ERROR: import('better-auth').RawError<"UNEXPECTED_ERROR">;
1210
- INVALID_USERNAME_OR_PASSWORD: import('better-auth').RawError<"INVALID_USERNAME_OR_PASSWORD">;
1211
- USERNAME_IS_ALREADY_TAKEN: import('better-auth').RawError<"USERNAME_IS_ALREADY_TAKEN">;
1212
- USERNAME_TOO_SHORT: import('better-auth').RawError<"USERNAME_TOO_SHORT">;
1213
- USERNAME_TOO_LONG: import('better-auth').RawError<"USERNAME_TOO_LONG">;
1214
- INVALID_USERNAME: import('better-auth').RawError<"INVALID_USERNAME">;
1215
- INVALID_DISPLAY_USERNAME: import('better-auth').RawError<"INVALID_DISPLAY_USERNAME">;
1216
- };
1217
- })[];
1218
- }, FetchOptions>>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<(Omit<{
1219
- token: null;
1220
- user: {
1221
- id: string;
1222
- createdAt: Date;
1223
- updatedAt: Date;
1224
- email: string;
1225
- emailVerified: boolean;
1226
- name: string;
1227
- image?: string | null | undefined | undefined;
1228
- };
1229
- }, "user"> & {
1230
- user: import('better-auth').StripEmptyObjects<{
1231
- id: string;
1232
- createdAt: Date;
1233
- updatedAt: Date;
1234
- email: string;
1235
- emailVerified: boolean;
1236
- name: string;
1237
- image?: string | null | undefined;
1238
- } & {} & {
1239
- username?: string | null | undefined;
1240
- displayUsername?: string | null | undefined;
1241
- }>;
1242
- }) | (Omit<{
1243
- token: string;
1244
- user: {
1245
- id: string;
1246
- createdAt: Date;
1247
- updatedAt: Date;
1248
- email: string;
1249
- emailVerified: boolean;
1250
- name: string;
1251
- image?: string | null | undefined | undefined;
1252
- };
1253
- }, "user"> & {
1254
- user: import('better-auth').StripEmptyObjects<{
1255
- id: string;
1256
- createdAt: Date;
1257
- updatedAt: Date;
1258
- email: string;
1259
- emailVerified: boolean;
1260
- name: string;
1261
- image?: string | null | undefined;
1262
- } & {} & {
1263
- username?: string | null | undefined;
1264
- displayUsername?: string | null | undefined;
1265
- }>;
1266
- }), {
1267
- code?: string | undefined;
1268
- message?: string | undefined;
1269
- }, FetchOptions["throw"] extends true ? true : false>>)>;