@xk2800/nextjs-template 0.6.1-beta.1 → 0.6.1-beta.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 (67) hide show
  1. package/components/auth/forgotPasswordForm.tsx +1 -1
  2. package/components/dashboard/twoFactorCard.tsx +2 -1
  3. package/dist/activity/logger.js +5 -1
  4. package/dist/activity/logger.js.map +1 -1
  5. package/dist/activity/logger.mjs +3 -3
  6. package/dist/activity/queries.d.mts +1 -1
  7. package/dist/activity/queries.d.ts +1 -1
  8. package/dist/activity/queries.js +5 -1
  9. package/dist/activity/queries.js.map +1 -1
  10. package/dist/activity/queries.mjs +2 -2
  11. package/dist/admin/queries.js +5 -1
  12. package/dist/admin/queries.js.map +1 -1
  13. package/dist/admin/queries.mjs +2 -2
  14. package/dist/auth/helpers.d.mts +15 -0
  15. package/dist/auth/helpers.d.ts +15 -0
  16. package/dist/auth/helpers.js +10 -4
  17. package/dist/auth/helpers.js.map +1 -1
  18. package/dist/auth/helpers.mjs +5 -5
  19. package/dist/auth/index.d.mts +291 -241
  20. package/dist/auth/index.d.ts +291 -241
  21. package/dist/auth/index.js +10 -4
  22. package/dist/auth/index.js.map +1 -1
  23. package/dist/auth/index.mjs +5 -5
  24. package/dist/auth-client/index.d.mts +2844 -71
  25. package/dist/auth-client/index.d.ts +2844 -71
  26. package/dist/auth-client/index.js +1 -8
  27. package/dist/auth-client/index.js.map +1 -1
  28. package/dist/auth-client/index.mjs +1 -8
  29. package/dist/auth-client/index.mjs.map +1 -1
  30. package/dist/{chunk-LPL6U5RD.mjs → chunk-4B7MJOLH.mjs} +7 -3
  31. package/dist/chunk-4B7MJOLH.mjs.map +1 -0
  32. package/dist/{chunk-FJAZNE3I.mjs → chunk-5PYDAD4P.mjs} +3 -3
  33. package/dist/{chunk-FJAZNE3I.mjs.map → chunk-5PYDAD4P.mjs.map} +1 -1
  34. package/dist/{chunk-AGUEAXPN.mjs → chunk-IF3JZRSZ.mjs} +4 -4
  35. package/dist/{chunk-AGUEAXPN.mjs.map → chunk-IF3JZRSZ.mjs.map} +1 -1
  36. package/dist/{chunk-B4FKFE7P.mjs → chunk-OHAUKE2Q.mjs} +4 -4
  37. package/dist/{chunk-B4FKFE7P.mjs.map → chunk-OHAUKE2Q.mjs.map} +1 -1
  38. package/dist/{chunk-ZGAODGU3.mjs → chunk-V72CFFU2.mjs} +12 -10
  39. package/dist/chunk-V72CFFU2.mjs.map +1 -0
  40. package/dist/db/index.d.mts +1 -1
  41. package/dist/db/index.d.ts +1 -1
  42. package/dist/db/index.js +5 -1
  43. package/dist/db/index.js.map +1 -1
  44. package/dist/db/index.mjs +2 -2
  45. package/dist/db/schema.d.mts +1 -1
  46. package/dist/db/schema.d.ts +1 -1
  47. package/dist/db/schema.js +5 -1
  48. package/dist/db/schema.js.map +1 -1
  49. package/dist/db/schema.mjs +1 -1
  50. package/dist/{schema-c2sve45Z.d.mts → schema-BghJ8N4X.d.mts} +52 -1
  51. package/dist/{schema-c2sve45Z.d.ts → schema-BghJ8N4X.d.ts} +52 -1
  52. package/dist/sessions/queries.js +5 -1
  53. package/dist/sessions/queries.js.map +1 -1
  54. package/dist/sessions/queries.mjs +2 -2
  55. package/dist/settings/queries.d.mts +1 -1
  56. package/dist/settings/queries.d.ts +1 -1
  57. package/dist/settings/queries.js +5 -1
  58. package/dist/settings/queries.js.map +1 -1
  59. package/dist/settings/queries.mjs +3 -3
  60. package/dist/users/queries.js +5 -1
  61. package/dist/users/queries.js.map +1 -1
  62. package/dist/users/queries.mjs +2 -2
  63. package/hooks/use-dimensions.ts +31 -0
  64. package/lib/auth-client.ts +2 -21
  65. package/package.json +5 -4
  66. package/dist/chunk-LPL6U5RD.mjs.map +0 -1
  67. package/dist/chunk-ZGAODGU3.mjs.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import * as better_auth_react from 'better-auth/react';
2
+ import * as better_auth_client_plugins from 'better-auth/client/plugins';
2
3
  import * as nanostores from 'nanostores';
3
4
  import * as better_auth_client from 'better-auth/client';
4
- import { BetterAuthClientPlugin } from 'better-auth/client';
5
5
  import * as _simplewebauthn_server from '@simplewebauthn/server';
6
6
  import * as _better_auth_passkey from '@better-auth/passkey';
7
7
  import * as _better_fetch_fetch from '@better-fetch/fetch';
@@ -10,12 +10,10 @@ import * as zod from 'zod';
10
10
  import * as better_auth_plugins from 'better-auth/plugins';
11
11
  import * as better_call from 'better-call';
12
12
  import * as better_auth from 'better-auth';
13
- import { oneTapClient } from 'better-auth/client/plugins';
14
13
 
