@better-auth-ui/react 1.6.2 → 1.6.3

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