15
- type OneTapActions = ReturnType<ReturnType<typeof oneTapClient>["getActions"]>;
16
- declare const baseAuthClient: better_auth_react.ReactAuthClient<{
14
+ declare const authClient: better_auth_react.ReactAuthClient<{
17
15
  baseURL: string | undefined;
18
- plugins: (BetterAuthClientPlugin | {
16
+ plugins: ({
19
17
  id: "admin-client";
20
18
  version: string;
21
19
  $InferServerPlugin: {
@@ -68,7 +66,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
68
66
  hooks: {
69
67
  after: {
70
68
  matcher(context: better_auth.HookEndpointContext): boolean;
71
- handler: (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<better_auth_plugins.SessionWithImpersonatedBy[] | undefined>;
69
+ handler: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<better_auth_plugins.SessionWithImpersonatedBy[] | undefined>>;
72
70
  }[];
73
71
  };
74
72
  endpoints: {
@@ -79,7 +77,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
79
77
  role: zod.ZodUnion<readonly [zod.ZodString, zod.ZodArray<zod.ZodString>]>;
80
78
  }, zod_v4_core.$strip>;
81
79
  requireHeaders: true;
82
- use: ((inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
80
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
83
81
  session: {
84
82
  user: better_auth_plugins.UserWithRole;
85
83
  session: {
@@ -93,7 +91,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
93
91
  userAgent?: string | null | undefined;
94
92
  };
95
93
  };
96
- }>)[];
94
+ }>>[];
97
95
  metadata: {
98
96
  openapi: {
99
97
  operationId: string;
@@ -132,7 +130,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
132
130
  query: zod.ZodObject<{
133
131
  id: zod.ZodString;
134
132
  }, zod_v4_core.$strip>;
135
- use: ((inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
133
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
136
134
  session: {
137
135
  user: better_auth_plugins.UserWithRole;
138
136
  session: {
@@ -146,7 +144,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
146
144
  userAgent?: string | null | undefined;
147
145
  };
148
146
  };
149
- }>)[];
147
+ }>>[];
150
148
  metadata: {
151
149
  openapi: {
152
150
  operationId: string;
@@ -223,7 +221,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
223
221
  userId: zod.ZodCoercedString<unknown>;
224
222
  data: zod.ZodRecord<zod.ZodAny, zod.ZodAny>;
225
223
  }, zod_v4_core.$strip>;
226
- use: ((inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
224
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
227
225
  session: {
228
226
  user: better_auth_plugins.UserWithRole;
229
227
  session: {
@@ -237,7 +235,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
237
235
  userAgent?: string | null | undefined;
238
236
  };
239
237
  };
240
- }>)[];
238
+ }>>[];
241
239
  metadata: {
242
240
  openapi: {
243
241
  operationId: string;
@@ -265,7 +263,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
265
263
  }, better_auth_plugins.UserWithRole>;
266
264
  listUsers: better_call.StrictEndpoint<"/admin/list-users", {
267
265
  method: "GET";
268
- use: ((inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
266
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
269
267
  session: {
270
268
  user: better_auth_plugins.UserWithRole;
271
269
  session: {
@@ -279,7 +277,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
279
277
  userAgent?: string | null | undefined;
280
278
  };
281
279
  };
282
- }>)[];
280
+ }>>[];
283
281
  query: zod.ZodObject<{
284
282
  searchValue: zod.ZodOptional<zod.ZodString>;
285
283
  searchField: zod.ZodOptional<zod.ZodEnum<{
@@ -301,13 +299,13 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
301
299
  filterField: zod.ZodOptional<zod.ZodString>;
302
300
  filterValue: zod.ZodOptional<zod.ZodUnion<[zod.ZodUnion<[zod.ZodUnion<[zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, zod.ZodBoolean]>, zod.ZodArray<zod.ZodString>]>, zod.ZodArray<zod.ZodNumber>]>>;
303
301
  filterOperator: zod.ZodOptional<zod.ZodEnum<{
302
+ in: "in";
303
+ lte: "lte";
304
304
  eq: "eq";
305
305
  ne: "ne";
306
+ lt: "lt";
306
307
  gt: "gt";
307
308
  gte: "gte";
308
- lt: "lt";
309
- lte: "lte";
310
- in: "in";
311
309
  not_in: "not_in";
312
310
  contains: "contains";
313
311
  starts_with: "starts_with";
@@ -357,7 +355,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
357
355
  }>;
358
356
  listUserSessions: better_call.StrictEndpoint<"/admin/list-user-sessions", {
359
357
  method: "POST";
360
- use: ((inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
358
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
361
359
  session: {
362
360
  user: better_auth_plugins.UserWithRole;
363
361
  session: {
@@ -371,7 +369,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
371
369
  userAgent?: string | null | undefined;
372
370
  };
373
371
  };
374
- }>)[];
372
+ }>>[];
375
373
  body: zod.ZodObject<{
376
374
  userId: zod.ZodCoercedString<unknown>;
377
375
  }, zod_v4_core.$strip>;
@@ -410,7 +408,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
410
408
  body: zod.ZodObject<{
411
409
  userId: zod.ZodCoercedString<unknown>;
412
410
  }, zod_v4_core.$strip>;
413
- use: ((inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
411
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
414
412
  session: {
415
413
  user: better_auth_plugins.UserWithRole;
416
414
  session: {
@@ -424,7 +422,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
424
422
  userAgent?: string | null | undefined;
425
423
  };
426
424
  };
427
- }>)[];
425
+ }>>[];
428
426
  metadata: {
429
427
  openapi: {
430
428
  operationId: string;
@@ -459,7 +457,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
459
457
  banReason: zod.ZodOptional<zod.ZodString>;
460
458
  banExpiresIn: zod.ZodOptional<zod.ZodNumber>;
461
459
  }, zod_v4_core.$strip>;
462
- use: ((inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
460
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
463
461
  session: {
464
462
  user: better_auth_plugins.UserWithRole;
465
463
  session: {
@@ -473,7 +471,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
473
471
  userAgent?: string | null | undefined;
474
472
  };
475
473
  };
476
- }>)[];
474
+ }>>[];
477
475
  metadata: {
478
476
  openapi: {
479
477
  operationId: string;
@@ -506,7 +504,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
506
504
  body: zod.ZodObject<{
507
505
  userId: zod.ZodCoercedString<unknown>;
508
506
  }, zod_v4_core.$strip>;
509
- use: ((inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
507
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
510
508
  session: {
511
509
  user: better_auth_plugins.UserWithRole;
512
510
  session: {
@@ -520,7 +518,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
520
518
  userAgent?: string | null | undefined;
521
519
  };
522
520
  };
523
- }>)[];
521
+ }>>[];
524
522
  metadata: {
525
523
  openapi: {
526
524
  operationId: string;
@@ -590,7 +588,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
590
588
  body: zod.ZodObject<{
591
589
  sessionToken: zod.ZodString;
592
590
  }, zod_v4_core.$strip>;
593
- use: ((inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
591
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
594
592
  session: {
595
593
  user: better_auth_plugins.UserWithRole;
596
594
  session: {
@@ -604,7 +602,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
604
602
  userAgent?: string | null | undefined;
605
603
  };
606
604
  };
607
- }>)[];
605
+ }>>[];
608
606
  metadata: {
609
607
  openapi: {
610
608
  operationId: string;
@@ -637,7 +635,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
637
635
  body: zod.ZodObject<{
638
636
  userId: zod.ZodCoercedString<unknown>;
639
637
  }, zod_v4_core.$strip>;
640
- use: ((inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
638
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
641
639
  session: {
642
640
  user: better_auth_plugins.UserWithRole;
643
641
  session: {
@@ -651,7 +649,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
651
649
  userAgent?: string | null | undefined;
652
650
  };
653
651
  };
654
- }>)[];
652
+ }>>[];
655
653
  metadata: {
656
654
  openapi: {
657
655
  operationId: string;
@@ -684,7 +682,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
684
682
  body: zod.ZodObject<{
685
683
  userId: zod.ZodCoercedString<unknown>;
686
684
  }, zod_v4_core.$strip>;
687
- use: ((inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
685
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
688
686
  session: {
689
687
  user: better_auth_plugins.UserWithRole;
690
688
  session: {
@@ -698,7 +696,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
698
696
  userAgent?: string | null | undefined;
699
697
  };
700
698
  };
701
- }>)[];
699
+ }>>[];
702
700
  metadata: {
703
701
  openapi: {
704
702
  operationId: string;
@@ -732,7 +730,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
732
730
  newPassword: zod.ZodString;
733
731
  userId: zod.ZodCoercedString<unknown>;
734
732
  }, zod_v4_core.$strip>;
735
- use: ((inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
733
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
736
734
  session: {
737
735
  user: better_auth_plugins.UserWithRole;
738
736
  session: {
@@ -746,7 +744,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
746
744
  userAgent?: string | null | undefined;
747
745
  };
748
746
  };
749
- }>)[];
747
+ }>>[];
750
748
  metadata: {
751
749
  openapi: {
752
750
  operationId: string;
@@ -971,12 +969,20 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
971
969
  method: "POST";
972
970
  body: zod.ZodObject<{
973
971
  password: zod.ZodOptional<zod.ZodString>;
972
+ method: zod.ZodDefault<zod.ZodEnum<{
973
+ otp: "otp";
974
+ totp: "totp";
975
+ }>>;
974
976
  issuer: zod.ZodOptional<zod.ZodString>;
975
977
  }, zod_v4_core.$strip> | zod.ZodObject<{
976
978
  password: zod.ZodString;
979
+ method: zod.ZodDefault<zod.ZodEnum<{
980
+ otp: "otp";
981
+ totp: "totp";
982
+ }>>;
977
983
  issuer: zod.ZodOptional<zod.ZodString>;
978
984
  }, zod_v4_core.$strip>;
979
- use: ((inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
985
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
980
986
  session: {
981
987
  session: Record<string, any> & {
982
988
  id: string;
@@ -998,7 +1004,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
998
1004
  image?: string | null | undefined;
999
1005
  };
1000
1006
  };
1001
- }>)[];
1007
+ }>>[];
1002
1008
  metadata: {
1003
1009
  openapi: {
1004
1010
  summary: string;
@@ -1011,6 +1017,11 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
1011
1017
  schema: {
1012
1018
  type: "object";
1013
1019
  properties: {
1020
+ method: {
1021
+ type: string;
1022
+ enum: string[];
1023
+ description: string;
1024
+ };
1014
1025
  totpURI: {
1015
1026
  type: string;
1016
1027
  description: string;
@@ -1023,6 +1034,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
1023
1034
  description: string;
1024
1035
  };
1025
1036
  };
1037
+ required: string[];
1026
1038
  };
1027
1039
  };
1028
1040
  };
@@ -1031,6 +1043,9 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
1031
1043
  };
1032
1044
  };
1033
1045
  }, {
1046
+ method: "otp";
1047
+ } | {
1048
+ method: "totp";
1034
1049
  totpURI: string;
1035
1050
  backupCodes: string[];
1036
1051
  }>;
@@ -1041,7 +1056,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
1041
1056
  }, zod_v4_core.$strip> | zod.ZodObject<{
1042
1057
  password: zod.ZodString;
1043
1058
  }, zod_v4_core.$strip>;
1044
- use: ((inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
1059
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
1045
1060
  session: {
1046
1061
  session: Record<string, any> & {
1047
1062
  id: string;
@@ -1063,7 +1078,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
1063
1078
  image?: string | null | undefined;
1064
1079
  };
1065
1080
  };
1066
- }>)[];
1081
+ }>>[];
1067
1082
  metadata: {
1068
1083
  openapi: {
1069
1084
  summary: string;
@@ -1208,7 +1223,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
1208
1223
  }, zod_v4_core.$strip> | zod.ZodObject<{
1209
1224
  password: zod.ZodString;
1210
1225
  }, zod_v4_core.$strip>;
1211
- use: ((inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
1226
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
1212
1227
  session: {
1213
1228
  session: Record<string, any> & {
1214
1229
  id: string;
@@ -1230,7 +1245,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
1230
1245
  image?: string | null | undefined;
1231
1246
  };
1232
1247
  };
1233
- }>)[];
1248
+ }>>[];
1234
1249
  metadata: {
1235
1250
  openapi: {
1236
1251
  description: string;
@@ -1429,7 +1444,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
1429
1444
  }>;
1430
1445
  getTOTPURI: better_call.StrictEndpoint<"/two-factor/get-totp-uri", {
1431
1446
  method: "POST";
1432
- use: ((inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
1447
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
1433
1448
  session: {
1434
1449
  session: Record<string, any> & {
1435
1450
  id: string;
@@ -1451,7 +1466,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
1451
1466
  image?: string | null | undefined;
1452
1467
  };
1453
1468
  };
1454
- }>)[];
1469
+ }>>[];
1455
1470
  body: zod.ZodObject<{
1456
1471
  password: zod.ZodOptional<zod.ZodString>;
1457
1472
  }, zod_v4_core.$strip> | zod.ZodObject<{
@@ -1532,10 +1547,10 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
1532
1547
  hooks: {
1533
1548
  after: {
1534
1549
  matcher(context: better_auth.HookEndpointContext): boolean;
1535
- handler: (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
1550
+ handler: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
1536
1551
  twoFactorRedirect: boolean;
1537
1552
  twoFactorMethods: string[];
1538
- } | undefined>;
1553
+ } | undefined>>;
1539
1554
  }[];
1540
1555
  };
1541
1556
  schema: {
@@ -1601,8 +1616,11 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
1601
1616
  }[];
1602
1617
  $ERROR_CODES: {
1603
1618
  OTP_NOT_ENABLED: better_auth.RawError<"OTP_NOT_ENABLED">;
1619
+ OTP_NOT_CONFIGURED: better_auth.RawError<"OTP_NOT_CONFIGURED">;
1604
1620
  OTP_HAS_EXPIRED: better_auth.RawError<"OTP_HAS_EXPIRED">;
1605
1621
  TOTP_NOT_ENABLED: better_auth.RawError<"TOTP_NOT_ENABLED">;
1622
+ TOTP_ALREADY_ENABLED: better_auth.RawError<"TOTP_ALREADY_ENABLED">;
1623
+ TOTP_NOT_CONFIGURED: better_auth.RawError<"TOTP_NOT_CONFIGURED">;
1606
1624
  TWO_FACTOR_NOT_ENABLED: better_auth.RawError<"TWO_FACTOR_NOT_ENABLED">;
1607
1625
  BACKUP_CODES_NOT_ENABLED: better_auth.RawError<"BACKUP_CODES_NOT_ENABLED">;
1608
1626
  INVALID_BACKUP_CODE: better_auth.RawError<"INVALID_BACKUP_CODE">;
@@ -1635,8 +1653,11 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
1635
1653
  }[];
1636
1654
  $ERROR_CODES: {
1637
1655
  OTP_NOT_ENABLED: better_auth.RawError<"OTP_NOT_ENABLED">;
1656
+ OTP_NOT_CONFIGURED: better_auth.RawError<"OTP_NOT_CONFIGURED">;
1638
1657
  OTP_HAS_EXPIRED: better_auth.RawError<"OTP_HAS_EXPIRED">;
1639
1658
  TOTP_NOT_ENABLED: better_auth.RawError<"TOTP_NOT_ENABLED">;
1659
+ TOTP_ALREADY_ENABLED: better_auth.RawError<"TOTP_ALREADY_ENABLED">;
1660
+ TOTP_NOT_CONFIGURED: better_auth.RawError<"TOTP_NOT_CONFIGURED">;
1640
1661
  TWO_FACTOR_NOT_ENABLED: better_auth.RawError<"TWO_FACTOR_NOT_ENABLED">;
1641
1662
  BACKUP_CODES_NOT_ENABLED: better_auth.RawError<"BACKUP_CODES_NOT_ENABLED">;
1642
1663
  INVALID_BACKUP_CODE: better_auth.RawError<"INVALID_BACKUP_CODE">;
@@ -1654,7 +1675,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
1654
1675
  endpoints: {
1655
1676
  generatePasskeyRegistrationOptions: better_call.StrictEndpoint<"/passkey/generate-register-options", {
1656
1677
  method: "GET";
1657
- use: ((inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
1678
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
1658
1679
  session: {
1659
1680
  session: Record<string, any> & {
1660
1681
  id: string;
@@ -1676,7 +1697,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
1676
1697
  image?: string | null | undefined;
1677
1698
  };
1678
1699
  };
1679
- }>)[];
1700
+ }>>[];
1680
1701
  query: zod.ZodOptional<zod.ZodObject<{
1681
1702
  authenticatorAttachment: zod.ZodOptional<zod.ZodEnum<{
1682
1703
  platform: "platform";
@@ -1689,15 +1710,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
1689
1710
  openapi: {
1690
1711
  operationId: string;
1691
1712
  description: string;
1692
- parameters: {
1693
- name: string;
1694
- in: "query";
1695
- required: false;
1696
- description: string;
1697
- schema: {
1698
- type: "string";
1699
- };
1700
- }[];
1713
+ parameters: better_call.OpenAPIParameter[];
1701
1714
  responses: {
1702
1715
  200: {
1703
1716
  description: string;
@@ -1899,8 +1912,9 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
1899
1912
  body: zod.ZodObject<{
1900
1913
  response: zod.ZodAny;
1901
1914
  name: zod.ZodOptional<zod.ZodString>;
1915
+ createSession: zod.ZodOptional<zod.ZodBoolean>;
1902
1916
  }, zod_v4_core.$strip>;
1903
- use: ((inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
1917
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
1904
1918
  session: {
1905
1919
  session: Record<string, any> & {
1906
1920
  id: string;
@@ -1922,7 +1936,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
1922
1936
  image?: string | null | undefined;
1923
1937
  };
1924
1938
  };
1925
- }>)[];
1939
+ }>>[];
1926
1940
  metadata: {
1927
1941
  openapi: {
1928
1942
  operationId: string;
@@ -1933,7 +1947,20 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
1933
1947
  content: {
1934
1948
  "application/json": {
1935
1949
  schema: {
1936
- $ref: string;
1950
+ readonly type: "object";
1951
+ readonly allOf: readonly [{
1952
+ readonly $ref: "#/components/schemas/Passkey";
1953
+ }, {
1954
+ readonly type: "object";
1955
+ readonly properties: {
1956
+ readonly session: {
1957
+ readonly $ref: "#/components/schemas/Session";
1958
+ };
1959
+ readonly user: {
1960
+ readonly $ref: "#/components/schemas/User";
1961
+ };
1962
+ };
1963
+ }];
1937
1964
  };
1938
1965
  };
1939
1966
  };
@@ -2004,7 +2031,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
2004
2031
  }>;
2005
2032
  listPasskeys: better_call.StrictEndpoint<"/passkey/list-user-passkeys", {
2006
2033
  method: "GET";
2007
- use: ((inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
2034
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
2008
2035
  session: {
2009
2036
  session: Record<string, any> & {
2010
2037
  id: string;
@@ -2026,7 +2053,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
2026
2053
  image?: string | null | undefined;
2027
2054
  };
2028
2055
  };
2029
- }>)[];
2056
+ }>>[];
2030
2057
  metadata: {
2031
2058
  openapi: {
2032
2059
  description: string;
@@ -2055,7 +2082,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
2055
2082
  body: zod.ZodObject<{
2056
2083
  id: zod.ZodString;
2057
2084
  }, zod_v4_core.$strip>;
2058
- use: (((inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
2085
+ use: (better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
2059
2086
  session: {
2060
2087
  session: Record<string, any> & {
2061
2088
  id: string;
@@ -2077,9 +2104,9 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
2077
2104
  image?: string | null | undefined;
2078
2105
  };
2079
2106
  };
2080
- }>) | ((inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
2107
+ }>> | better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
2081
2108
  verifiedResource: {};
2082
- }>))[];
2109
+ }>>)[];
2083
2110
  metadata: {
2084
2111
  openapi: {
2085
2112
  description: string;
@@ -2113,7 +2140,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
2113
2140
  id: zod.ZodString;
2114
2141
  name: zod.ZodString;
2115
2142
  }, zod_v4_core.$strip>;
2116
- use: (((inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
2143
+ use: (better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
2117
2144
  session: {
2118
2145
  session: Record<string, any> & {
2119
2146
  id: string;
@@ -2135,9 +2162,9 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
2135
2162
  image?: string | null | undefined;
2136
2163
  };
2137
2164
  };
2138
- }>) | ((inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
2165
+ }>> | better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
2139
2166
  verifiedResource: {};
2140
- }>))[];
2167
+ }>>)[];
2141
2168
  metadata: {
2142
2169
  openapi: {
2143
2170
  description: string;
@@ -2224,6 +2251,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
2224
2251
  PASSKEY_NOT_FOUND: better_auth.RawError<"PASSKEY_NOT_FOUND">;
2225
2252
  AUTHENTICATION_FAILED: better_auth.RawError<"AUTHENTICATION_FAILED">;
2226
2253
  UNABLE_TO_CREATE_SESSION: better_auth.RawError<"UNABLE_TO_CREATE_SESSION">;
2254
+ USER_NOT_FOUND: better_auth.RawError<"USER_NOT_FOUND">;
2227
2255
  FAILED_TO_UPDATE_PASSKEY: better_auth.RawError<"FAILED_TO_UPDATE_PASSKEY">;
2228
2256
  PREVIOUSLY_REGISTERED: better_auth.RawError<"PREVIOUSLY_REGISTERED">;
2229
2257
  REGISTRATION_CANCELLED: better_auth.RawError<"REGISTRATION_CANCELLED">;
@@ -2292,6 +2320,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
2292
2320
  name?: string;
2293
2321
  authenticatorAttachment?: "platform" | "cross-platform";
2294
2322
  context?: string | null;
2323
+ createSession?: boolean;
2295
2324
  extensions?: _simplewebauthn_server.AuthenticationExtensionsClientInputs;
2296
2325
  useAutoRegister?: boolean;
2297
2326
  returnWebAuthnResponse?: boolean;
@@ -2303,14 +2332,20 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
2303
2332
  statusText: string;
2304
2333
  };
2305
2334
  } | {
2306
- data: _better_auth_passkey.Passkey;
2335
+ data: _better_auth_passkey.Passkey & {
2336
+ session?: better_auth.Session;
2337
+ user?: better_auth.User;
2338
+ };
2307
2339
  error: null;
2308
2340
  } | {
2309
2341
  webauthn: {
2310
2342
  response: _simplewebauthn_server.RegistrationResponseJSON;
2311
2343
  clientExtensionResults: _simplewebauthn_server.AuthenticationExtensionsClientOutputs;
2312
2344
  };
2313
- data: _better_auth_passkey.Passkey;
2345
+ data: _better_auth_passkey.Passkey & {
2346
+ session?: better_auth.Session;
2347
+ user?: better_auth.User;
2348
+ };
2314
2349
  error: null;
2315
2350
  } | {
2316
2351
  data: null;
@@ -2348,6 +2383,7 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
2348
2383
  PASSKEY_NOT_FOUND: better_auth.RawError<"PASSKEY_NOT_FOUND">;
2349
2384
  AUTHENTICATION_FAILED: better_auth.RawError<"AUTHENTICATION_FAILED">;
2350
2385
  UNABLE_TO_CREATE_SESSION: better_auth.RawError<"UNABLE_TO_CREATE_SESSION">;
2386
+ USER_NOT_FOUND: better_auth.RawError<"USER_NOT_FOUND">;
2351
2387
  FAILED_TO_UPDATE_PASSKEY: better_auth.RawError<"FAILED_TO_UPDATE_PASSKEY">;
2352
2388
  PREVIOUSLY_REGISTERED: better_auth.RawError<"PREVIOUSLY_REGISTERED">;
2353
2389
  REGISTRATION_CANCELLED: better_auth.RawError<"REGISTRATION_CANCELLED">;
@@ -2357,11 +2393,54 @@ declare const baseAuthClient: better_auth_react.ReactAuthClient<{
2357
2393
  RESOLVE_USER_REQUIRED: better_auth.RawError<"RESOLVE_USER_REQUIRED">;
2358
2394
  RESOLVED_USER_INVALID: better_auth.RawError<"RESOLVED_USER_INVALID">;
2359
2395
  };
2396
+ } | {
2397
+ id: "one-tap";
2398
+ version: string;
2399
+ fetchPlugins: {
2400
+ id: string;
2401
+ name: string;
2402
+ hooks: {
2403
+ onResponse(ctx: _better_fetch_fetch.ResponseContext): Promise<void>;
2404
+ };
2405
+ }[];
2406
+ getActions: ($fetch: _better_fetch_fetch.BetterFetch, _$store: better_auth.ClientStore, _options: better_auth.BetterAuthClientOptions | undefined) => {
2407
+ oneTap: (opts?: better_auth_client_plugins.GoogleOneTapActionOptions | undefined, fetchOptions?: better_auth.ClientFetchOption | undefined) => Promise<void>;
2408
+ };
2409
+ getAtoms($fetch: _better_fetch_fetch.BetterFetch): {};
2360
2410
  })[];
2361
2411
  }>;
2362
- declare const authClient: typeof baseAuthClient & OneTapActions;
2363
2412
  declare const useSession: () => {
2364
- data: never;
2413
+ data: {
2414
+ user: better_auth.StripEmptyObjects<{
2415
+ id: string;
2416
+ createdAt: Date;
2417
+ updatedAt: Date;
2418
+ email: string;
2419
+ emailVerified: boolean;
2420
+ name: string;
2421
+ image?: string | null | undefined;
2422
+ } & {
2423
+ banned: boolean | null | undefined;
2424
+ } & {
2425
+ role?: string | null | undefined;
2426
+ banReason?: string | null | undefined;
2427
+ banExpires?: Date | null | undefined;
2428
+ } & {
2429
+ twoFactorEnabled: boolean | null | undefined;
2430
+ } & {}>;
2431
+ session: better_auth.StripEmptyObjects<{
2432
+ id: string;
2433
+ createdAt: Date;
2434
+ updatedAt: Date;
2435
+ userId: string;
2436
+ expiresAt: Date;
2437
+ token: string;
2438
+ ipAddress?: string | null | undefined;
2439
+ userAgent?: string | null | undefined;
2440
+ } & {} & {
2441
+ impersonatedBy?: string | null | undefined;
2442
+ }>;
2443
+ } | null;
2365
2444
  isPending: boolean;
2366
2445
  isRefetching: boolean;
2367
2446
  error: _better_fetch_fetch.BetterFetchError | null;
@@ -2370,6 +2449,148 @@ declare const useSession: () => {
2370
2449
  } | undefined) => Promise<void>;
2371
2450
  };
2372
2451
  declare const signIn: {
2452
+ social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2453
+ provider: (string & {}) | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
2454
+ callbackURL?: string | undefined;
2455
+ newUserCallbackURL?: string | undefined;
2456
+ errorCallbackURL?: string | undefined;
2457
+ disableRedirect?: boolean | undefined;
2458
+ idToken?: {
2459
+ token: string;
2460
+ nonce?: string | undefined;
2461
+ accessToken?: string | undefined;
2462
+ refreshToken?: string | undefined;
2463
+ expiresAt?: number | undefined;
2464
+ user?: {
2465
+ name?: {
2466
+ firstName?: string | undefined;
2467
+ lastName?: string | undefined;
2468
+ } | undefined;
2469
+ email?: string | undefined;
2470
+ } | undefined;
2471
+ } | undefined;
2472
+ scopes?: string[] | undefined;
2473
+ requestSignUp?: boolean | undefined;
2474
+ loginHint?: string | undefined;
2475
+ additionalParams?: Record<string, string> | undefined;
2476
+ additionalData?: Record<string, any> | undefined;
2477
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, string | undefined> | undefined>>(data_0: better_auth.Prettify<Omit<{
2478
+ provider: (string & {}) | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
2479
+ callbackURL?: string | undefined;
2480
+ newUserCallbackURL?: string | undefined;
2481
+ errorCallbackURL?: string | undefined;
2482
+ disableRedirect?: boolean | undefined;
2483
+ idToken?: {
2484
+ token: string;
2485
+ nonce?: string | undefined;
2486
+ accessToken?: string | undefined;
2487
+ refreshToken?: string | undefined;
2488
+ expiresAt?: number | undefined;
2489
+ user?: {
2490
+ name?: {
2491
+ firstName?: string | undefined;
2492
+ lastName?: string | undefined;
2493
+ } | undefined;
2494
+ email?: string | undefined;
2495
+ } | undefined;
2496
+ } | undefined;
2497
+ scopes?: string[] | undefined;
2498
+ requestSignUp?: boolean | undefined;
2499
+ loginHint?: string | undefined;
2500
+ additionalParams?: Record<string, string> | undefined;
2501
+ additionalData?: Record<string, any> | undefined;
2502
+ } & {
2503
+ fetchOptions?: FetchOptions | undefined;
2504
+ }, "provider"> & {
2505
+ provider: (string & {}) | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
2506
+ fetchOptions?: FetchOptions | undefined;
2507
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2508
+ redirect: boolean;
2509
+ url: string;
2510
+ } | (Omit<{
2511
+ redirect: boolean;
2512
+ token: string;
2513
+ url: undefined;
2514
+ user: {
2515
+ id: string;
2516
+ createdAt: Date;
2517
+ updatedAt: Date;
2518
+ email: string;
2519
+ emailVerified: boolean;
2520
+ name: string;
2521
+ image?: string | null | undefined | undefined;
2522
+ };
2523
+ }, "user"> & {
2524
+ user: better_auth.StripEmptyObjects<{
2525
+ id: string;
2526
+ createdAt: Date;
2527
+ updatedAt: Date;
2528
+ email: string;
2529
+ emailVerified: boolean;
2530
+ name: string;
2531
+ image?: string | null | undefined;
2532
+ } & {
2533
+ banned: boolean | null | undefined;
2534
+ } & {
2535
+ role?: string | null | undefined;
2536
+ banReason?: string | null | undefined;
2537
+ banExpires?: Date | null | undefined;
2538
+ } & {
2539
+ twoFactorEnabled: boolean | null | undefined;
2540
+ } & {}>;
2541
+ }), {
2542
+ code?: string | undefined;
2543
+ message?: string | undefined;
2544
+ }, FetchOptions["throw"] extends true ? true : false>>;
2545
+ } & {
2546
+ email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2547
+ email: string;
2548
+ password: string;
2549
+ callbackURL?: string | undefined;
2550
+ rememberMe?: boolean | undefined;
2551
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, string | undefined> | undefined>>(data_0: better_auth.Prettify<{
2552
+ email: string;
2553
+ password: string;
2554
+ callbackURL?: string | undefined;
2555
+ rememberMe?: boolean | undefined;
2556
+ } & {
2557
+ fetchOptions?: FetchOptions | undefined;
2558
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<Omit<{
2559
+ redirect: boolean;
2560
+ token: string;
2561
+ url?: string | undefined;
2562
+ user: {
2563
+ id: string;
2564
+ createdAt: Date;
2565
+ updatedAt: Date;
2566
+ email: string;
2567
+ emailVerified: boolean;
2568
+ name: string;
2569
+ image?: string | null | undefined | undefined;
2570
+ };
2571
+ }, "user"> & {
2572
+ user: better_auth.StripEmptyObjects<{
2573
+ id: string;
2574
+ createdAt: Date;
2575
+ updatedAt: Date;
2576
+ email: string;
2577
+ emailVerified: boolean;
2578
+ name: string;
2579
+ image?: string | null | undefined;
2580
+ } & {
2581
+ banned: boolean | null | undefined;
2582
+ } & {
2583
+ role?: string | null | undefined;
2584
+ banReason?: string | null | undefined;
2585
+ banExpires?: Date | null | undefined;
2586
+ } & {
2587
+ twoFactorEnabled: boolean | null | undefined;
2588
+ } & {}>;
2589
+ }, {
2590
+ code?: string | undefined;
2591
+ message?: string | undefined;
2592
+ }, FetchOptions["throw"] extends true ? true : false>>;
2593
+ } & {
2373
2594
  passkey: (opts?: {
2374
2595
  autoFill?: boolean;
2375
2596
  extensions?: _simplewebauthn_server.AuthenticationExtensionsClientInputs;
@@ -2419,7 +2640,2559 @@ declare const signIn: {
2419
2640
  error: null;
2420
2641
  }>;
2421
2642
  };
2422
- declare const signOut: any;
2423
- declare const signUp: any;
2643
+ declare const signOut: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2644
+ callbackURL?: string | undefined;
2645
+ disableRedirect?: boolean | undefined;
2646
+ state?: string | undefined;
2647
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, string | undefined> | undefined>>(data_0?: better_auth.Prettify<{
2648
+ callbackURL?: string | undefined;
2649
+ disableRedirect?: boolean | undefined;
2650
+ state?: string | undefined;
2651
+ } & {
2652
+ fetchOptions?: FetchOptions | undefined;
2653
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2654
+ success: boolean;
2655
+ url: string | undefined;
2656
+ redirect: boolean | undefined;
2657
+ }, {
2658
+ code?: string | undefined;
2659
+ message?: string | undefined;
2660
+ }, FetchOptions["throw"] extends true ? true : false>>;
2661
+ declare const signUp: {
2662
+ email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2663
+ name: string;
2664
+ email: string;
2665
+ password: string;
2666
+ image?: string | undefined;
2667
+ callbackURL?: string | undefined;
2668
+ rememberMe?: boolean | undefined;
2669
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, string | undefined> | undefined>>(data_0: better_auth.Prettify<better_auth_client.InferSignUpEmailCtx<{
2670
+ baseURL: string | undefined;
2671
+ plugins: ({
2672
+ id: "admin-client";
2673
+ version: string;
2674
+ $InferServerPlugin: {
2675
+ id: "admin";
2676
+ version: string;
2677
+ init(): {
2678
+ options: {
2679
+ databaseHooks: {
2680
+ user: {
2681
+ create: {
2682
+ before(user: {
2683
+ id: string;
2684
+ createdAt: Date;
2685
+ updatedAt: Date;
2686
+ email: string;
2687
+ emailVerified: boolean;
2688
+ name: string;
2689
+ image?: string | null | undefined;
2690
+ } & Record<string, unknown>): Promise<{
2691
+ data: {
2692
+ id: string;
2693
+ createdAt: Date;
2694
+ updatedAt: Date;
2695
+ email: string;
2696
+ emailVerified: boolean;
2697
+ name: string;
2698
+ image?: string | null | undefined;
2699
+ role: string;
2700
+ };
2701
+ }>;
2702
+ };
2703
+ };
2704
+ session: {
2705
+ create: {
2706
+ before(session: {
2707
+ id: string;
2708
+ createdAt: Date;
2709
+ updatedAt: Date;
2710
+ userId: string;
2711
+ expiresAt: Date;
2712
+ token: string;
2713
+ ipAddress?: string | null | undefined;
2714
+ userAgent?: string | null | undefined;
2715
+ } & Record<string, unknown>, ctx: better_auth.GenericEndpointContext | null): Promise<void>;
2716
+ };
2717
+ };
2718
+ };
2719
+ };
2720
+ };
2721
+ hooks: {
2722
+ after: {
2723
+ matcher(context: better_auth.HookEndpointContext): boolean;
2724
+ handler: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<better_auth_plugins.SessionWithImpersonatedBy[] | undefined>>;
2725
+ }[];
2726
+ };
2727
+ endpoints: {
2728
+ setRole: better_call.StrictEndpoint<"/admin/set-role", {
2729
+ method: "POST";
2730
+ body: zod.ZodObject<{
2731
+ userId: zod.ZodCoercedString<unknown>;
2732
+ role: zod.ZodUnion<readonly [zod.ZodString, zod.ZodArray<zod.ZodString>]>;
2733
+ }, zod_v4_core.$strip>;
2734
+ requireHeaders: true;
2735
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
2736
+ session: {
2737
+ user: better_auth_plugins.UserWithRole;
2738
+ session: {
2739
+ id: string;
2740
+ createdAt: Date;
2741
+ updatedAt: Date;
2742
+ userId: string;
2743
+ expiresAt: Date;
2744
+ token: string;
2745
+ ipAddress?: string | null | undefined;
2746
+ userAgent?: string | null | undefined;
2747
+ };
2748
+ };
2749
+ }>>[];
2750
+ metadata: {
2751
+ openapi: {
2752
+ operationId: string;
2753
+ summary: string;
2754
+ description: string;
2755
+ responses: {
2756
+ 200: {
2757
+ description: string;
2758
+ content: {
2759
+ "application/json": {
2760
+ schema: {
2761
+ type: "object";
2762
+ properties: {
2763
+ user: {
2764
+ $ref: string;
2765
+ };
2766
+ };
2767
+ };
2768
+ };
2769
+ };
2770
+ };
2771
+ };
2772
+ };
2773
+ $Infer: {
2774
+ body: {
2775
+ userId: string;
2776
+ role: "user" | "admin" | ("user" | "admin")[];
2777
+ };
2778
+ };
2779
+ };
2780
+ }, {
2781
+ user: better_auth_plugins.UserWithRole;
2782
+ }>;
2783
+ getUser: better_call.StrictEndpoint<"/admin/get-user", {
2784
+ method: "GET";
2785
+ query: zod.ZodObject<{
2786
+ id: zod.ZodString;
2787
+ }, zod_v4_core.$strip>;
2788
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
2789
+ session: {
2790
+ user: better_auth_plugins.UserWithRole;
2791
+ session: {
2792
+ id: string;
2793
+ createdAt: Date;
2794
+ updatedAt: Date;
2795
+ userId: string;
2796
+ expiresAt: Date;
2797
+ token: string;
2798
+ ipAddress?: string | null | undefined;
2799
+ userAgent?: string | null | undefined;
2800
+ };
2801
+ };
2802
+ }>>[];
2803
+ metadata: {
2804
+ openapi: {
2805
+ operationId: string;
2806
+ summary: string;
2807
+ description: string;
2808
+ responses: {
2809
+ 200: {
2810
+ description: string;
2811
+ content: {
2812
+ "application/json": {
2813
+ schema: {
2814
+ type: "object";
2815
+ properties: {
2816
+ user: {
2817
+ $ref: string;
2818
+ };
2819
+ };
2820
+ };
2821
+ };
2822
+ };
2823
+ };
2824
+ };
2825
+ };
2826
+ };
2827
+ }, better_auth_plugins.UserWithRole>;
2828
+ createUser: better_call.StrictEndpoint<"/admin/create-user", {
2829
+ method: "POST";
2830
+ body: zod.ZodObject<{
2831
+ email: zod.ZodString;
2832
+ password: zod.ZodOptional<zod.ZodString>;
2833
+ name: zod.ZodString;
2834
+ role: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodString, zod.ZodArray<zod.ZodString>]>>;
2835
+ data: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodAny>>;
2836
+ }, zod_v4_core.$strip>;
2837
+ metadata: {
2838
+ openapi: {
2839
+ operationId: string;
2840
+ summary: string;
2841
+ description: string;
2842
+ responses: {
2843
+ 200: {
2844
+ description: string;
2845
+ content: {
2846
+ "application/json": {
2847
+ schema: {
2848
+ type: "object";
2849
+ properties: {
2850
+ user: {
2851
+ $ref: string;
2852
+ };
2853
+ };
2854
+ };
2855
+ };
2856
+ };
2857
+ };
2858
+ };
2859
+ };
2860
+ $Infer: {
2861
+ body: {
2862
+ email: string;
2863
+ password?: string | undefined;
2864
+ name: string;
2865
+ role?: "user" | "admin" | ("user" | "admin")[] | undefined;
2866
+ data?: Record<string, any> | undefined;
2867
+ };
2868
+ };
2869
+ };
2870
+ }, {
2871
+ user: better_auth_plugins.UserWithRole;
2872
+ }>;
2873
+ adminUpdateUser: better_call.StrictEndpoint<"/admin/update-user", {
2874
+ method: "POST";
2875
+ body: zod.ZodObject<{
2876
+ userId: zod.ZodCoercedString<unknown>;
2877
+ data: zod.ZodRecord<zod.ZodAny, zod.ZodAny>;
2878
+ }, zod_v4_core.$strip>;
2879
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
2880
+ session: {
2881
+ user: better_auth_plugins.UserWithRole;
2882
+ session: {
2883
+ id: string;
2884
+ createdAt: Date;
2885
+ updatedAt: Date;
2886
+ userId: string;
2887
+ expiresAt: Date;
2888
+ token: string;
2889
+ ipAddress?: string | null | undefined;
2890
+ userAgent?: string | null | undefined;
2891
+ };
2892
+ };
2893
+ }>>[];
2894
+ metadata: {
2895
+ openapi: {
2896
+ operationId: string;
2897
+ summary: string;
2898
+ description: string;
2899
+ responses: {
2900
+ 200: {
2901
+ description: string;
2902
+ content: {
2903
+ "application/json": {
2904
+ schema: {
2905
+ type: "object";
2906
+ properties: {
2907
+ user: {
2908
+ $ref: string;
2909
+ };
2910
+ };
2911
+ };
2912
+ };
2913
+ };
2914
+ };
2915
+ };
2916
+ };
2917
+ };
2918
+ }, better_auth_plugins.UserWithRole>;
2919
+ listUsers: better_call.StrictEndpoint<"/admin/list-users", {
2920
+ method: "GET";
2921
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
2922
+ session: {
2923
+ user: better_auth_plugins.UserWithRole;
2924
+ session: {
2925
+ id: string;
2926
+ createdAt: Date;
2927
+ updatedAt: Date;
2928
+ userId: string;
2929
+ expiresAt: Date;
2930
+ token: string;
2931
+ ipAddress?: string | null | undefined;
2932
+ userAgent?: string | null | undefined;
2933
+ };
2934
+ };
2935
+ }>>[];
2936
+ query: zod.ZodObject<{
2937
+ searchValue: zod.ZodOptional<zod.ZodString>;
2938
+ searchField: zod.ZodOptional<zod.ZodEnum<{
2939
+ email: "email";
2940
+ name: "name";
2941
+ }>>;
2942
+ searchOperator: zod.ZodOptional<zod.ZodEnum<{
2943
+ contains: "contains";
2944
+ starts_with: "starts_with";
2945
+ ends_with: "ends_with";
2946
+ }>>;
2947
+ limit: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>>;
2948
+ offset: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>>;
2949
+ sortBy: zod.ZodOptional<zod.ZodString>;
2950
+ sortDirection: zod.ZodOptional<zod.ZodEnum<{
2951
+ asc: "asc";
2952
+ desc: "desc";
2953
+ }>>;
2954
+ filterField: zod.ZodOptional<zod.ZodString>;
2955
+ filterValue: zod.ZodOptional<zod.ZodUnion<[zod.ZodUnion<[zod.ZodUnion<[zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, zod.ZodBoolean]>, zod.ZodArray<zod.ZodString>]>, zod.ZodArray<zod.ZodNumber>]>>;
2956
+ filterOperator: zod.ZodOptional<zod.ZodEnum<{
2957
+ in: "in";
2958
+ lte: "lte";
2959
+ eq: "eq";
2960
+ ne: "ne";
2961
+ lt: "lt";
2962
+ gt: "gt";
2963
+ gte: "gte";
2964
+ not_in: "not_in";
2965
+ contains: "contains";
2966
+ starts_with: "starts_with";
2967
+ ends_with: "ends_with";
2968
+ }>>;
2969
+ }, zod_v4_core.$strip>;
2970
+ metadata: {
2971
+ openapi: {
2972
+ operationId: string;
2973
+ summary: string;
2974
+ description: string;
2975
+ responses: {
2976
+ 200: {
2977
+ description: string;
2978
+ content: {
2979
+ "application/json": {
2980
+ schema: {
2981
+ type: "object";
2982
+ properties: {
2983
+ users: {
2984
+ type: string;
2985
+ items: {
2986
+ $ref: string;
2987
+ };
2988
+ };
2989
+ total: {
2990
+ type: string;
2991
+ };
2992
+ limit: {
2993
+ type: string;
2994
+ };
2995
+ offset: {
2996
+ type: string;
2997
+ };
2998
+ };
2999
+ required: string[];
3000
+ };
3001
+ };
3002
+ };
3003
+ };
3004
+ };
3005
+ };
3006
+ };
3007
+ }, {
3008
+ users: better_auth_plugins.UserWithRole[];
3009
+ total: number;
3010
+ }>;
3011
+ listUserSessions: better_call.StrictEndpoint<"/admin/list-user-sessions", {
3012
+ method: "POST";
3013
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
3014
+ session: {
3015
+ user: better_auth_plugins.UserWithRole;
3016
+ session: {
3017
+ id: string;
3018
+ createdAt: Date;
3019
+ updatedAt: Date;
3020
+ userId: string;
3021
+ expiresAt: Date;
3022
+ token: string;
3023
+ ipAddress?: string | null | undefined;
3024
+ userAgent?: string | null | undefined;
3025
+ };
3026
+ };
3027
+ }>>[];
3028
+ body: zod.ZodObject<{
3029
+ userId: zod.ZodCoercedString<unknown>;
3030
+ }, zod_v4_core.$strip>;
3031
+ metadata: {
3032
+ openapi: {
3033
+ operationId: string;
3034
+ summary: string;
3035
+ description: string;
3036
+ responses: {
3037
+ 200: {
3038
+ description: string;
3039
+ content: {
3040
+ "application/json": {
3041
+ schema: {
3042
+ type: "object";
3043
+ properties: {
3044
+ sessions: {
3045
+ type: string;
3046
+ items: {
3047
+ $ref: string;
3048
+ };
3049
+ };
3050
+ };
3051
+ };
3052
+ };
3053
+ };
3054
+ };
3055
+ };
3056
+ };
3057
+ };
3058
+ }, {
3059
+ sessions: better_auth_plugins.SessionWithImpersonatedBy[];
3060
+ }>;
3061
+ unbanUser: better_call.StrictEndpoint<"/admin/unban-user", {
3062
+ method: "POST";
3063
+ body: zod.ZodObject<{
3064
+ userId: zod.ZodCoercedString<unknown>;
3065
+ }, zod_v4_core.$strip>;
3066
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
3067
+ session: {
3068
+ user: better_auth_plugins.UserWithRole;
3069
+ session: {
3070
+ id: string;
3071
+ createdAt: Date;
3072
+ updatedAt: Date;
3073
+ userId: string;
3074
+ expiresAt: Date;
3075
+ token: string;
3076
+ ipAddress?: string | null | undefined;
3077
+ userAgent?: string | null | undefined;
3078
+ };
3079
+ };
3080
+ }>>[];
3081
+ metadata: {
3082
+ openapi: {
3083
+ operationId: string;
3084
+ summary: string;
3085
+ description: string;
3086
+ responses: {
3087
+ 200: {
3088
+ description: string;
3089
+ content: {
3090
+ "application/json": {
3091
+ schema: {
3092
+ type: "object";
3093
+ properties: {
3094
+ user: {
3095
+ $ref: string;
3096
+ };
3097
+ };
3098
+ };
3099
+ };
3100
+ };
3101
+ };
3102
+ };
3103
+ };
3104
+ };
3105
+ }, {
3106
+ user: better_auth_plugins.UserWithRole;
3107
+ }>;
3108
+ banUser: better_call.StrictEndpoint<"/admin/ban-user", {
3109
+ method: "POST";
3110
+ body: zod.ZodObject<{
3111
+ userId: zod.ZodCoercedString<unknown>;
3112
+ banReason: zod.ZodOptional<zod.ZodString>;
3113
+ banExpiresIn: zod.ZodOptional<zod.ZodNumber>;
3114
+ }, zod_v4_core.$strip>;
3115
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
3116
+ session: {
3117
+ user: better_auth_plugins.UserWithRole;
3118
+ session: {
3119
+ id: string;
3120
+ createdAt: Date;
3121
+ updatedAt: Date;
3122
+ userId: string;
3123
+ expiresAt: Date;
3124
+ token: string;
3125
+ ipAddress?: string | null | undefined;
3126
+ userAgent?: string | null | undefined;
3127
+ };
3128
+ };
3129
+ }>>[];
3130
+ metadata: {
3131
+ openapi: {
3132
+ operationId: string;
3133
+ summary: string;
3134
+ description: string;
3135
+ responses: {
3136
+ 200: {
3137
+ description: string;
3138
+ content: {
3139
+ "application/json": {
3140
+ schema: {
3141
+ type: "object";
3142
+ properties: {
3143
+ user: {
3144
+ $ref: string;
3145
+ };
3146
+ };
3147
+ };
3148
+ };
3149
+ };
3150
+ };
3151
+ };
3152
+ };
3153
+ };
3154
+ }, {
3155
+ user: better_auth_plugins.UserWithRole;
3156
+ }>;
3157
+ impersonateUser: better_call.StrictEndpoint<"/admin/impersonate-user", {
3158
+ method: "POST";
3159
+ body: zod.ZodObject<{
3160
+ userId: zod.ZodCoercedString<unknown>;
3161
+ }, zod_v4_core.$strip>;
3162
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
3163
+ session: {
3164
+ user: better_auth_plugins.UserWithRole;
3165
+ session: {
3166
+ id: string;
3167
+ createdAt: Date;
3168
+ updatedAt: Date;
3169
+ userId: string;
3170
+ expiresAt: Date;
3171
+ token: string;
3172
+ ipAddress?: string | null | undefined;
3173
+ userAgent?: string | null | undefined;
3174
+ };
3175
+ };
3176
+ }>>[];
3177
+ metadata: {
3178
+ openapi: {
3179
+ operationId: string;
3180
+ summary: string;
3181
+ description: string;
3182
+ responses: {
3183
+ 200: {
3184
+ description: string;
3185
+ content: {
3186
+ "application/json": {
3187
+ schema: {
3188
+ type: "object";
3189
+ properties: {
3190
+ session: {
3191
+ $ref: string;
3192
+ };
3193
+ user: {
3194
+ $ref: string;
3195
+ };
3196
+ };
3197
+ };
3198
+ };
3199
+ };
3200
+ };
3201
+ };
3202
+ };
3203
+ };
3204
+ }, {
3205
+ session: {
3206
+ id: string;
3207
+ createdAt: Date;
3208
+ updatedAt: Date;
3209
+ userId: string;
3210
+ expiresAt: Date;
3211
+ token: string;
3212
+ ipAddress?: string | null | undefined;
3213
+ userAgent?: string | null | undefined;
3214
+ };
3215
+ user: better_auth_plugins.UserWithRole;
3216
+ }>;
3217
+ stopImpersonating: better_call.StrictEndpoint<"/admin/stop-impersonating", {
3218
+ method: "POST";
3219
+ requireHeaders: true;
3220
+ }, {
3221
+ session: {
3222
+ id: string;
3223
+ createdAt: Date;
3224
+ updatedAt: Date;
3225
+ userId: string;
3226
+ expiresAt: Date;
3227
+ token: string;
3228
+ ipAddress?: string | null | undefined;
3229
+ userAgent?: string | null | undefined;
3230
+ } & Record<string, any>;
3231
+ user: {
3232
+ id: string;
3233
+ createdAt: Date;
3234
+ updatedAt: Date;
3235
+ email: string;
3236
+ emailVerified: boolean;
3237
+ name: string;
3238
+ image?: string | null | undefined;
3239
+ } & Record<string, any>;
3240
+ }>;
3241
+ revokeUserSession: better_call.StrictEndpoint<"/admin/revoke-user-session", {
3242
+ method: "POST";
3243
+ body: zod.ZodObject<{
3244
+ sessionToken: zod.ZodString;
3245
+ }, zod_v4_core.$strip>;
3246
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
3247
+ session: {
3248
+ user: better_auth_plugins.UserWithRole;
3249
+ session: {
3250
+ id: string;
3251
+ createdAt: Date;
3252
+ updatedAt: Date;
3253
+ userId: string;
3254
+ expiresAt: Date;
3255
+ token: string;
3256
+ ipAddress?: string | null | undefined;
3257
+ userAgent?: string | null | undefined;
3258
+ };
3259
+ };
3260
+ }>>[];
3261
+ metadata: {
3262
+ openapi: {
3263
+ operationId: string;
3264
+ summary: string;
3265
+ description: string;
3266
+ responses: {
3267
+ 200: {
3268
+ description: string;
3269
+ content: {
3270
+ "application/json": {
3271
+ schema: {
3272
+ type: "object";
3273
+ properties: {
3274
+ success: {
3275
+ type: string;
3276
+ };
3277
+ };
3278
+ };
3279
+ };
3280
+ };
3281
+ };
3282
+ };
3283
+ };
3284
+ };
3285
+ }, {
3286
+ success: boolean;
3287
+ }>;
3288
+ revokeUserSessions: better_call.StrictEndpoint<"/admin/revoke-user-sessions", {
3289
+ method: "POST";
3290
+ body: zod.ZodObject<{
3291
+ userId: zod.ZodCoercedString<unknown>;
3292
+ }, zod_v4_core.$strip>;
3293
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
3294
+ session: {
3295
+ user: better_auth_plugins.UserWithRole;
3296
+ session: {
3297
+ id: string;
3298
+ createdAt: Date;
3299
+ updatedAt: Date;
3300
+ userId: string;
3301
+ expiresAt: Date;
3302
+ token: string;
3303
+ ipAddress?: string | null | undefined;
3304
+ userAgent?: string | null | undefined;
3305
+ };
3306
+ };
3307
+ }>>[];
3308
+ metadata: {
3309
+ openapi: {
3310
+ operationId: string;
3311
+ summary: string;
3312
+ description: string;
3313
+ responses: {
3314
+ 200: {
3315
+ description: string;
3316
+ content: {
3317
+ "application/json": {
3318
+ schema: {
3319
+ type: "object";
3320
+ properties: {
3321
+ success: {
3322
+ type: string;
3323
+ };
3324
+ };
3325
+ };
3326
+ };
3327
+ };
3328
+ };
3329
+ };
3330
+ };
3331
+ };
3332
+ }, {
3333
+ success: boolean;
3334
+ }>;
3335
+ removeUser: better_call.StrictEndpoint<"/admin/remove-user", {
3336
+ method: "POST";
3337
+ body: zod.ZodObject<{
3338
+ userId: zod.ZodCoercedString<unknown>;
3339
+ }, zod_v4_core.$strip>;
3340
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
3341
+ session: {
3342
+ user: better_auth_plugins.UserWithRole;
3343
+ session: {
3344
+ id: string;
3345
+ createdAt: Date;
3346
+ updatedAt: Date;
3347
+ userId: string;
3348
+ expiresAt: Date;
3349
+ token: string;
3350
+ ipAddress?: string | null | undefined;
3351
+ userAgent?: string | null | undefined;
3352
+ };
3353
+ };
3354
+ }>>[];
3355
+ metadata: {
3356
+ openapi: {
3357
+ operationId: string;
3358
+ summary: string;
3359
+ description: string;
3360
+ responses: {
3361
+ 200: {
3362
+ description: string;
3363
+ content: {
3364
+ "application/json": {
3365
+ schema: {
3366
+ type: "object";
3367
+ properties: {
3368
+ success: {
3369
+ type: string;
3370
+ };
3371
+ };
3372
+ };
3373
+ };
3374
+ };
3375
+ };
3376
+ };
3377
+ };
3378
+ };
3379
+ }, {
3380
+ success: boolean;
3381
+ }>;
3382
+ setUserPassword: better_call.StrictEndpoint<"/admin/set-user-password", {
3383
+ method: "POST";
3384
+ body: zod.ZodObject<{
3385
+ newPassword: zod.ZodString;
3386
+ userId: zod.ZodCoercedString<unknown>;
3387
+ }, zod_v4_core.$strip>;
3388
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
3389
+ session: {
3390
+ user: better_auth_plugins.UserWithRole;
3391
+ session: {
3392
+ id: string;
3393
+ createdAt: Date;
3394
+ updatedAt: Date;
3395
+ userId: string;
3396
+ expiresAt: Date;
3397
+ token: string;
3398
+ ipAddress?: string | null | undefined;
3399
+ userAgent?: string | null | undefined;
3400
+ };
3401
+ };
3402
+ }>>[];
3403
+ metadata: {
3404
+ openapi: {
3405
+ operationId: string;
3406
+ summary: string;
3407
+ description: string;
3408
+ responses: {
3409
+ 200: {
3410
+ description: string;
3411
+ content: {
3412
+ "application/json": {
3413
+ schema: {
3414
+ type: "object";
3415
+ properties: {
3416
+ status: {
3417
+ type: string;
3418
+ };
3419
+ };
3420
+ };
3421
+ };
3422
+ };
3423
+ };
3424
+ };
3425
+ };
3426
+ };
3427
+ }, {
3428
+ status: boolean;
3429
+ }>;
3430
+ userHasPermission: better_call.StrictEndpoint<"/admin/has-permission", {
3431
+ method: "POST";
3432
+ body: zod.ZodIntersection<zod.ZodObject<{
3433
+ userId: zod.ZodOptional<zod.ZodCoercedString<unknown>>;
3434
+ role: zod.ZodOptional<zod.ZodString>;
3435
+ }, zod_v4_core.$strip>, zod.ZodXor<readonly [zod.ZodObject<{
3436
+ permission: zod.ZodRecord<zod.ZodString, zod.ZodArray<zod.ZodString>>;
3437
+ }, zod_v4_core.$strip>, zod.ZodObject<{
3438
+ permissions: zod.ZodRecord<zod.ZodString, zod.ZodArray<zod.ZodString>>;
3439
+ }, zod_v4_core.$strip>]>>;
3440
+ metadata: {
3441
+ openapi: {
3442
+ description: string;
3443
+ requestBody: {
3444
+ content: {
3445
+ "application/json": {
3446
+ schema: {
3447
+ type: "object";
3448
+ properties: {
3449
+ permissions: {
3450
+ type: string;
3451
+ description: string;
3452
+ };
3453
+ };
3454
+ required: string[];
3455
+ };
3456
+ };
3457
+ };
3458
+ };
3459
+ responses: {
3460
+ "200": {
3461
+ description: string;
3462
+ content: {
3463
+ "application/json": {
3464
+ schema: {
3465
+ type: "object";
3466
+ properties: {
3467
+ error: {
3468
+ type: string;
3469
+ };
3470
+ success: {
3471
+ type: string;
3472
+ };
3473
+ };
3474
+ required: string[];
3475
+ };
3476
+ };
3477
+ };
3478
+ };
3479
+ };
3480
+ };
3481
+ $Infer: {
3482
+ body: {
3483
+ permissions: {
3484
+ readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "get" | "update")[] | undefined;
3485
+ readonly session?: ("list" | "delete" | "revoke")[] | undefined;
3486
+ };
3487
+ } & {
3488
+ userId?: string | undefined;
3489
+ role?: "user" | "admin" | undefined;
3490
+ };
3491
+ };
3492
+ };
3493
+ }, {
3494
+ error: null;
3495
+ success: boolean;
3496
+ }>;
3497
+ };
3498
+ $ERROR_CODES: {
3499
+ USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: better_auth.RawError<"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL">;
3500
+ FAILED_TO_CREATE_USER: better_auth.RawError<"FAILED_TO_CREATE_USER">;
3501
+ USER_ALREADY_EXISTS: better_auth.RawError<"USER_ALREADY_EXISTS">;
3502
+ YOU_CANNOT_BAN_YOURSELF: better_auth.RawError<"YOU_CANNOT_BAN_YOURSELF">;
3503
+ YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE">;
3504
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS">;
3505
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS">;
3506
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS">;
3507
+ YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_BAN_USERS">;
3508
+ YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS">;
3509
+ YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS">;
3510
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS">;
3511
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD">;
3512
+ BANNED_USER: better_auth.RawError<"BANNED_USER">;
3513
+ YOU_ARE_NOT_ALLOWED_TO_GET_USER: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_USER">;
3514
+ NO_DATA_TO_UPDATE: better_auth.RawError<"NO_DATA_TO_UPDATE">;
3515
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS">;
3516
+ YOU_CANNOT_REMOVE_YOURSELF: better_auth.RawError<"YOU_CANNOT_REMOVE_YOURSELF">;
3517
+ YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE">;
3518
+ YOU_CANNOT_IMPERSONATE_ADMINS: better_auth.RawError<"YOU_CANNOT_IMPERSONATE_ADMINS">;
3519
+ INVALID_ROLE_TYPE: better_auth.RawError<"INVALID_ROLE_TYPE">;
3520
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL">;
3521
+ PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER: better_auth.RawError<"PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER">;
3522
+ };
3523
+ schema: {
3524
+ user: {
3525
+ fields: {
3526
+ role: {
3527
+ type: "string";
3528
+ required: false;
3529
+ input: false;
3530
+ };
3531
+ banned: {
3532
+ type: "boolean";
3533
+ defaultValue: false;
3534
+ required: false;
3535
+ input: false;
3536
+ };
3537
+ banReason: {
3538
+ type: "string";
3539
+ required: false;
3540
+ input: false;
3541
+ };
3542
+ banExpires: {
3543
+ type: "date";
3544
+ required: false;
3545
+ input: false;
3546
+ };
3547
+ };
3548
+ };
3549
+ session: {
3550
+ fields: {
3551
+ impersonatedBy: {
3552
+ type: "string";
3553
+ required: false;
3554
+ input: false;
3555
+ };
3556
+ };
3557
+ };
3558
+ };
3559
+ options: NoInfer<{
3560
+ ac: better_auth_plugins.AccessControl<{
3561
+ readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "impersonate-admins", "delete", "set-password", "set-email", "get", "update"];
3562
+ readonly session: readonly ["list", "revoke", "delete"];
3563
+ }>;
3564
+ roles: {
3565
+ admin: better_auth_plugins.Role;
3566
+ user: better_auth_plugins.Role;
3567
+ };
3568
+ }>;
3569
+ };
3570
+ getActions: () => {
3571
+ admin: {
3572
+ checkRolePermission: <R extends "user" | "admin">(data: {
3573
+ permissions: {
3574
+ readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "get" | "update")[] | undefined;
3575
+ readonly session?: ("list" | "delete" | "revoke")[] | undefined;
3576
+ };
3577
+ } & {
3578
+ role: R;
3579
+ }) => boolean;
3580
+ };
3581
+ };
3582
+ pathMethods: {
3583
+ "/admin/list-users": "GET";
3584
+ "/admin/impersonate-user": "POST";
3585
+ "/admin/stop-impersonating": "POST";
3586
+ };
3587
+ atomListeners: {
3588
+ matcher: (path: string) => path is "/admin/impersonate-user" | "/admin/stop-impersonating";
3589
+ signal: "$sessionSignal";
3590
+ }[];
3591
+ $ERROR_CODES: {
3592
+ USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: better_auth.RawError<"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL">;
3593
+ FAILED_TO_CREATE_USER: better_auth.RawError<"FAILED_TO_CREATE_USER">;
3594
+ USER_ALREADY_EXISTS: better_auth.RawError<"USER_ALREADY_EXISTS">;
3595
+ YOU_CANNOT_BAN_YOURSELF: better_auth.RawError<"YOU_CANNOT_BAN_YOURSELF">;
3596
+ YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE">;
3597
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS">;
3598
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS">;
3599
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS">;
3600
+ YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_BAN_USERS">;
3601
+ YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS">;
3602
+ YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS">;
3603
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS">;
3604
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD">;
3605
+ BANNED_USER: better_auth.RawError<"BANNED_USER">;
3606
+ YOU_ARE_NOT_ALLOWED_TO_GET_USER: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_USER">;
3607
+ NO_DATA_TO_UPDATE: better_auth.RawError<"NO_DATA_TO_UPDATE">;
3608
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS">;
3609
+ YOU_CANNOT_REMOVE_YOURSELF: better_auth.RawError<"YOU_CANNOT_REMOVE_YOURSELF">;
3610
+ YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE">;
3611
+ YOU_CANNOT_IMPERSONATE_ADMINS: better_auth.RawError<"YOU_CANNOT_IMPERSONATE_ADMINS">;
3612
+ INVALID_ROLE_TYPE: better_auth.RawError<"INVALID_ROLE_TYPE">;
3613
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL">;
3614
+ PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER: better_auth.RawError<"PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER">;
3615
+ };
3616
+ } | {
3617
+ id: "two-factor";
3618
+ version: string;
3619
+ $InferServerPlugin: ReturnType<(<O extends better_auth_plugins.TwoFactorOptions>(options?: O) => {
3620
+ id: "two-factor";
3621
+ version: string;
3622
+ endpoints: {
3623
+ enableTwoFactor: better_call.StrictEndpoint<"/two-factor/enable", {
3624
+ method: "POST";
3625
+ body: zod.ZodObject<{
3626
+ password: zod.ZodOptional<zod.ZodString>;
3627
+ method: zod.ZodDefault<zod.ZodEnum<{
3628
+ otp: "otp";
3629
+ totp: "totp";
3630
+ }>>;
3631
+ issuer: zod.ZodOptional<zod.ZodString>;
3632
+ }, zod_v4_core.$strip> | zod.ZodObject<{
3633
+ password: zod.ZodString;
3634
+ method: zod.ZodDefault<zod.ZodEnum<{
3635
+ otp: "otp";
3636
+ totp: "totp";
3637
+ }>>;
3638
+ issuer: zod.ZodOptional<zod.ZodString>;
3639
+ }, zod_v4_core.$strip>;
3640
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
3641
+ session: {
3642
+ session: Record<string, any> & {
3643
+ id: string;
3644
+ createdAt: Date;
3645
+ updatedAt: Date;
3646
+ userId: string;
3647
+ expiresAt: Date;
3648
+ token: string;
3649
+ ipAddress?: string | null | undefined;
3650
+ userAgent?: string | null | undefined;
3651
+ };
3652
+ user: Record<string, any> & {
3653
+ id: string;
3654
+ createdAt: Date;
3655
+ updatedAt: Date;
3656
+ email: string;
3657
+ emailVerified: boolean;
3658
+ name: string;
3659
+ image?: string | null | undefined;
3660
+ };
3661
+ };
3662
+ }>>[];
3663
+ metadata: {
3664
+ openapi: {
3665
+ summary: string;
3666
+ description: string;
3667
+ responses: {
3668
+ 200: {
3669
+ description: string;
3670
+ content: {
3671
+ "application/json": {
3672
+ schema: {
3673
+ type: "object";
3674
+ properties: {
3675
+ method: {
3676
+ type: string;
3677
+ enum: string[];
3678
+ description: string;
3679
+ };
3680
+ totpURI: {
3681
+ type: string;
3682
+ description: string;
3683
+ };
3684
+ backupCodes: {
3685
+ type: string;
3686
+ items: {
3687
+ type: string;
3688
+ };
3689
+ description: string;
3690
+ };
3691
+ };
3692
+ required: string[];
3693
+ };
3694
+ };
3695
+ };
3696
+ };
3697
+ };
3698
+ };
3699
+ };
3700
+ }, {
3701
+ method: "otp";
3702
+ } | {
3703
+ method: "totp";
3704
+ totpURI: string;
3705
+ backupCodes: string[];
3706
+ }>;
3707
+ disableTwoFactor: better_call.StrictEndpoint<"/two-factor/disable", {
3708
+ method: "POST";
3709
+ body: zod.ZodObject<{
3710
+ password: zod.ZodOptional<zod.ZodString>;
3711
+ }, zod_v4_core.$strip> | zod.ZodObject<{
3712
+ password: zod.ZodString;
3713
+ }, zod_v4_core.$strip>;
3714
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
3715
+ session: {
3716
+ session: Record<string, any> & {
3717
+ id: string;
3718
+ createdAt: Date;
3719
+ updatedAt: Date;
3720
+ userId: string;
3721
+ expiresAt: Date;
3722
+ token: string;
3723
+ ipAddress?: string | null | undefined;
3724
+ userAgent?: string | null | undefined;
3725
+ };
3726
+ user: Record<string, any> & {
3727
+ id: string;
3728
+ createdAt: Date;
3729
+ updatedAt: Date;
3730
+ email: string;
3731
+ emailVerified: boolean;
3732
+ name: string;
3733
+ image?: string | null | undefined;
3734
+ };
3735
+ };
3736
+ }>>[];
3737
+ metadata: {
3738
+ openapi: {
3739
+ summary: string;
3740
+ description: string;
3741
+ responses: {
3742
+ 200: {
3743
+ description: string;
3744
+ content: {
3745
+ "application/json": {
3746
+ schema: {
3747
+ type: "object";
3748
+ properties: {
3749
+ status: {
3750
+ type: string;
3751
+ };
3752
+ };
3753
+ };
3754
+ };
3755
+ };
3756
+ };
3757
+ };
3758
+ };
3759
+ };
3760
+ }, {
3761
+ status: boolean;
3762
+ }>;
3763
+ verifyBackupCode: better_call.StrictEndpoint<"/two-factor/verify-backup-code", {
3764
+ method: "POST";
3765
+ body: zod.ZodObject<{
3766
+ code: zod.ZodString;
3767
+ disableSession: zod.ZodOptional<zod.ZodBoolean>;
3768
+ trustDevice: zod.ZodOptional<zod.ZodBoolean>;
3769
+ }, zod_v4_core.$strip>;
3770
+ metadata: {
3771
+ openapi: {
3772
+ description: string;
3773
+ responses: {
3774
+ "200": {
3775
+ description: string;
3776
+ content: {
3777
+ "application/json": {
3778
+ schema: {
3779
+ type: "object";
3780
+ properties: {
3781
+ user: {
3782
+ type: string;
3783
+ properties: {
3784
+ id: {
3785
+ type: string;
3786
+ description: string;
3787
+ };
3788
+ email: {
3789
+ type: string;
3790
+ format: string;
3791
+ nullable: boolean;
3792
+ description: string;
3793
+ };
3794
+ emailVerified: {
3795
+ type: string;
3796
+ nullable: boolean;
3797
+ description: string;
3798
+ };
3799
+ name: {
3800
+ type: string;
3801
+ nullable: boolean;
3802
+ description: string;
3803
+ };
3804
+ image: {
3805
+ type: string;
3806
+ format: string;
3807
+ nullable: boolean;
3808
+ description: string;
3809
+ };
3810
+ twoFactorEnabled: {
3811
+ type: string;
3812
+ description: string;
3813
+ };
3814
+ createdAt: {
3815
+ type: string;
3816
+ format: string;
3817
+ description: string;
3818
+ };
3819
+ updatedAt: {
3820
+ type: string;
3821
+ format: string;
3822
+ description: string;
3823
+ };
3824
+ };
3825
+ required: string[];
3826
+ description: string;
3827
+ };
3828
+ session: {
3829
+ type: string;
3830
+ properties: {
3831
+ token: {
3832
+ type: string;
3833
+ description: string;
3834
+ };
3835
+ userId: {
3836
+ type: string;
3837
+ description: string;
3838
+ };
3839
+ createdAt: {
3840
+ type: string;
3841
+ format: string;
3842
+ description: string;
3843
+ };
3844
+ expiresAt: {
3845
+ type: string;
3846
+ format: string;
3847
+ description: string;
3848
+ };
3849
+ };
3850
+ required: string[];
3851
+ description: string;
3852
+ };
3853
+ };
3854
+ required: string[];
3855
+ };
3856
+ };
3857
+ };
3858
+ };
3859
+ };
3860
+ };
3861
+ };
3862
+ }, {
3863
+ token: string | undefined;
3864
+ user: (Record<string, any> & {
3865
+ id: string;
3866
+ createdAt: Date;
3867
+ updatedAt: Date;
3868
+ email: string;
3869
+ emailVerified: boolean;
3870
+ name: string;
3871
+ image?: string | null | undefined;
3872
+ }) | better_auth_plugins.UserWithTwoFactor;
3873
+ }>;
3874
+ generateBackupCodes: better_call.StrictEndpoint<"/two-factor/generate-backup-codes", {
3875
+ method: "POST";
3876
+ body: zod.ZodObject<{
3877
+ password: zod.ZodOptional<zod.ZodString>;
3878
+ }, zod_v4_core.$strip> | zod.ZodObject<{
3879
+ password: zod.ZodString;
3880
+ }, zod_v4_core.$strip>;
3881
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
3882
+ session: {
3883
+ session: Record<string, any> & {
3884
+ id: string;
3885
+ createdAt: Date;
3886
+ updatedAt: Date;
3887
+ userId: string;
3888
+ expiresAt: Date;
3889
+ token: string;
3890
+ ipAddress?: string | null | undefined;
3891
+ userAgent?: string | null | undefined;
3892
+ };
3893
+ user: Record<string, any> & {
3894
+ id: string;
3895
+ createdAt: Date;
3896
+ updatedAt: Date;
3897
+ email: string;
3898
+ emailVerified: boolean;
3899
+ name: string;
3900
+ image?: string | null | undefined;
3901
+ };
3902
+ };
3903
+ }>>[];
3904
+ metadata: {
3905
+ openapi: {
3906
+ description: string;
3907
+ responses: {
3908
+ "200": {
3909
+ description: string;
3910
+ content: {
3911
+ "application/json": {
3912
+ schema: {
3913
+ type: "object";
3914
+ properties: {
3915
+ status: {
3916
+ type: string;
3917
+ description: string;
3918
+ enum: boolean[];
3919
+ };
3920
+ backupCodes: {
3921
+ type: string;
3922
+ items: {
3923
+ type: string;
3924
+ };
3925
+ description: string;
3926
+ };
3927
+ };
3928
+ required: string[];
3929
+ };
3930
+ };
3931
+ };
3932
+ };
3933
+ };
3934
+ };
3935
+ };
3936
+ }, {
3937
+ status: boolean;
3938
+ backupCodes: string[];
3939
+ }>;
3940
+ viewBackupCodes: better_call.StrictEndpoint<string, {
3941
+ method: "POST";
3942
+ body: zod.ZodObject<{
3943
+ userId: zod.ZodCoercedString<unknown>;
3944
+ }, zod_v4_core.$strip>;
3945
+ }, {
3946
+ status: boolean;
3947
+ backupCodes: string[];
3948
+ }>;
3949
+ sendTwoFactorOTP: better_call.StrictEndpoint<"/two-factor/send-otp", {
3950
+ method: "POST";
3951
+ body: zod.ZodOptional<zod.ZodObject<{
3952
+ trustDevice: zod.ZodOptional<zod.ZodBoolean>;
3953
+ }, zod_v4_core.$strip>>;
3954
+ metadata: {
3955
+ openapi: {
3956
+ summary: string;
3957
+ description: string;
3958
+ responses: {
3959
+ 200: {
3960
+ description: string;
3961
+ content: {
3962
+ "application/json": {
3963
+ schema: {
3964
+ type: "object";
3965
+ properties: {
3966
+ status: {
3967
+ type: string;
3968
+ };
3969
+ };
3970
+ };
3971
+ };
3972
+ };
3973
+ };
3974
+ };
3975
+ };
3976
+ };
3977
+ }, {
3978
+ status: boolean;
3979
+ }>;
3980
+ verifyTwoFactorOTP: better_call.StrictEndpoint<"/two-factor/verify-otp", {
3981
+ method: "POST";
3982
+ body: zod.ZodObject<{
3983
+ code: zod.ZodString;
3984
+ trustDevice: zod.ZodOptional<zod.ZodBoolean>;
3985
+ }, zod_v4_core.$strip>;
3986
+ metadata: {
3987
+ openapi: {
3988
+ summary: string;
3989
+ description: string;
3990
+ responses: {
3991
+ "200": {
3992
+ description: string;
3993
+ content: {
3994
+ "application/json": {
3995
+ schema: {
3996
+ type: "object";
3997
+ properties: {
3998
+ token: {
3999
+ type: string;
4000
+ description: string;
4001
+ };
4002
+ user: {
4003
+ type: string;
4004
+ properties: {
4005
+ id: {
4006
+ type: string;
4007
+ description: string;
4008
+ };
4009
+ email: {
4010
+ type: string;
4011
+ format: string;
4012
+ nullable: boolean;
4013
+ description: string;
4014
+ };
4015
+ emailVerified: {
4016
+ type: string;
4017
+ nullable: boolean;
4018
+ description: string;
4019
+ };
4020
+ name: {
4021
+ type: string;
4022
+ nullable: boolean;
4023
+ description: string;
4024
+ };
4025
+ image: {
4026
+ type: string;
4027
+ format: string;
4028
+ nullable: boolean;
4029
+ description: string;
4030
+ };
4031
+ createdAt: {
4032
+ type: string;
4033
+ format: string;
4034
+ description: string;
4035
+ };
4036
+ updatedAt: {
4037
+ type: string;
4038
+ format: string;
4039
+ description: string;
4040
+ };
4041
+ };
4042
+ required: string[];
4043
+ description: string;
4044
+ };
4045
+ };
4046
+ required: string[];
4047
+ };
4048
+ };
4049
+ };
4050
+ };
4051
+ };
4052
+ };
4053
+ };
4054
+ }, {
4055
+ token: string;
4056
+ user: better_auth_plugins.UserWithTwoFactor;
4057
+ } | {
4058
+ token: string;
4059
+ user: Record<string, any> & {
4060
+ id: string;
4061
+ createdAt: Date;
4062
+ updatedAt: Date;
4063
+ email: string;
4064
+ emailVerified: boolean;
4065
+ name: string;
4066
+ image?: string | null | undefined;
4067
+ };
4068
+ }>;
4069
+ generateTOTP: better_call.StrictEndpoint<string, {
4070
+ method: "POST";
4071
+ body: zod.ZodObject<{
4072
+ secret: zod.ZodString;
4073
+ }, zod_v4_core.$strip>;
4074
+ metadata: {
4075
+ openapi: {
4076
+ summary: string;
4077
+ description: string;
4078
+ responses: {
4079
+ 200: {
4080
+ description: string;
4081
+ content: {
4082
+ "application/json": {
4083
+ schema: {
4084
+ type: "object";
4085
+ properties: {
4086
+ code: {
4087
+ type: string;
4088
+ };
4089
+ };
4090
+ };
4091
+ };
4092
+ };
4093
+ };
4094
+ };
4095
+ };
4096
+ };
4097
+ }, {
4098
+ code: string;
4099
+ }>;
4100
+ getTOTPURI: better_call.StrictEndpoint<"/two-factor/get-totp-uri", {
4101
+ method: "POST";
4102
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
4103
+ session: {
4104
+ session: Record<string, any> & {
4105
+ id: string;
4106
+ createdAt: Date;
4107
+ updatedAt: Date;
4108
+ userId: string;
4109
+ expiresAt: Date;
4110
+ token: string;
4111
+ ipAddress?: string | null | undefined;
4112
+ userAgent?: string | null | undefined;
4113
+ };
4114
+ user: Record<string, any> & {
4115
+ id: string;
4116
+ createdAt: Date;
4117
+ updatedAt: Date;
4118
+ email: string;
4119
+ emailVerified: boolean;
4120
+ name: string;
4121
+ image?: string | null | undefined;
4122
+ };
4123
+ };
4124
+ }>>[];
4125
+ body: zod.ZodObject<{
4126
+ password: zod.ZodOptional<zod.ZodString>;
4127
+ }, zod_v4_core.$strip> | zod.ZodObject<{
4128
+ password: zod.ZodString;
4129
+ }, zod_v4_core.$strip>;
4130
+ metadata: {
4131
+ openapi: {
4132
+ summary: string;
4133
+ description: string;
4134
+ responses: {
4135
+ 200: {
4136
+ description: string;
4137
+ content: {
4138
+ "application/json": {
4139
+ schema: {
4140
+ type: "object";
4141
+ properties: {
4142
+ totpURI: {
4143
+ type: string;
4144
+ };
4145
+ };
4146
+ };
4147
+ };
4148
+ };
4149
+ };
4150
+ };
4151
+ };
4152
+ };
4153
+ }, {
4154
+ totpURI: string;
4155
+ }>;
4156
+ verifyTOTP: better_call.StrictEndpoint<"/two-factor/verify-totp", {
4157
+ method: "POST";
4158
+ body: zod.ZodObject<{
4159
+ code: zod.ZodString;
4160
+ trustDevice: zod.ZodOptional<zod.ZodBoolean>;
4161
+ }, zod_v4_core.$strip>;
4162
+ metadata: {
4163
+ openapi: {
4164
+ summary: string;
4165
+ description: string;
4166
+ responses: {
4167
+ 200: {
4168
+ description: string;
4169
+ content: {
4170
+ "application/json": {
4171
+ schema: {
4172
+ type: "object";
4173
+ properties: {
4174
+ status: {
4175
+ type: string;
4176
+ };
4177
+ };
4178
+ };
4179
+ };
4180
+ };
4181
+ };
4182
+ };
4183
+ };
4184
+ };
4185
+ }, {
4186
+ token: string;
4187
+ user: better_auth_plugins.UserWithTwoFactor;
4188
+ } | {
4189
+ token: string;
4190
+ user: Record<string, any> & {
4191
+ id: string;
4192
+ createdAt: Date;
4193
+ updatedAt: Date;
4194
+ email: string;
4195
+ emailVerified: boolean;
4196
+ name: string;
4197
+ image?: string | null | undefined;
4198
+ };
4199
+ }>;
4200
+ };
4201
+ options: NoInfer<O>;
4202
+ hooks: {
4203
+ after: {
4204
+ matcher(context: better_auth.HookEndpointContext): boolean;
4205
+ handler: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
4206
+ twoFactorRedirect: boolean;
4207
+ twoFactorMethods: string[];
4208
+ } | undefined>>;
4209
+ }[];
4210
+ };
4211
+ schema: {
4212
+ user: {
4213
+ fields: {
4214
+ twoFactorEnabled: {
4215
+ type: "boolean";
4216
+ required: false;
4217
+ defaultValue: false;
4218
+ input: false;
4219
+ };
4220
+ };
4221
+ };
4222
+ twoFactor: {
4223
+ fields: {
4224
+ secret: {
4225
+ type: "string";
4226
+ required: true;
4227
+ returned: false;
4228
+ index: true;
4229
+ };
4230
+ backupCodes: {
4231
+ type: "string";
4232
+ required: true;
4233
+ returned: false;
4234
+ };
4235
+ userId: {
4236
+ type: "string";
4237
+ required: true;
4238
+ returned: false;
4239
+ references: {
4240
+ model: string;
4241
+ field: string;
4242
+ };
4243
+ index: true;
4244
+ };
4245
+ verified: {
4246
+ type: "boolean";
4247
+ required: false;
4248
+ defaultValue: true;
4249
+ input: false;
4250
+ };
4251
+ failedVerificationCount: {
4252
+ type: "number";
4253
+ required: false;
4254
+ defaultValue: number;
4255
+ input: false;
4256
+ returned: false;
4257
+ };
4258
+ lockedUntil: {
4259
+ type: "date";
4260
+ required: false;
4261
+ input: false;
4262
+ returned: false;
4263
+ };
4264
+ };
4265
+ };
4266
+ };
4267
+ rateLimit: {
4268
+ pathMatcher(path: string): boolean;
4269
+ window: number;
4270
+ max: number;
4271
+ }[];
4272
+ $ERROR_CODES: {
4273
+ OTP_NOT_ENABLED: better_auth.RawError<"OTP_NOT_ENABLED">;
4274
+ OTP_NOT_CONFIGURED: better_auth.RawError<"OTP_NOT_CONFIGURED">;
4275
+ OTP_HAS_EXPIRED: better_auth.RawError<"OTP_HAS_EXPIRED">;
4276
+ TOTP_NOT_ENABLED: better_auth.RawError<"TOTP_NOT_ENABLED">;
4277
+ TOTP_ALREADY_ENABLED: better_auth.RawError<"TOTP_ALREADY_ENABLED">;
4278
+ TOTP_NOT_CONFIGURED: better_auth.RawError<"TOTP_NOT_CONFIGURED">;
4279
+ TWO_FACTOR_NOT_ENABLED: better_auth.RawError<"TWO_FACTOR_NOT_ENABLED">;
4280
+ BACKUP_CODES_NOT_ENABLED: better_auth.RawError<"BACKUP_CODES_NOT_ENABLED">;
4281
+ INVALID_BACKUP_CODE: better_auth.RawError<"INVALID_BACKUP_CODE">;
4282
+ INVALID_CODE: better_auth.RawError<"INVALID_CODE">;
4283
+ TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: better_auth.RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
4284
+ ACCOUNT_TEMPORARILY_LOCKED: better_auth.RawError<"ACCOUNT_TEMPORARILY_LOCKED">;
4285
+ INVALID_TWO_FACTOR_COOKIE: better_auth.RawError<"INVALID_TWO_FACTOR_COOKIE">;
4286
+ };
4287
+ })>;
4288
+ atomListeners: {
4289
+ matcher: (path: string) => boolean;
4290
+ signal: "$sessionSignal";
4291
+ }[];
4292
+ pathMethods: {
4293
+ "/two-factor/disable": "POST";
4294
+ "/two-factor/enable": "POST";
4295
+ "/two-factor/send-otp": "POST";
4296
+ "/two-factor/generate-backup-codes": "POST";
4297
+ "/two-factor/get-totp-uri": "POST";
4298
+ "/two-factor/verify-totp": "POST";
4299
+ "/two-factor/verify-otp": "POST";
4300
+ "/two-factor/verify-backup-code": "POST";
4301
+ };
4302
+ fetchPlugins: {
4303
+ id: string;
4304
+ name: string;
4305
+ hooks: {
4306
+ onSuccess(context: _better_fetch_fetch.SuccessContext<any>): Promise<void>;
4307
+ };
4308
+ }[];
4309
+ $ERROR_CODES: {
4310
+ OTP_NOT_ENABLED: better_auth.RawError<"OTP_NOT_ENABLED">;
4311
+ OTP_NOT_CONFIGURED: better_auth.RawError<"OTP_NOT_CONFIGURED">;
4312
+ OTP_HAS_EXPIRED: better_auth.RawError<"OTP_HAS_EXPIRED">;
4313
+ TOTP_NOT_ENABLED: better_auth.RawError<"TOTP_NOT_ENABLED">;
4314
+ TOTP_ALREADY_ENABLED: better_auth.RawError<"TOTP_ALREADY_ENABLED">;
4315
+ TOTP_NOT_CONFIGURED: better_auth.RawError<"TOTP_NOT_CONFIGURED">;
4316
+ TWO_FACTOR_NOT_ENABLED: better_auth.RawError<"TWO_FACTOR_NOT_ENABLED">;
4317
+ BACKUP_CODES_NOT_ENABLED: better_auth.RawError<"BACKUP_CODES_NOT_ENABLED">;
4318
+ INVALID_BACKUP_CODE: better_auth.RawError<"INVALID_BACKUP_CODE">;
4319
+ INVALID_CODE: better_auth.RawError<"INVALID_CODE">;
4320
+ TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: better_auth.RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
4321
+ ACCOUNT_TEMPORARILY_LOCKED: better_auth.RawError<"ACCOUNT_TEMPORARILY_LOCKED">;
4322
+ INVALID_TWO_FACTOR_COOKIE: better_auth.RawError<"INVALID_TWO_FACTOR_COOKIE">;
4323
+ };
4324
+ } | {
4325
+ id: "passkey";
4326
+ version: string;
4327
+ $InferServerPlugin: ReturnType<(options?: _better_auth_passkey.PasskeyOptions | undefined) => {
4328
+ id: "passkey";
4329
+ version: string;
4330
+ endpoints: {
4331
+ generatePasskeyRegistrationOptions: better_call.StrictEndpoint<"/passkey/generate-register-options", {
4332
+ method: "GET";
4333
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
4334
+ session: {
4335
+ session: Record<string, any> & {
4336
+ id: string;
4337
+ createdAt: Date;
4338
+ updatedAt: Date;
4339
+ userId: string;
4340
+ expiresAt: Date;
4341
+ token: string;
4342
+ ipAddress?: string | null | undefined;
4343
+ userAgent?: string | null | undefined;
4344
+ };
4345
+ user: Record<string, any> & {
4346
+ id: string;
4347
+ createdAt: Date;
4348
+ updatedAt: Date;
4349
+ email: string;
4350
+ emailVerified: boolean;
4351
+ name: string;
4352
+ image?: string | null | undefined;
4353
+ };
4354
+ };
4355
+ }>>[];
4356
+ query: zod.ZodOptional<zod.ZodObject<{
4357
+ authenticatorAttachment: zod.ZodOptional<zod.ZodEnum<{
4358
+ platform: "platform";
4359
+ "cross-platform": "cross-platform";
4360
+ }>>;
4361
+ name: zod.ZodOptional<zod.ZodString>;
4362
+ context: zod.ZodOptional<zod.ZodString>;
4363
+ }, zod_v4_core.$strip>>;
4364
+ metadata: {
4365
+ openapi: {
4366
+ operationId: string;
4367
+ description: string;
4368
+ parameters: better_call.OpenAPIParameter[];
4369
+ responses: {
4370
+ 200: {
4371
+ description: string;
4372
+ content: {
4373
+ "application/json": {
4374
+ schema: {
4375
+ type: "object";
4376
+ properties: {
4377
+ challenge: {
4378
+ type: string;
4379
+ };
4380
+ rp: {
4381
+ type: string;
4382
+ properties: {
4383
+ name: {
4384
+ type: string;
4385
+ };
4386
+ id: {
4387
+ type: string;
4388
+ };
4389
+ };
4390
+ };
4391
+ user: {
4392
+ type: string;
4393
+ properties: {
4394
+ id: {
4395
+ type: string;
4396
+ };
4397
+ name: {
4398
+ type: string;
4399
+ };
4400
+ displayName: {
4401
+ type: string;
4402
+ };
4403
+ };
4404
+ };
4405
+ pubKeyCredParams: {
4406
+ type: string;
4407
+ items: {
4408
+ type: string;
4409
+ properties: {
4410
+ type: {
4411
+ type: string;
4412
+ };
4413
+ alg: {
4414
+ type: string;
4415
+ };
4416
+ };
4417
+ };
4418
+ };
4419
+ timeout: {
4420
+ type: string;
4421
+ };
4422
+ excludeCredentials: {
4423
+ type: string;
4424
+ items: {
4425
+ type: string;
4426
+ properties: {
4427
+ id: {
4428
+ type: string;
4429
+ };
4430
+ type: {
4431
+ type: string;
4432
+ };
4433
+ transports: {
4434
+ type: string;
4435
+ items: {
4436
+ type: string;
4437
+ };
4438
+ };
4439
+ };
4440
+ };
4441
+ };
4442
+ authenticatorSelection: {
4443
+ type: string;
4444
+ properties: {
4445
+ authenticatorAttachment: {
4446
+ type: string;
4447
+ };
4448
+ requireResidentKey: {
4449
+ type: string;
4450
+ };
4451
+ userVerification: {
4452
+ type: string;
4453
+ };
4454
+ };
4455
+ };
4456
+ attestation: {
4457
+ type: string;
4458
+ };
4459
+ extensions: {
4460
+ type: string;
4461
+ };
4462
+ };
4463
+ };
4464
+ };
4465
+ };
4466
+ };
4467
+ };
4468
+ };
4469
+ };
4470
+ }, _simplewebauthn_server.PublicKeyCredentialCreationOptionsJSON>;
4471
+ generatePasskeyAuthenticationOptions: better_call.StrictEndpoint<"/passkey/generate-authenticate-options", {
4472
+ method: "GET";
4473
+ metadata: {
4474
+ openapi: {
4475
+ operationId: string;
4476
+ description: string;
4477
+ responses: {
4478
+ 200: {
4479
+ description: string;
4480
+ content: {
4481
+ "application/json": {
4482
+ schema: {
4483
+ type: "object";
4484
+ properties: {
4485
+ challenge: {
4486
+ type: string;
4487
+ };
4488
+ rp: {
4489
+ type: string;
4490
+ properties: {
4491
+ name: {
4492
+ type: string;
4493
+ };
4494
+ id: {
4495
+ type: string;
4496
+ };
4497
+ };
4498
+ };
4499
+ user: {
4500
+ type: string;
4501
+ properties: {
4502
+ id: {
4503
+ type: string;
4504
+ };
4505
+ name: {
4506
+ type: string;
4507
+ };
4508
+ displayName: {
4509
+ type: string;
4510
+ };
4511
+ };
4512
+ };
4513
+ timeout: {
4514
+ type: string;
4515
+ };
4516
+ allowCredentials: {
4517
+ type: string;
4518
+ items: {
4519
+ type: string;
4520
+ properties: {
4521
+ id: {
4522
+ type: string;
4523
+ };
4524
+ type: {
4525
+ type: string;
4526
+ };
4527
+ transports: {
4528
+ type: string;
4529
+ items: {
4530
+ type: string;
4531
+ };
4532
+ };
4533
+ };
4534
+ };
4535
+ };
4536
+ userVerification: {
4537
+ type: string;
4538
+ };
4539
+ authenticatorSelection: {
4540
+ type: string;
4541
+ properties: {
4542
+ authenticatorAttachment: {
4543
+ type: string;
4544
+ };
4545
+ requireResidentKey: {
4546
+ type: string;
4547
+ };
4548
+ userVerification: {
4549
+ type: string;
4550
+ };
4551
+ };
4552
+ };
4553
+ extensions: {
4554
+ type: string;
4555
+ };
4556
+ };
4557
+ };
4558
+ };
4559
+ };
4560
+ };
4561
+ };
4562
+ };
4563
+ };
4564
+ }, _simplewebauthn_server.PublicKeyCredentialRequestOptionsJSON>;
4565
+ verifyPasskeyRegistration: better_call.StrictEndpoint<"/passkey/verify-registration", {
4566
+ method: "POST";
4567
+ body: zod.ZodObject<{
4568
+ response: zod.ZodAny;
4569
+ name: zod.ZodOptional<zod.ZodString>;
4570
+ createSession: zod.ZodOptional<zod.ZodBoolean>;
4571
+ }, zod_v4_core.$strip>;
4572
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
4573
+ session: {
4574
+ session: Record<string, any> & {
4575
+ id: string;
4576
+ createdAt: Date;
4577
+ updatedAt: Date;
4578
+ userId: string;
4579
+ expiresAt: Date;
4580
+ token: string;
4581
+ ipAddress?: string | null | undefined;
4582
+ userAgent?: string | null | undefined;
4583
+ };
4584
+ user: Record<string, any> & {
4585
+ id: string;
4586
+ createdAt: Date;
4587
+ updatedAt: Date;
4588
+ email: string;
4589
+ emailVerified: boolean;
4590
+ name: string;
4591
+ image?: string | null | undefined;
4592
+ };
4593
+ };
4594
+ }>>[];
4595
+ metadata: {
4596
+ openapi: {
4597
+ operationId: string;
4598
+ description: string;
4599
+ responses: {
4600
+ 200: {
4601
+ description: string;
4602
+ content: {
4603
+ "application/json": {
4604
+ schema: {
4605
+ readonly type: "object";
4606
+ readonly allOf: readonly [{
4607
+ readonly $ref: "#/components/schemas/Passkey";
4608
+ }, {
4609
+ readonly type: "object";
4610
+ readonly properties: {
4611
+ readonly session: {
4612
+ readonly $ref: "#/components/schemas/Session";
4613
+ };
4614
+ readonly user: {
4615
+ readonly $ref: "#/components/schemas/User";
4616
+ };
4617
+ };
4618
+ }];
4619
+ };
4620
+ };
4621
+ };
4622
+ };
4623
+ 400: {
4624
+ description: string;
4625
+ };
4626
+ };
4627
+ };
4628
+ };
4629
+ }, _better_auth_passkey.Passkey>;
4630
+ verifyPasskeyAuthentication: better_call.StrictEndpoint<"/passkey/verify-authentication", {
4631
+ method: "POST";
4632
+ body: zod.ZodObject<{
4633
+ response: zod.ZodRecord<zod.ZodAny, zod.ZodAny>;
4634
+ }, zod_v4_core.$strip>;
4635
+ metadata: {
4636
+ openapi: {
4637
+ operationId: string;
4638
+ description: string;
4639
+ responses: {
4640
+ 200: {
4641
+ description: string;
4642
+ content: {
4643
+ "application/json": {
4644
+ schema: {
4645
+ type: "object";
4646
+ properties: {
4647
+ session: {
4648
+ $ref: string;
4649
+ };
4650
+ user: {
4651
+ $ref: string;
4652
+ };
4653
+ };
4654
+ };
4655
+ };
4656
+ };
4657
+ };
4658
+ };
4659
+ };
4660
+ $Infer: {
4661
+ body: {
4662
+ response: _simplewebauthn_server.AuthenticationResponseJSON;
4663
+ };
4664
+ };
4665
+ };
4666
+ }, {
4667
+ session: {
4668
+ id: string;
4669
+ createdAt: Date;
4670
+ updatedAt: Date;
4671
+ userId: string;
4672
+ expiresAt: Date;
4673
+ token: string;
4674
+ ipAddress?: string | null | undefined;
4675
+ userAgent?: string | null | undefined;
4676
+ };
4677
+ user: {
4678
+ id: string;
4679
+ createdAt: Date;
4680
+ updatedAt: Date;
4681
+ email: string;
4682
+ emailVerified: boolean;
4683
+ name: string;
4684
+ image?: string | null | undefined;
4685
+ };
4686
+ }>;
4687
+ listPasskeys: better_call.StrictEndpoint<"/passkey/list-user-passkeys", {
4688
+ method: "GET";
4689
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
4690
+ session: {
4691
+ session: Record<string, any> & {
4692
+ id: string;
4693
+ createdAt: Date;
4694
+ updatedAt: Date;
4695
+ userId: string;
4696
+ expiresAt: Date;
4697
+ token: string;
4698
+ ipAddress?: string | null | undefined;
4699
+ userAgent?: string | null | undefined;
4700
+ };
4701
+ user: Record<string, any> & {
4702
+ id: string;
4703
+ createdAt: Date;
4704
+ updatedAt: Date;
4705
+ email: string;
4706
+ emailVerified: boolean;
4707
+ name: string;
4708
+ image?: string | null | undefined;
4709
+ };
4710
+ };
4711
+ }>>[];
4712
+ metadata: {
4713
+ openapi: {
4714
+ description: string;
4715
+ responses: {
4716
+ "200": {
4717
+ description: string;
4718
+ content: {
4719
+ "application/json": {
4720
+ schema: {
4721
+ type: "array";
4722
+ items: {
4723
+ $ref: string;
4724
+ required: string[];
4725
+ };
4726
+ description: string;
4727
+ };
4728
+ };
4729
+ };
4730
+ };
4731
+ };
4732
+ };
4733
+ };
4734
+ }, _better_auth_passkey.Passkey[]>;
4735
+ deletePasskey: better_call.StrictEndpoint<"/passkey/delete-passkey", {
4736
+ method: "POST";
4737
+ body: zod.ZodObject<{
4738
+ id: zod.ZodString;
4739
+ }, zod_v4_core.$strip>;
4740
+ use: (better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
4741
+ session: {
4742
+ session: Record<string, any> & {
4743
+ id: string;
4744
+ createdAt: Date;
4745
+ updatedAt: Date;
4746
+ userId: string;
4747
+ expiresAt: Date;
4748
+ token: string;
4749
+ ipAddress?: string | null | undefined;
4750
+ userAgent?: string | null | undefined;
4751
+ };
4752
+ user: Record<string, any> & {
4753
+ id: string;
4754
+ createdAt: Date;
4755
+ updatedAt: Date;
4756
+ email: string;
4757
+ emailVerified: boolean;
4758
+ name: string;
4759
+ image?: string | null | undefined;
4760
+ };
4761
+ };
4762
+ }>> | better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
4763
+ verifiedResource: {};
4764
+ }>>)[];
4765
+ metadata: {
4766
+ openapi: {
4767
+ description: string;
4768
+ responses: {
4769
+ "200": {
4770
+ description: string;
4771
+ content: {
4772
+ "application/json": {
4773
+ schema: {
4774
+ type: "object";
4775
+ properties: {
4776
+ status: {
4777
+ type: string;
4778
+ description: string;
4779
+ };
4780
+ };
4781
+ required: string[];
4782
+ };
4783
+ };
4784
+ };
4785
+ };
4786
+ };
4787
+ };
4788
+ };
4789
+ }, {
4790
+ status: boolean;
4791
+ }>;
4792
+ updatePasskey: better_call.StrictEndpoint<"/passkey/update-passkey", {
4793
+ method: "POST";
4794
+ body: zod.ZodObject<{
4795
+ id: zod.ZodString;
4796
+ name: zod.ZodString;
4797
+ }, zod_v4_core.$strip>;
4798
+ use: (better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
4799
+ session: {
4800
+ session: Record<string, any> & {
4801
+ id: string;
4802
+ createdAt: Date;
4803
+ updatedAt: Date;
4804
+ userId: string;
4805
+ expiresAt: Date;
4806
+ token: string;
4807
+ ipAddress?: string | null | undefined;
4808
+ userAgent?: string | null | undefined;
4809
+ };
4810
+ user: Record<string, any> & {
4811
+ id: string;
4812
+ createdAt: Date;
4813
+ updatedAt: Date;
4814
+ email: string;
4815
+ emailVerified: boolean;
4816
+ name: string;
4817
+ image?: string | null | undefined;
4818
+ };
4819
+ };
4820
+ }>> | better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
4821
+ verifiedResource: {};
4822
+ }>>)[];
4823
+ metadata: {
4824
+ openapi: {
4825
+ description: string;
4826
+ responses: {
4827
+ "200": {
4828
+ description: string;
4829
+ content: {
4830
+ "application/json": {
4831
+ schema: {
4832
+ type: "object";
4833
+ properties: {
4834
+ passkey: {
4835
+ $ref: string;
4836
+ };
4837
+ };
4838
+ required: string[];
4839
+ };
4840
+ };
4841
+ };
4842
+ };
4843
+ };
4844
+ };
4845
+ };
4846
+ }, {
4847
+ passkey: _better_auth_passkey.Passkey;
4848
+ }>;
4849
+ };
4850
+ schema: {
4851
+ passkey: {
4852
+ fields: {
4853
+ name: {
4854
+ type: "string";
4855
+ required: false;
4856
+ };
4857
+ publicKey: {
4858
+ type: "string";
4859
+ required: true;
4860
+ };
4861
+ userId: {
4862
+ type: "string";
4863
+ references: {
4864
+ model: string;
4865
+ field: string;
4866
+ };
4867
+ required: true;
4868
+ index: true;
4869
+ };
4870
+ credentialID: {
4871
+ type: "string";
4872
+ required: true;
4873
+ index: true;
4874
+ };
4875
+ counter: {
4876
+ type: "number";
4877
+ required: true;
4878
+ };
4879
+ deviceType: {
4880
+ type: "string";
4881
+ required: true;
4882
+ };
4883
+ backedUp: {
4884
+ type: "boolean";
4885
+ required: true;
4886
+ };
4887
+ transports: {
4888
+ type: "string";
4889
+ required: false;
4890
+ };
4891
+ createdAt: {
4892
+ type: "date";
4893
+ required: false;
4894
+ };
4895
+ aaguid: {
4896
+ type: "string";
4897
+ required: false;
4898
+ };
4899
+ };
4900
+ };
4901
+ };
4902
+ $ERROR_CODES: {
4903
+ CHALLENGE_NOT_FOUND: better_auth.RawError<"CHALLENGE_NOT_FOUND">;
4904
+ YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
4905
+ FAILED_TO_VERIFY_REGISTRATION: better_auth.RawError<"FAILED_TO_VERIFY_REGISTRATION">;
4906
+ PASSKEY_NOT_FOUND: better_auth.RawError<"PASSKEY_NOT_FOUND">;
4907
+ AUTHENTICATION_FAILED: better_auth.RawError<"AUTHENTICATION_FAILED">;
4908
+ UNABLE_TO_CREATE_SESSION: better_auth.RawError<"UNABLE_TO_CREATE_SESSION">;
4909
+ USER_NOT_FOUND: better_auth.RawError<"USER_NOT_FOUND">;
4910
+ FAILED_TO_UPDATE_PASSKEY: better_auth.RawError<"FAILED_TO_UPDATE_PASSKEY">;
4911
+ PREVIOUSLY_REGISTERED: better_auth.RawError<"PREVIOUSLY_REGISTERED">;
4912
+ REGISTRATION_CANCELLED: better_auth.RawError<"REGISTRATION_CANCELLED">;
4913
+ AUTH_CANCELLED: better_auth.RawError<"AUTH_CANCELLED">;
4914
+ UNKNOWN_ERROR: better_auth.RawError<"UNKNOWN_ERROR">;
4915
+ SESSION_REQUIRED: better_auth.RawError<"SESSION_REQUIRED">;
4916
+ RESOLVE_USER_REQUIRED: better_auth.RawError<"RESOLVE_USER_REQUIRED">;
4917
+ RESOLVED_USER_INVALID: better_auth.RawError<"RESOLVED_USER_INVALID">;
4918
+ };
4919
+ options: _better_auth_passkey.PasskeyOptions | undefined;
4920
+ }>;
4921
+ getActions: ($fetch: _better_fetch_fetch.BetterFetch, $store: better_auth.ClientStore) => {
4922
+ signIn: {
4923
+ passkey: (opts?: {
4924
+ autoFill?: boolean;
4925
+ extensions?: _simplewebauthn_server.AuthenticationExtensionsClientInputs;
4926
+ returnWebAuthnResponse?: boolean;
4927
+ fetchOptions?: better_auth.ClientFetchOption;
4928
+ } | undefined, options?: better_auth.ClientFetchOption | undefined) => Promise<{
4929
+ data: null;
4930
+ error: {
4931
+ message?: string | undefined;
4932
+ status: number;
4933
+ statusText: string;
4934
+ };
4935
+ } | {
4936
+ data: {
4937
+ session: {
4938
+ id: string;
4939
+ createdAt: Date;
4940
+ updatedAt: Date;
4941
+ userId: string;
4942
+ expiresAt: Date;
4943
+ token: string;
4944
+ ipAddress?: string | null | undefined;
4945
+ userAgent?: string | null | undefined;
4946
+ };
4947
+ user: {
4948
+ id: string;
4949
+ createdAt: Date;
4950
+ updatedAt: Date;
4951
+ email: string;
4952
+ emailVerified: boolean;
4953
+ name: string;
4954
+ image?: string | null | undefined;
4955
+ };
4956
+ };
4957
+ error: null;
4958
+ } | {
4959
+ data: null;
4960
+ error: {
4961
+ code: string;
4962
+ message: string;
4963
+ status: number;
4964
+ statusText: string;
4965
+ };
4966
+ } | {
4967
+ webauthn: {
4968
+ response: _simplewebauthn_server.AuthenticationResponseJSON;
4969
+ clientExtensionResults: _simplewebauthn_server.AuthenticationExtensionsClientOutputs;
4970
+ };
4971
+ data: null;
4972
+ error: {
4973
+ message?: string | undefined;
4974
+ status: number;
4975
+ statusText: string;
4976
+ };
4977
+ } | {
4978
+ webauthn: {
4979
+ response: _simplewebauthn_server.AuthenticationResponseJSON;
4980
+ clientExtensionResults: _simplewebauthn_server.AuthenticationExtensionsClientOutputs;
4981
+ };
4982
+ data: {
4983
+ session: {
4984
+ id: string;
4985
+ createdAt: Date;
4986
+ updatedAt: Date;
4987
+ userId: string;
4988
+ expiresAt: Date;
4989
+ token: string;
4990
+ ipAddress?: string | null | undefined;
4991
+ userAgent?: string | null | undefined;
4992
+ };
4993
+ user: {
4994
+ id: string;
4995
+ createdAt: Date;
4996
+ updatedAt: Date;
4997
+ email: string;
4998
+ emailVerified: boolean;
4999
+ name: string;
5000
+ image?: string | null | undefined;
5001
+ };
5002
+ };
5003
+ error: null;
5004
+ }>;
5005
+ };
5006
+ passkey: {
5007
+ addPasskey: (opts?: {
5008
+ fetchOptions?: better_auth.ClientFetchOption;
5009
+ name?: string;
5010
+ authenticatorAttachment?: "platform" | "cross-platform";
5011
+ context?: string | null;
5012
+ createSession?: boolean;
5013
+ extensions?: _simplewebauthn_server.AuthenticationExtensionsClientInputs;
5014
+ useAutoRegister?: boolean;
5015
+ returnWebAuthnResponse?: boolean;
5016
+ } | undefined, fetchOpts?: better_auth.ClientFetchOption | undefined) => Promise<{
5017
+ data: null;
5018
+ error: {
5019
+ message?: string | undefined;
5020
+ status: number;
5021
+ statusText: string;
5022
+ };
5023
+ } | {
5024
+ data: _better_auth_passkey.Passkey & {
5025
+ session?: {
5026
+ id: string;
5027
+ createdAt: Date;
5028
+ updatedAt: Date;
5029
+ userId: string;
5030
+ expiresAt: Date;
5031
+ token: string;
5032
+ ipAddress?: string | null | undefined;
5033
+ userAgent?: string | null | undefined;
5034
+ };
5035
+ user?: {
5036
+ id: string;
5037
+ createdAt: Date;
5038
+ updatedAt: Date;
5039
+ email: string;
5040
+ emailVerified: boolean;
5041
+ name: string;
5042
+ image?: string | null | undefined;
5043
+ };
5044
+ };
5045
+ error: null;
5046
+ } | {
5047
+ webauthn: {
5048
+ response: _simplewebauthn_server.RegistrationResponseJSON;
5049
+ clientExtensionResults: _simplewebauthn_server.AuthenticationExtensionsClientOutputs;
5050
+ };
5051
+ data: _better_auth_passkey.Passkey & {
5052
+ session?: {
5053
+ id: string;
5054
+ createdAt: Date;
5055
+ updatedAt: Date;
5056
+ userId: string;
5057
+ expiresAt: Date;
5058
+ token: string;
5059
+ ipAddress?: string | null | undefined;
5060
+ userAgent?: string | null | undefined;
5061
+ };
5062
+ user?: {
5063
+ id: string;
5064
+ createdAt: Date;
5065
+ updatedAt: Date;
5066
+ email: string;
5067
+ emailVerified: boolean;
5068
+ name: string;
5069
+ image?: string | null | undefined;
5070
+ };
5071
+ };
5072
+ error: null;
5073
+ } | {
5074
+ data: null;
5075
+ error: {
5076
+ code: string;
5077
+ message: string;
5078
+ status: number;
5079
+ statusText: string;
5080
+ };
5081
+ }>;
5082
+ };
5083
+ $Infer: {
5084
+ Passkey: _better_auth_passkey.Passkey;
5085
+ };
5086
+ };
5087
+ getAtoms($fetch: _better_fetch_fetch.BetterFetch): {
5088
+ listPasskeys: better_auth_client.AuthQueryAtom<_better_auth_passkey.Passkey[]>;
5089
+ $listPasskeys: nanostores.PreinitializedWritableAtom<any> & object;
5090
+ };
5091
+ pathMethods: {
5092
+ "/passkey/register": "POST";
5093
+ "/passkey/authenticate": "POST";
5094
+ };
5095
+ atomListeners: ({
5096
+ matcher(path: string): path is "/passkey/delete-passkey" | "/passkey/update-passkey" | "/passkey/verify-registration" | "/sign-out";
5097
+ signal: "$listPasskeys";
5098
+ } | {
5099
+ matcher: (path: string) => path is "/passkey/verify-authentication";
5100
+ signal: "$sessionSignal";
5101
+ })[];
5102
+ $ERROR_CODES: {
5103
+ CHALLENGE_NOT_FOUND: better_auth.RawError<"CHALLENGE_NOT_FOUND">;
5104
+ YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
5105
+ FAILED_TO_VERIFY_REGISTRATION: better_auth.RawError<"FAILED_TO_VERIFY_REGISTRATION">;
5106
+ PASSKEY_NOT_FOUND: better_auth.RawError<"PASSKEY_NOT_FOUND">;
5107
+ AUTHENTICATION_FAILED: better_auth.RawError<"AUTHENTICATION_FAILED">;
5108
+ UNABLE_TO_CREATE_SESSION: better_auth.RawError<"UNABLE_TO_CREATE_SESSION">;
5109
+ USER_NOT_FOUND: better_auth.RawError<"USER_NOT_FOUND">;
5110
+ FAILED_TO_UPDATE_PASSKEY: better_auth.RawError<"FAILED_TO_UPDATE_PASSKEY">;
5111
+ PREVIOUSLY_REGISTERED: better_auth.RawError<"PREVIOUSLY_REGISTERED">;
5112
+ REGISTRATION_CANCELLED: better_auth.RawError<"REGISTRATION_CANCELLED">;
5113
+ AUTH_CANCELLED: better_auth.RawError<"AUTH_CANCELLED">;
5114
+ UNKNOWN_ERROR: better_auth.RawError<"UNKNOWN_ERROR">;
5115
+ SESSION_REQUIRED: better_auth.RawError<"SESSION_REQUIRED">;
5116
+ RESOLVE_USER_REQUIRED: better_auth.RawError<"RESOLVE_USER_REQUIRED">;
5117
+ RESOLVED_USER_INVALID: better_auth.RawError<"RESOLVED_USER_INVALID">;
5118
+ };
5119
+ } | {
5120
+ id: "one-tap";
5121
+ version: string;
5122
+ fetchPlugins: {
5123
+ id: string;
5124
+ name: string;
5125
+ hooks: {
5126
+ onResponse(ctx: _better_fetch_fetch.ResponseContext): Promise<void>;
5127
+ };
5128
+ }[];
5129
+ getActions: ($fetch: _better_fetch_fetch.BetterFetch, _$store: better_auth.ClientStore, _options: better_auth.BetterAuthClientOptions | undefined) => {
5130
+ oneTap: (opts?: better_auth_client_plugins.GoogleOneTapActionOptions | undefined, fetchOptions?: better_auth.ClientFetchOption | undefined) => Promise<void>;
5131
+ };
5132
+ getAtoms($fetch: _better_fetch_fetch.BetterFetch): {};
5133
+ })[];
5134
+ }, FetchOptions>>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<(Omit<{
5135
+ token: null;
5136
+ user: {
5137
+ id: string;
5138
+ createdAt: Date;
5139
+ updatedAt: Date;
5140
+ email: string;
5141
+ emailVerified: boolean;
5142
+ name: string;
5143
+ image?: string | null | undefined | undefined;
5144
+ };
5145
+ }, "user"> & {
5146
+ user: better_auth.StripEmptyObjects<{
5147
+ id: string;
5148
+ createdAt: Date;
5149
+ updatedAt: Date;
5150
+ email: string;
5151
+ emailVerified: boolean;
5152
+ name: string;
5153
+ image?: string | null | undefined;
5154
+ } & {
5155
+ banned: boolean | null | undefined;
5156
+ } & {
5157
+ role?: string | null | undefined;
5158
+ banReason?: string | null | undefined;
5159
+ banExpires?: Date | null | undefined;
5160
+ } & {
5161
+ twoFactorEnabled: boolean | null | undefined;
5162
+ } & {}>;
5163
+ }) | (Omit<{
5164
+ token: string;
5165
+ user: {
5166
+ id: string;
5167
+ createdAt: Date;
5168
+ updatedAt: Date;
5169
+ email: string;
5170
+ emailVerified: boolean;
5171
+ name: string;
5172
+ image?: string | null | undefined | undefined;
5173
+ };
5174
+ }, "user"> & {
5175
+ user: better_auth.StripEmptyObjects<{
5176
+ id: string;
5177
+ createdAt: Date;
5178
+ updatedAt: Date;
5179
+ email: string;
5180
+ emailVerified: boolean;
5181
+ name: string;
5182
+ image?: string | null | undefined;
5183
+ } & {
5184
+ banned: boolean | null | undefined;
5185
+ } & {
5186
+ role?: string | null | undefined;
5187
+ banReason?: string | null | undefined;
5188
+ banExpires?: Date | null | undefined;
5189
+ } & {
5190
+ twoFactorEnabled: boolean | null | undefined;
5191
+ } & {}>;
5192
+ }), {
5193
+ code?: string | undefined;
5194
+ message?: string | undefined;
5195
+ }, FetchOptions["throw"] extends true ? true : false>>;
5196
+ };
2424
5197
 
2425
5198
  export { authClient, signIn, signOut, signUp, useSession };