@xk2800/nextjs-template 0.7.2-beta.7 → 0.7.2-beta.9

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 (127) hide show
  1. package/README.md +1 -0
  2. package/components/auth/forms/signup-form.tsx +3 -0
  3. package/components/dashboard/admin/activity-logs/admin-activity-logs-table.tsx +1 -1
  4. package/components/dashboard/admin/users/impersonation-tab.tsx +1 -1
  5. package/components/dashboard/layout/app-sidebar.tsx +7 -2
  6. package/components/dashboard/layout/mobile-nav.tsx +95 -0
  7. package/components/dashboard/layout/top-nav.tsx +14 -33
  8. package/components/dashboard/settings/activity-logs-card.tsx +1 -1
  9. package/dist/activity/logger.d.mts +2 -1
  10. package/dist/activity/logger.d.ts +2 -1
  11. package/dist/activity/logger.js +64 -13
  12. package/dist/activity/logger.js.map +1 -1
  13. package/dist/activity/logger.mjs +4 -4
  14. package/dist/activity/queries.d.mts +25 -18
  15. package/dist/activity/queries.d.ts +25 -18
  16. package/dist/activity/queries.js +73 -20
  17. package/dist/activity/queries.js.map +1 -1
  18. package/dist/activity/queries.mjs +15 -13
  19. package/dist/activity/queries.mjs.map +1 -1
  20. package/dist/admin/queries.d.mts +2 -1
  21. package/dist/admin/queries.d.ts +2 -1
  22. package/dist/admin/queries.js +44 -13
  23. package/dist/admin/queries.js.map +1 -1
  24. package/dist/admin/queries.mjs +7 -7
  25. package/dist/admin/queries.mjs.map +1 -1
  26. package/dist/api/feedback.js +247 -224
  27. package/dist/api/feedback.js.map +1 -1
  28. package/dist/api/feedback.mjs +14 -12
  29. package/dist/api/feedback.mjs.map +1 -1
  30. package/dist/api/marketing.js +262 -239
  31. package/dist/api/marketing.js.map +1 -1
  32. package/dist/api/marketing.mjs +14 -23
  33. package/dist/api/marketing.mjs.map +1 -1
  34. package/dist/auth/helpers.d.mts +54 -12
  35. package/dist/auth/helpers.d.ts +54 -12
  36. package/dist/auth/helpers.js +276 -242
  37. package/dist/auth/helpers.js.map +1 -1
  38. package/dist/auth/helpers.mjs +9 -9
  39. package/dist/auth/index.d.mts +68 -47
  40. package/dist/auth/index.d.ts +68 -47
  41. package/dist/auth/index.js +242 -221
  42. package/dist/auth/index.js.map +1 -1
  43. package/dist/auth/index.mjs +8 -8
  44. package/dist/auth-client/index.d.mts +1215 -2527
  45. package/dist/auth-client/index.d.ts +1215 -2527
  46. package/dist/auth-client/index.js +37 -3
  47. package/dist/auth-client/index.js.map +1 -1
  48. package/dist/auth-client/index.mjs +19 -3
  49. package/dist/auth-client/index.mjs.map +1 -1
  50. package/dist/{chunk-M6Y2XNJC.mjs → chunk-3BH6BVBQ.mjs} +16 -6
  51. package/dist/chunk-3BH6BVBQ.mjs.map +1 -0
  52. package/dist/chunk-D56ENLSX.mjs +6 -0
  53. package/dist/chunk-D56ENLSX.mjs.map +1 -0
  54. package/dist/{chunk-HUEDEAY3.mjs → chunk-DCPVEZS7.mjs} +14 -4
  55. package/dist/chunk-DCPVEZS7.mjs.map +1 -0
  56. package/dist/{chunk-J5XRJ2GW.mjs → chunk-DWLMCMXF.mjs} +4 -4
  57. package/dist/{chunk-J5XRJ2GW.mjs.map → chunk-DWLMCMXF.mjs.map} +1 -1
  58. package/dist/{chunk-AOSJUQQG.mjs → chunk-EXMUANQ3.mjs} +4 -4
  59. package/dist/{chunk-AOSJUQQG.mjs.map → chunk-EXMUANQ3.mjs.map} +1 -1
  60. package/dist/{chunk-NOFQCVHC.mjs → chunk-IH6CMZIN.mjs} +195 -215
  61. package/dist/chunk-IH6CMZIN.mjs.map +1 -0
  62. package/dist/chunk-LADVCLEQ.mjs +43 -0
  63. package/dist/chunk-LADVCLEQ.mjs.map +1 -0
  64. package/dist/{chunk-TMANA7KL.mjs → chunk-NJBRKKLK.mjs} +9 -6
  65. package/dist/chunk-NJBRKKLK.mjs.map +1 -0
  66. package/dist/{chunk-JRDMU6I2.mjs → chunk-QDUPSU5O.mjs} +3 -3
  67. package/dist/chunk-QDUPSU5O.mjs.map +1 -0
  68. package/dist/{chunk-2BKXG4MG.mjs → chunk-S23GC776.mjs} +38 -27
  69. package/dist/chunk-S23GC776.mjs.map +1 -0
  70. package/dist/{chunk-CRDC62BU.mjs → chunk-TIR7KHXL.mjs} +3 -3
  71. package/dist/{chunk-CRDC62BU.mjs.map → chunk-TIR7KHXL.mjs.map} +1 -1
  72. package/dist/{chunk-JSB36AY6.mjs → chunk-ZOQHHFYA.mjs} +7 -4
  73. package/dist/chunk-ZOQHHFYA.mjs.map +1 -0
  74. package/dist/config/env.d.mts +3 -0
  75. package/dist/config/env.d.ts +3 -0
  76. package/dist/config/env.js +12 -2
  77. package/dist/config/env.js.map +1 -1
  78. package/dist/config/env.mjs +1 -1
  79. package/dist/db/index.d.mts +3 -7
  80. package/dist/db/index.d.ts +3 -7
  81. package/dist/db/index.js +60 -11
  82. package/dist/db/index.js.map +1 -1
  83. package/dist/db/index.mjs +3 -3
  84. package/dist/db/schema.d.mts +1 -1
  85. package/dist/db/schema.d.ts +1 -1
  86. package/dist/db/schema.js +13 -3
  87. package/dist/db/schema.js.map +1 -1
  88. package/dist/db/schema.mjs +1 -1
  89. package/dist/errors.d.mts +2 -1
  90. package/dist/errors.d.ts +2 -1
  91. package/dist/errors.js +60 -11
  92. package/dist/errors.js.map +1 -1
  93. package/dist/errors.mjs +4 -4
  94. package/dist/marketing/index.d.mts +4 -3
  95. package/dist/marketing/index.d.ts +4 -3
  96. package/dist/marketing/index.js +12 -2
  97. package/dist/marketing/index.js.map +1 -1
  98. package/dist/marketing/index.mjs +3 -3
  99. package/dist/{schema-DzC5zdOq.d.mts → schema-BujGgvAy.d.mts} +35 -2
  100. package/dist/{schema-DzC5zdOq.d.ts → schema-BujGgvAy.d.ts} +35 -2
  101. package/dist/sessions/queries.js +60 -11
  102. package/dist/sessions/queries.js.map +1 -1
  103. package/dist/sessions/queries.mjs +3 -3
  104. package/dist/settings/queries.d.mts +3 -2
  105. package/dist/settings/queries.d.ts +3 -2
  106. package/dist/settings/queries.js +46 -12
  107. package/dist/settings/queries.js.map +1 -1
  108. package/dist/settings/queries.mjs +4 -4
  109. package/dist/users/queries.d.mts +24 -19
  110. package/dist/users/queries.d.ts +24 -19
  111. package/dist/users/queries.js +48 -13
  112. package/dist/users/queries.js.map +1 -1
  113. package/dist/users/queries.mjs +8 -6
  114. package/dist/users/queries.mjs.map +1 -1
  115. package/lib/auth/client.ts +22 -2
  116. package/lib/utils/request-info.ts +7 -3
  117. package/package.json +65 -59
  118. package/scripts/check-deps.mjs +67 -0
  119. package/dist/chunk-2BKXG4MG.mjs.map +0 -1
  120. package/dist/chunk-HUEDEAY3.mjs.map +0 -1
  121. package/dist/chunk-JRDMU6I2.mjs.map +0 -1
  122. package/dist/chunk-JSB36AY6.mjs.map +0 -1
  123. package/dist/chunk-M6Y2XNJC.mjs.map +0 -1
  124. package/dist/chunk-NOFQCVHC.mjs.map +0 -1
  125. package/dist/chunk-RLZ7F7ZY.mjs +0 -30
  126. package/dist/chunk-RLZ7F7ZY.mjs.map +0 -1
  127. package/dist/chunk-TMANA7KL.mjs.map +0 -1
@@ -19,7 +19,7 @@ declare const authClient: better_auth_react.ReactAuthClient<{
19
19
  $InferServerPlugin: {
20
20
  id: "admin";
21
21
  version: string;
22
- init(): {
22
+ init(authContext: better_auth.AuthContext): {
23
23
  options: {
24
24
  databaseHooks: {
25
25
  user: {
@@ -826,7 +826,7 @@ declare const authClient: better_auth_react.ReactAuthClient<{
826
826
  $Infer: {
827
827
  body: {
828
828
  permissions: {
829
- readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "get" | "update")[] | undefined;
829
+ readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "set-phone" | "get" | "update")[] | undefined;
830
830
  readonly session?: ("list" | "delete" | "revoke")[] | undefined;
831
831
  };
832
832
  } & {
@@ -863,7 +863,9 @@ declare const authClient: better_auth_react.ReactAuthClient<{
863
863
  YOU_CANNOT_IMPERSONATE_ADMINS: better_auth.RawError<"YOU_CANNOT_IMPERSONATE_ADMINS">;
864
864
  INVALID_ROLE_TYPE: better_auth.RawError<"INVALID_ROLE_TYPE">;
865
865
  YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL">;
866
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PHONE_NUMBER: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PHONE_NUMBER">;
866
867
  PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER: better_auth.RawError<"PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER">;
868
+ USER_ID_CANNOT_BE_UPDATED: better_auth.RawError<"USER_ID_CANNOT_BE_UPDATED">;
867
869
  };
868
870
  schema: {
869
871
  user: {
@@ -903,7 +905,7 @@ declare const authClient: better_auth_react.ReactAuthClient<{
903
905
  };
904
906
  options: NoInfer<{
905
907
  ac: better_auth_plugins.AccessControl<{
906
- readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "impersonate-admins", "delete", "set-password", "set-email", "get", "update"];
908
+ readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "impersonate-admins", "delete", "set-password", "set-email", "set-phone", "get", "update"];
907
909
  readonly session: readonly ["list", "revoke", "delete"];
908
910
  }>;
909
911
  roles: {
@@ -916,7 +918,7 @@ declare const authClient: better_auth_react.ReactAuthClient<{
916
918
  admin: {
917
919
  checkRolePermission: <R extends "user" | "admin">(data: {
918
920
  permissions: {
919
- readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "get" | "update")[] | undefined;
921
+ readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "set-phone" | "get" | "update")[] | undefined;
920
922
  readonly session?: ("list" | "delete" | "revoke")[] | undefined;
921
923
  };
922
924
  } & {
@@ -956,32 +958,65 @@ declare const authClient: better_auth_react.ReactAuthClient<{
956
958
  YOU_CANNOT_IMPERSONATE_ADMINS: better_auth.RawError<"YOU_CANNOT_IMPERSONATE_ADMINS">;
957
959
  INVALID_ROLE_TYPE: better_auth.RawError<"INVALID_ROLE_TYPE">;
958
960
  YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL">;
961
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PHONE_NUMBER: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PHONE_NUMBER">;
959
962
  PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER: better_auth.RawError<"PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER">;
963
+ USER_ID_CANNOT_BE_UPDATED: better_auth.RawError<"USER_ID_CANNOT_BE_UPDATED">;
960
964
  };
961
965
  } | {
962
966
  id: "two-factor";
963
967
  version: string;
964
- $InferServerPlugin: ReturnType<(<O extends better_auth_plugins.TwoFactorOptions>(options?: O) => {
965
- id: "two-factor";
968
+ $InferServerPlugin: ReturnType<typeof better_auth_plugins.twoFactor>;
969
+ atomListeners: {
970
+ matcher: (path: string) => boolean;
971
+ signal: "$sessionSignal";
972
+ }[];
973
+ pathMethods: {
974
+ "/two-factor/disable": "POST";
975
+ "/two-factor/enable": "POST";
976
+ "/two-factor/send-otp": "POST";
977
+ "/two-factor/generate-backup-codes": "POST";
978
+ "/two-factor/get-totp-uri": "POST";
979
+ "/two-factor/verify-totp": "POST";
980
+ "/two-factor/verify-otp": "POST";
981
+ "/two-factor/verify-backup-code": "POST";
982
+ };
983
+ fetchPlugins: {
984
+ id: string;
985
+ name: string;
986
+ hooks: {
987
+ onSuccess(context: _better_fetch_fetch.SuccessContext<any>): Promise<void>;
988
+ };
989
+ }[];
990
+ $ERROR_CODES: {
991
+ OTP_NOT_ENABLED: better_auth.RawError<"OTP_NOT_ENABLED">;
992
+ OTP_NOT_CONFIGURED: better_auth.RawError<"OTP_NOT_CONFIGURED">;
993
+ OTP_HAS_EXPIRED: better_auth.RawError<"OTP_HAS_EXPIRED">;
994
+ TOTP_NOT_ENABLED: better_auth.RawError<"TOTP_NOT_ENABLED">;
995
+ TOTP_ALREADY_ENABLED: better_auth.RawError<"TOTP_ALREADY_ENABLED">;
996
+ TOTP_NOT_CONFIGURED: better_auth.RawError<"TOTP_NOT_CONFIGURED">;
997
+ TWO_FACTOR_NOT_ENABLED: better_auth.RawError<"TWO_FACTOR_NOT_ENABLED">;
998
+ BACKUP_CODES_NOT_ENABLED: better_auth.RawError<"BACKUP_CODES_NOT_ENABLED">;
999
+ INVALID_BACKUP_CODE: better_auth.RawError<"INVALID_BACKUP_CODE">;
1000
+ INVALID_CODE: better_auth.RawError<"INVALID_CODE">;
1001
+ TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: better_auth.RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
1002
+ ACCOUNT_TEMPORARILY_LOCKED: better_auth.RawError<"ACCOUNT_TEMPORARILY_LOCKED">;
1003
+ INVALID_TWO_FACTOR_COOKIE: better_auth.RawError<"INVALID_TWO_FACTOR_COOKIE">;
1004
+ };
1005
+ } | {
1006
+ id: "passkey";
1007
+ version: string;
1008
+ $InferServerPlugin: ReturnType<(options?: _better_auth_passkey.PasskeyOptions | undefined) => {
1009
+ id: "passkey";
966
1010
  version: string;
1011
+ init(ctx: better_auth.AuthContext): {
1012
+ context: {
1013
+ passkeyBaseURLFromRequest: boolean;
1014
+ passkeyWildcardCoversRpID: boolean;
1015
+ };
1016
+ };
967
1017
  endpoints: {
968
- enableTwoFactor: better_call.StrictEndpoint<"/two-factor/enable", {
969
- method: "POST";
970
- body: zod.ZodObject<{
971
- password: zod.ZodOptional<zod.ZodString>;
972
- method: zod.ZodDefault<zod.ZodEnum<{
973
- otp: "otp";
974
- totp: "totp";
975
- }>>;
976
- issuer: zod.ZodOptional<zod.ZodString>;
977
- }, zod_v4_core.$strip> | zod.ZodObject<{
978
- password: zod.ZodString;
979
- method: zod.ZodDefault<zod.ZodEnum<{
980
- otp: "otp";
981
- totp: "totp";
982
- }>>;
983
- issuer: zod.ZodOptional<zod.ZodString>;
984
- }, zod_v4_core.$strip>;
1018
+ generatePasskeyRegistrationOptions: better_call.StrictEndpoint<"/passkey/generate-register-options", {
1019
+ method: "GET";
985
1020
  use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
986
1021
  session: {
987
1022
  session: Record<string, any> & {
@@ -1005,10 +1040,19 @@ declare const authClient: better_auth_react.ReactAuthClient<{
1005
1040
  };
1006
1041
  };
1007
1042
  }>>[];
1043
+ query: zod.ZodOptional<zod.ZodObject<{
1044
+ authenticatorAttachment: zod.ZodOptional<zod.ZodEnum<{
1045
+ platform: "platform";
1046
+ "cross-platform": "cross-platform";
1047
+ }>>;
1048
+ name: zod.ZodOptional<zod.ZodString>;
1049
+ context: zod.ZodOptional<zod.ZodString>;
1050
+ }, zod_v4_core.$strip>>;
1008
1051
  metadata: {
1009
1052
  openapi: {
1010
- summary: string;
1053
+ operationId: string;
1011
1054
  description: string;
1055
+ parameters: better_call.OpenAPIParameter[];
1012
1056
  responses: {
1013
1057
  200: {
1014
1058
  description: string;
@@ -1017,24 +1061,92 @@ declare const authClient: better_auth_react.ReactAuthClient<{
1017
1061
  schema: {
1018
1062
  type: "object";
1019
1063
  properties: {
1020
- method: {
1064
+ challenge: {
1021
1065
  type: string;
1022
- enum: string[];
1023
- description: string;
1024
1066
  };
1025
- totpURI: {
1067
+ rp: {
1068
+ type: string;
1069
+ properties: {
1070
+ name: {
1071
+ type: string;
1072
+ };
1073
+ id: {
1074
+ type: string;
1075
+ };
1076
+ };
1077
+ };
1078
+ user: {
1079
+ type: string;
1080
+ properties: {
1081
+ id: {
1082
+ type: string;
1083
+ };
1084
+ name: {
1085
+ type: string;
1086
+ };
1087
+ displayName: {
1088
+ type: string;
1089
+ };
1090
+ };
1091
+ };
1092
+ pubKeyCredParams: {
1093
+ type: string;
1094
+ items: {
1095
+ type: string;
1096
+ properties: {
1097
+ type: {
1098
+ type: string;
1099
+ };
1100
+ alg: {
1101
+ type: string;
1102
+ };
1103
+ };
1104
+ };
1105
+ };
1106
+ timeout: {
1026
1107
  type: string;
1027
- description: string;
1028
1108
  };
1029
- backupCodes: {
1109
+ excludeCredentials: {
1030
1110
  type: string;
1031
1111
  items: {
1032
1112
  type: string;
1113
+ properties: {
1114
+ id: {
1115
+ type: string;
1116
+ };
1117
+ type: {
1118
+ type: string;
1119
+ };
1120
+ transports: {
1121
+ type: string;
1122
+ items: {
1123
+ type: string;
1124
+ };
1125
+ };
1126
+ };
1127
+ };
1128
+ };
1129
+ authenticatorSelection: {
1130
+ type: string;
1131
+ properties: {
1132
+ authenticatorAttachment: {
1133
+ type: string;
1134
+ };
1135
+ requireResidentKey: {
1136
+ type: string;
1137
+ };
1138
+ userVerification: {
1139
+ type: string;
1140
+ };
1033
1141
  };
1034
- description: string;
1142
+ };
1143
+ attestation: {
1144
+ type: string;
1145
+ };
1146
+ extensions: {
1147
+ type: string;
1035
1148
  };
1036
1149
  };
1037
- required: string[];
1038
1150
  };
1039
1151
  };
1040
1152
  };
@@ -1042,46 +1154,12 @@ declare const authClient: better_auth_react.ReactAuthClient<{
1042
1154
  };
1043
1155
  };
1044
1156
  };
1045
- }, {
1046
- method: "otp";
1047
- } | {
1048
- method: "totp";
1049
- totpURI: string;
1050
- backupCodes: string[];
1051
- }>;
1052
- disableTwoFactor: better_call.StrictEndpoint<"/two-factor/disable", {
1053
- method: "POST";
1054
- body: zod.ZodObject<{
1055
- password: zod.ZodOptional<zod.ZodString>;
1056
- }, zod_v4_core.$strip> | zod.ZodObject<{
1057
- password: zod.ZodString;
1058
- }, zod_v4_core.$strip>;
1059
- use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
1060
- session: {
1061
- session: Record<string, any> & {
1062
- id: string;
1063
- createdAt: Date;
1064
- updatedAt: Date;
1065
- userId: string;
1066
- expiresAt: Date;
1067
- token: string;
1068
- ipAddress?: string | null | undefined;
1069
- userAgent?: string | null | undefined;
1070
- };
1071
- user: Record<string, any> & {
1072
- id: string;
1073
- createdAt: Date;
1074
- updatedAt: Date;
1075
- email: string;
1076
- emailVerified: boolean;
1077
- name: string;
1078
- image?: string | null | undefined;
1079
- };
1080
- };
1081
- }>>[];
1157
+ }, _simplewebauthn_server.PublicKeyCredentialCreationOptionsJSON>;
1158
+ generatePasskeyAuthenticationOptions: better_call.StrictEndpoint<"/passkey/generate-authenticate-options", {
1159
+ method: "GET";
1082
1160
  metadata: {
1083
1161
  openapi: {
1084
- summary: string;
1162
+ operationId: string;
1085
1163
  description: string;
1086
1164
  responses: {
1087
1165
  200: {
@@ -1091,112 +1169,78 @@ declare const authClient: better_auth_react.ReactAuthClient<{
1091
1169
  schema: {
1092
1170
  type: "object";
1093
1171
  properties: {
1094
- status: {
1172
+ challenge: {
1095
1173
  type: string;
1096
1174
  };
1097
- };
1098
- };
1099
- };
1100
- };
1101
- };
1102
- };
1103
- };
1104
- };
1105
- }, {
1106
- status: boolean;
1107
- }>;
1108
- verifyBackupCode: better_call.StrictEndpoint<"/two-factor/verify-backup-code", {
1109
- method: "POST";
1110
- body: zod.ZodObject<{
1111
- code: zod.ZodString;
1112
- disableSession: zod.ZodOptional<zod.ZodBoolean>;
1113
- trustDevice: zod.ZodOptional<zod.ZodBoolean>;
1114
- }, zod_v4_core.$strip>;
1115
- metadata: {
1116
- openapi: {
1117
- description: string;
1118
- responses: {
1119
- "200": {
1120
- description: string;
1121
- content: {
1122
- "application/json": {
1123
- schema: {
1124
- type: "object";
1125
- properties: {
1126
- user: {
1175
+ rp: {
1127
1176
  type: string;
1128
1177
  properties: {
1129
- id: {
1178
+ name: {
1130
1179
  type: string;
1131
- description: string;
1132
1180
  };
1133
- email: {
1181
+ id: {
1134
1182
  type: string;
1135
- format: string;
1136
- nullable: boolean;
1137
- description: string;
1138
1183
  };
1139
- emailVerified: {
1184
+ };
1185
+ };
1186
+ user: {
1187
+ type: string;
1188
+ properties: {
1189
+ id: {
1140
1190
  type: string;
1141
- nullable: boolean;
1142
- description: string;
1143
1191
  };
1144
1192
  name: {
1145
1193
  type: string;
1146
- nullable: boolean;
1147
- description: string;
1148
1194
  };
1149
- image: {
1150
- type: string;
1151
- format: string;
1152
- nullable: boolean;
1153
- description: string;
1154
- };
1155
- twoFactorEnabled: {
1156
- type: string;
1157
- description: string;
1158
- };
1159
- createdAt: {
1195
+ displayName: {
1160
1196
  type: string;
1161
- format: string;
1162
- description: string;
1163
1197
  };
1164
- updatedAt: {
1165
- type: string;
1166
- format: string;
1167
- description: string;
1198
+ };
1199
+ };
1200
+ timeout: {
1201
+ type: string;
1202
+ };
1203
+ allowCredentials: {
1204
+ type: string;
1205
+ items: {
1206
+ type: string;
1207
+ properties: {
1208
+ id: {
1209
+ type: string;
1210
+ };
1211
+ type: {
1212
+ type: string;
1213
+ };
1214
+ transports: {
1215
+ type: string;
1216
+ items: {
1217
+ type: string;
1218
+ };
1219
+ };
1168
1220
  };
1169
1221
  };
1170
- required: string[];
1171
- description: string;
1172
1222
  };
1173
- session: {
1223
+ userVerification: {
1224
+ type: string;
1225
+ };
1226
+ authenticatorSelection: {
1174
1227
  type: string;
1175
1228
  properties: {
1176
- token: {
1177
- type: string;
1178
- description: string;
1179
- };
1180
- userId: {
1229
+ authenticatorAttachment: {
1181
1230
  type: string;
1182
- description: string;
1183
1231
  };
1184
- createdAt: {
1232
+ requireResidentKey: {
1185
1233
  type: string;
1186
- format: string;
1187
- description: string;
1188
1234
  };
1189
- expiresAt: {
1235
+ userVerification: {
1190
1236
  type: string;
1191
- format: string;
1192
- description: string;
1193
1237
  };
1194
1238
  };
1195
- required: string[];
1196
- description: string;
1239
+ };
1240
+ extensions: {
1241
+ type: string;
1197
1242
  };
1198
1243
  };
1199
- required: string[];
1200
1244
  };
1201
1245
  };
1202
1246
  };
@@ -1204,24 +1248,13 @@ declare const authClient: better_auth_react.ReactAuthClient<{
1204
1248
  };
1205
1249
  };
1206
1250
  };
1207
- }, {
1208
- token: string | undefined;
1209
- user: (Record<string, any> & {
1210
- id: string;
1211
- createdAt: Date;
1212
- updatedAt: Date;
1213
- email: string;
1214
- emailVerified: boolean;
1215
- name: string;
1216
- image?: string | null | undefined;
1217
- }) | better_auth_plugins.UserWithTwoFactor;
1218
- }>;
1219
- generateBackupCodes: better_call.StrictEndpoint<"/two-factor/generate-backup-codes", {
1251
+ }, _simplewebauthn_server.PublicKeyCredentialRequestOptionsJSON>;
1252
+ verifyPasskeyRegistration: better_call.StrictEndpoint<"/passkey/verify-registration", {
1220
1253
  method: "POST";
1221
1254
  body: zod.ZodObject<{
1222
- password: zod.ZodOptional<zod.ZodString>;
1223
- }, zod_v4_core.$strip> | zod.ZodObject<{
1224
- password: zod.ZodString;
1255
+ response: zod.ZodAny;
1256
+ name: zod.ZodOptional<zod.ZodString>;
1257
+ createSession: zod.ZodOptional<zod.ZodBoolean>;
1225
1258
  }, zod_v4_core.$strip>;
1226
1259
  use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
1227
1260
  session: {
@@ -1248,160 +1281,87 @@ declare const authClient: better_auth_react.ReactAuthClient<{
1248
1281
  }>>[];
1249
1282
  metadata: {
1250
1283
  openapi: {
1284
+ operationId: string;
1251
1285
  description: string;
1252
1286
  responses: {
1253
- "200": {
1287
+ 200: {
1254
1288
  description: string;
1255
1289
  content: {
1256
1290
  "application/json": {
1257
1291
  schema: {
1258
- type: "object";
1259
- properties: {
1260
- status: {
1261
- type: string;
1262
- description: string;
1263
- enum: boolean[];
1264
- };
1265
- backupCodes: {
1266
- type: string;
1267
- items: {
1268
- type: string;
1292
+ readonly type: "object";
1293
+ readonly allOf: readonly [{
1294
+ readonly $ref: "#/components/schemas/Passkey";
1295
+ }, {
1296
+ readonly type: "object";
1297
+ readonly properties: {
1298
+ readonly session: {
1299
+ readonly $ref: "#/components/schemas/Session";
1300
+ };
1301
+ readonly user: {
1302
+ readonly $ref: "#/components/schemas/User";
1269
1303
  };
1270
- description: string;
1271
1304
  };
1272
- };
1273
- required: string[];
1305
+ }];
1274
1306
  };
1275
1307
  };
1276
1308
  };
1277
1309
  };
1278
- };
1279
- };
1280
- };
1281
- }, {
1282
- status: boolean;
1283
- backupCodes: string[];
1284
- }>;
1285
- viewBackupCodes: better_call.StrictEndpoint<string, {
1286
- method: "POST";
1287
- body: zod.ZodObject<{
1288
- userId: zod.ZodCoercedString<unknown>;
1289
- }, zod_v4_core.$strip>;
1290
- }, {
1291
- status: boolean;
1292
- backupCodes: string[];
1293
- }>;
1294
- sendTwoFactorOTP: better_call.StrictEndpoint<"/two-factor/send-otp", {
1295
- method: "POST";
1296
- body: zod.ZodOptional<zod.ZodObject<{
1297
- trustDevice: zod.ZodOptional<zod.ZodBoolean>;
1298
- }, zod_v4_core.$strip>>;
1299
- metadata: {
1300
- openapi: {
1301
- summary: string;
1302
- description: string;
1303
- responses: {
1304
- 200: {
1310
+ 400: {
1305
1311
  description: string;
1306
- content: {
1307
- "application/json": {
1308
- schema: {
1309
- type: "object";
1310
- properties: {
1311
- status: {
1312
- type: string;
1313
- };
1314
- };
1315
- };
1316
- };
1317
- };
1318
1312
  };
1319
1313
  };
1320
1314
  };
1321
1315
  };
1322
- }, {
1323
- status: boolean;
1324
- }>;
1325
- verifyTwoFactorOTP: better_call.StrictEndpoint<"/two-factor/verify-otp", {
1316
+ }, _better_auth_passkey.Passkey>;
1317
+ verifyPasskeyAuthentication: better_call.StrictEndpoint<"/passkey/verify-authentication", {
1326
1318
  method: "POST";
1327
1319
  body: zod.ZodObject<{
1328
- code: zod.ZodString;
1329
- trustDevice: zod.ZodOptional<zod.ZodBoolean>;
1320
+ response: zod.ZodRecord<zod.ZodAny, zod.ZodAny>;
1330
1321
  }, zod_v4_core.$strip>;
1331
1322
  metadata: {
1332
1323
  openapi: {
1333
- summary: string;
1324
+ operationId: string;
1334
1325
  description: string;
1335
1326
  responses: {
1336
- "200": {
1327
+ 200: {
1337
1328
  description: string;
1338
1329
  content: {
1339
1330
  "application/json": {
1340
1331
  schema: {
1341
1332
  type: "object";
1342
1333
  properties: {
1343
- token: {
1344
- type: string;
1345
- description: string;
1334
+ session: {
1335
+ $ref: string;
1346
1336
  };
1347
1337
  user: {
1348
- type: string;
1349
- properties: {
1350
- id: {
1351
- type: string;
1352
- description: string;
1353
- };
1354
- email: {
1355
- type: string;
1356
- format: string;
1357
- nullable: boolean;
1358
- description: string;
1359
- };
1360
- emailVerified: {
1361
- type: string;
1362
- nullable: boolean;
1363
- description: string;
1364
- };
1365
- name: {
1366
- type: string;
1367
- nullable: boolean;
1368
- description: string;
1369
- };
1370
- image: {
1371
- type: string;
1372
- format: string;
1373
- nullable: boolean;
1374
- description: string;
1375
- };
1376
- createdAt: {
1377
- type: string;
1378
- format: string;
1379
- description: string;
1380
- };
1381
- updatedAt: {
1382
- type: string;
1383
- format: string;
1384
- description: string;
1385
- };
1386
- };
1387
- required: string[];
1388
- description: string;
1338
+ $ref: string;
1389
1339
  };
1390
1340
  };
1391
- required: string[];
1392
1341
  };
1393
1342
  };
1394
1343
  };
1395
1344
  };
1396
1345
  };
1397
1346
  };
1347
+ $Infer: {
1348
+ body: {
1349
+ response: _simplewebauthn_server.AuthenticationResponseJSON;
1350
+ };
1351
+ };
1398
1352
  };
1399
1353
  }, {
1400
- token: string;
1401
- user: better_auth_plugins.UserWithTwoFactor;
1402
- } | {
1403
- token: string;
1404
- user: Record<string, any> & {
1354
+ session: {
1355
+ id: string;
1356
+ createdAt: Date;
1357
+ updatedAt: Date;
1358
+ userId: string;
1359
+ expiresAt: Date;
1360
+ token: string;
1361
+ ipAddress?: string | null | undefined;
1362
+ userAgent?: string | null | undefined;
1363
+ };
1364
+ user: {
1405
1365
  id: string;
1406
1366
  createdAt: Date;
1407
1367
  updatedAt: Date;
@@ -1411,27 +1371,46 @@ declare const authClient: better_auth_react.ReactAuthClient<{
1411
1371
  image?: string | null | undefined;
1412
1372
  };
1413
1373
  }>;
1414
- generateTOTP: better_call.StrictEndpoint<string, {
1415
- method: "POST";
1416
- body: zod.ZodObject<{
1417
- secret: zod.ZodString;
1418
- }, zod_v4_core.$strip>;
1374
+ listPasskeys: better_call.StrictEndpoint<"/passkey/list-user-passkeys", {
1375
+ method: "GET";
1376
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
1377
+ session: {
1378
+ session: Record<string, any> & {
1379
+ id: string;
1380
+ createdAt: Date;
1381
+ updatedAt: Date;
1382
+ userId: string;
1383
+ expiresAt: Date;
1384
+ token: string;
1385
+ ipAddress?: string | null | undefined;
1386
+ userAgent?: string | null | undefined;
1387
+ };
1388
+ user: Record<string, any> & {
1389
+ id: string;
1390
+ createdAt: Date;
1391
+ updatedAt: Date;
1392
+ email: string;
1393
+ emailVerified: boolean;
1394
+ name: string;
1395
+ image?: string | null | undefined;
1396
+ };
1397
+ };
1398
+ }>>[];
1419
1399
  metadata: {
1420
1400
  openapi: {
1421
- summary: string;
1422
1401
  description: string;
1423
1402
  responses: {
1424
- 200: {
1403
+ "200": {
1425
1404
  description: string;
1426
1405
  content: {
1427
1406
  "application/json": {
1428
1407
  schema: {
1429
- type: "object";
1430
- properties: {
1431
- code: {
1432
- type: string;
1433
- };
1408
+ type: "array";
1409
+ items: {
1410
+ $ref: string;
1411
+ required: string[];
1434
1412
  };
1413
+ description: string;
1435
1414
  };
1436
1415
  };
1437
1416
  };
@@ -1439,12 +1418,13 @@ declare const authClient: better_auth_react.ReactAuthClient<{
1439
1418
  };
1440
1419
  };
1441
1420
  };
1442
- }, {
1443
- code: string;
1444
- }>;
1445
- getTOTPURI: better_call.StrictEndpoint<"/two-factor/get-totp-uri", {
1421
+ }, _better_auth_passkey.Passkey[]>;
1422
+ deletePasskey: better_call.StrictEndpoint<"/passkey/delete-passkey", {
1446
1423
  method: "POST";
1447
- use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
1424
+ body: zod.ZodObject<{
1425
+ id: zod.ZodString;
1426
+ }, zod_v4_core.$strip>;
1427
+ use: (better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
1448
1428
  session: {
1449
1429
  session: Record<string, any> & {
1450
1430
  id: string;
@@ -1466,28 +1446,26 @@ declare const authClient: better_auth_react.ReactAuthClient<{
1466
1446
  image?: string | null | undefined;
1467
1447
  };
1468
1448
  };
1469
- }>>[];
1470
- body: zod.ZodObject<{
1471
- password: zod.ZodOptional<zod.ZodString>;
1472
- }, zod_v4_core.$strip> | zod.ZodObject<{
1473
- password: zod.ZodString;
1474
- }, zod_v4_core.$strip>;
1449
+ }>> | better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
1450
+ verifiedResource: {};
1451
+ }>>)[];
1475
1452
  metadata: {
1476
1453
  openapi: {
1477
- summary: string;
1478
1454
  description: string;
1479
1455
  responses: {
1480
- 200: {
1456
+ "200": {
1481
1457
  description: string;
1482
1458
  content: {
1483
1459
  "application/json": {
1484
1460
  schema: {
1485
1461
  type: "object";
1486
1462
  properties: {
1487
- totpURI: {
1463
+ status: {
1488
1464
  type: string;
1465
+ description: string;
1489
1466
  };
1490
1467
  };
1468
+ required: string[];
1491
1469
  };
1492
1470
  };
1493
1471
  };
@@ -1496,30 +1474,55 @@ declare const authClient: better_auth_react.ReactAuthClient<{
1496
1474
  };
1497
1475
  };
1498
1476
  }, {
1499
- totpURI: string;
1477
+ status: boolean;
1500
1478
  }>;
1501
- verifyTOTP: better_call.StrictEndpoint<"/two-factor/verify-totp", {
1479
+ updatePasskey: better_call.StrictEndpoint<"/passkey/update-passkey", {
1502
1480
  method: "POST";
1503
1481
  body: zod.ZodObject<{
1504
- code: zod.ZodString;
1505
- trustDevice: zod.ZodOptional<zod.ZodBoolean>;
1482
+ id: zod.ZodString;
1483
+ name: zod.ZodString;
1506
1484
  }, zod_v4_core.$strip>;
1485
+ use: (better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
1486
+ session: {
1487
+ session: Record<string, any> & {
1488
+ id: string;
1489
+ createdAt: Date;
1490
+ updatedAt: Date;
1491
+ userId: string;
1492
+ expiresAt: Date;
1493
+ token: string;
1494
+ ipAddress?: string | null | undefined;
1495
+ userAgent?: string | null | undefined;
1496
+ };
1497
+ user: Record<string, any> & {
1498
+ id: string;
1499
+ createdAt: Date;
1500
+ updatedAt: Date;
1501
+ email: string;
1502
+ emailVerified: boolean;
1503
+ name: string;
1504
+ image?: string | null | undefined;
1505
+ };
1506
+ };
1507
+ }>> | better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
1508
+ verifiedResource: {};
1509
+ }>>)[];
1507
1510
  metadata: {
1508
1511
  openapi: {
1509
- summary: string;
1510
1512
  description: string;
1511
1513
  responses: {
1512
- 200: {
1514
+ "200": {
1513
1515
  description: string;
1514
1516
  content: {
1515
1517
  "application/json": {
1516
1518
  schema: {
1517
1519
  type: "object";
1518
1520
  properties: {
1519
- status: {
1520
- type: string;
1521
+ passkey: {
1522
+ $ref: string;
1521
1523
  };
1522
1524
  };
1525
+ required: string[];
1523
1526
  };
1524
1527
  };
1525
1528
  };
@@ -1528,1541 +1531,551 @@ declare const authClient: better_auth_react.ReactAuthClient<{
1528
1531
  };
1529
1532
  };
1530
1533
  }, {
1531
- token: string;
1532
- user: better_auth_plugins.UserWithTwoFactor;
1533
- } | {
1534
- token: string;
1535
- user: Record<string, any> & {
1536
- id: string;
1537
- createdAt: Date;
1538
- updatedAt: Date;
1539
- email: string;
1540
- emailVerified: boolean;
1541
- name: string;
1542
- image?: string | null | undefined;
1543
- };
1534
+ passkey: _better_auth_passkey.Passkey;
1544
1535
  }>;
1545
1536
  };
1546
- options: NoInfer<O>;
1547
- hooks: {
1548
- after: {
1549
- matcher(context: better_auth.HookEndpointContext): boolean;
1550
- handler: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
1551
- twoFactorRedirect: boolean;
1552
- twoFactorMethods: string[];
1553
- } | undefined>>;
1554
- }[];
1555
- };
1556
1537
  schema: {
1557
- user: {
1538
+ passkey: {
1558
1539
  fields: {
1559
- twoFactorEnabled: {
1560
- type: "boolean";
1540
+ name: {
1541
+ type: "string";
1561
1542
  required: false;
1562
- defaultValue: false;
1563
- input: false;
1564
- };
1565
- };
1566
- };
1567
- twoFactor: {
1568
- fields: {
1569
- secret: {
1570
- type: "string";
1571
- required: true;
1572
- returned: false;
1573
- index: true;
1574
1543
  };
1575
- backupCodes: {
1544
+ publicKey: {
1576
1545
  type: "string";
1577
1546
  required: true;
1578
- returned: false;
1579
1547
  };
1580
1548
  userId: {
1581
1549
  type: "string";
1582
- required: true;
1583
- returned: false;
1584
1550
  references: {
1585
1551
  model: string;
1586
1552
  field: string;
1587
1553
  };
1554
+ required: true;
1588
1555
  index: true;
1589
1556
  };
1590
- verified: {
1591
- type: "boolean";
1592
- required: false;
1593
- defaultValue: true;
1594
- input: false;
1557
+ credentialID: {
1558
+ type: "string";
1559
+ required: true;
1560
+ index: true;
1595
1561
  };
1596
- failedVerificationCount: {
1562
+ counter: {
1597
1563
  type: "number";
1564
+ required: true;
1565
+ };
1566
+ deviceType: {
1567
+ type: "string";
1568
+ required: true;
1569
+ };
1570
+ backedUp: {
1571
+ type: "boolean";
1572
+ required: true;
1573
+ };
1574
+ transports: {
1575
+ type: "string";
1598
1576
  required: false;
1599
- defaultValue: number;
1600
- input: false;
1601
- returned: false;
1602
1577
  };
1603
- lockedUntil: {
1578
+ createdAt: {
1604
1579
  type: "date";
1605
1580
  required: false;
1606
- input: false;
1607
- returned: false;
1581
+ };
1582
+ aaguid: {
1583
+ type: "string";
1584
+ required: false;
1608
1585
  };
1609
1586
  };
1610
1587
  };
1611
1588
  };
1612
- rateLimit: {
1613
- pathMatcher(path: string): boolean;
1614
- window: number;
1615
- max: number;
1616
- }[];
1617
1589
  $ERROR_CODES: {
1618
- OTP_NOT_ENABLED: better_auth.RawError<"OTP_NOT_ENABLED">;
1619
- OTP_NOT_CONFIGURED: better_auth.RawError<"OTP_NOT_CONFIGURED">;
1620
- OTP_HAS_EXPIRED: better_auth.RawError<"OTP_HAS_EXPIRED">;
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">;
1624
- TWO_FACTOR_NOT_ENABLED: better_auth.RawError<"TWO_FACTOR_NOT_ENABLED">;
1625
- BACKUP_CODES_NOT_ENABLED: better_auth.RawError<"BACKUP_CODES_NOT_ENABLED">;
1626
- INVALID_BACKUP_CODE: better_auth.RawError<"INVALID_BACKUP_CODE">;
1627
- INVALID_CODE: better_auth.RawError<"INVALID_CODE">;
1628
- TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: better_auth.RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
1629
- ACCOUNT_TEMPORARILY_LOCKED: better_auth.RawError<"ACCOUNT_TEMPORARILY_LOCKED">;
1630
- INVALID_TWO_FACTOR_COOKIE: better_auth.RawError<"INVALID_TWO_FACTOR_COOKIE">;
1590
+ ORIGIN_NOT_CONFIGURED: better_auth.RawError<"ORIGIN_NOT_CONFIGURED">;
1591
+ CHALLENGE_NOT_FOUND: better_auth.RawError<"CHALLENGE_NOT_FOUND">;
1592
+ YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
1593
+ FAILED_TO_VERIFY_REGISTRATION: better_auth.RawError<"FAILED_TO_VERIFY_REGISTRATION">;
1594
+ PASSKEY_NOT_FOUND: better_auth.RawError<"PASSKEY_NOT_FOUND">;
1595
+ AUTHENTICATION_FAILED: better_auth.RawError<"AUTHENTICATION_FAILED">;
1596
+ UNABLE_TO_CREATE_SESSION: better_auth.RawError<"UNABLE_TO_CREATE_SESSION">;
1597
+ USER_NOT_FOUND: better_auth.RawError<"USER_NOT_FOUND">;
1598
+ FAILED_TO_UPDATE_PASSKEY: better_auth.RawError<"FAILED_TO_UPDATE_PASSKEY">;
1599
+ PREVIOUSLY_REGISTERED: better_auth.RawError<"PREVIOUSLY_REGISTERED">;
1600
+ REGISTRATION_CANCELLED: better_auth.RawError<"REGISTRATION_CANCELLED">;
1601
+ AUTH_CANCELLED: better_auth.RawError<"AUTH_CANCELLED">;
1602
+ UNKNOWN_ERROR: better_auth.RawError<"UNKNOWN_ERROR">;
1603
+ SESSION_REQUIRED: better_auth.RawError<"SESSION_REQUIRED">;
1604
+ RESOLVE_USER_REQUIRED: better_auth.RawError<"RESOLVE_USER_REQUIRED">;
1605
+ RESOLVED_USER_INVALID: better_auth.RawError<"RESOLVED_USER_INVALID">;
1631
1606
  };
1632
- })>;
1633
- atomListeners: {
1634
- matcher: (path: string) => boolean;
1635
- signal: "$sessionSignal";
1636
- }[];
1607
+ options: _better_auth_passkey.PasskeyOptions | undefined;
1608
+ }>;
1609
+ getActions: ($fetch: _better_fetch_fetch.BetterFetch, $store: better_auth.ClientStore) => {
1610
+ signIn: {
1611
+ passkey: (opts?: {
1612
+ autoFill?: boolean;
1613
+ extensions?: _simplewebauthn_server.AuthenticationExtensionsClientInputs;
1614
+ returnWebAuthnResponse?: boolean;
1615
+ fetchOptions?: better_auth.ClientFetchOption;
1616
+ } | undefined, options?: better_auth.ClientFetchOption | undefined) => Promise<{
1617
+ data: null;
1618
+ error: {
1619
+ message?: string | undefined;
1620
+ status: number;
1621
+ statusText: string;
1622
+ };
1623
+ } | {
1624
+ data: {
1625
+ session: better_auth.Session;
1626
+ user: better_auth.User;
1627
+ };
1628
+ error: null;
1629
+ } | {
1630
+ data: null;
1631
+ error: {
1632
+ code: string;
1633
+ message: string;
1634
+ status: number;
1635
+ statusText: string;
1636
+ };
1637
+ } | {
1638
+ webauthn: {
1639
+ response: _simplewebauthn_server.AuthenticationResponseJSON;
1640
+ clientExtensionResults: _simplewebauthn_server.AuthenticationExtensionsClientOutputs;
1641
+ };
1642
+ data: null;
1643
+ error: {
1644
+ message?: string | undefined;
1645
+ status: number;
1646
+ statusText: string;
1647
+ };
1648
+ } | {
1649
+ webauthn: {
1650
+ response: _simplewebauthn_server.AuthenticationResponseJSON;
1651
+ clientExtensionResults: _simplewebauthn_server.AuthenticationExtensionsClientOutputs;
1652
+ };
1653
+ data: {
1654
+ session: better_auth.Session;
1655
+ user: better_auth.User;
1656
+ };
1657
+ error: null;
1658
+ }>;
1659
+ };
1660
+ passkey: {
1661
+ addPasskey: (opts?: {
1662
+ fetchOptions?: better_auth.ClientFetchOption;
1663
+ name?: string;
1664
+ authenticatorAttachment?: "platform" | "cross-platform";
1665
+ context?: string | null;
1666
+ createSession?: boolean;
1667
+ extensions?: _simplewebauthn_server.AuthenticationExtensionsClientInputs;
1668
+ useAutoRegister?: boolean;
1669
+ returnWebAuthnResponse?: boolean;
1670
+ } | undefined, fetchOpts?: better_auth.ClientFetchOption | undefined) => Promise<{
1671
+ data: null;
1672
+ error: {
1673
+ message?: string | undefined;
1674
+ status: number;
1675
+ statusText: string;
1676
+ };
1677
+ } | {
1678
+ data: _better_auth_passkey.Passkey & {
1679
+ session?: better_auth.Session;
1680
+ user?: better_auth.User;
1681
+ };
1682
+ error: null;
1683
+ } | {
1684
+ webauthn: {
1685
+ response: _simplewebauthn_server.RegistrationResponseJSON;
1686
+ clientExtensionResults: _simplewebauthn_server.AuthenticationExtensionsClientOutputs;
1687
+ };
1688
+ data: _better_auth_passkey.Passkey & {
1689
+ session?: better_auth.Session;
1690
+ user?: better_auth.User;
1691
+ };
1692
+ error: null;
1693
+ } | {
1694
+ data: null;
1695
+ error: {
1696
+ code: string;
1697
+ message: string;
1698
+ status: number;
1699
+ statusText: string;
1700
+ };
1701
+ }>;
1702
+ };
1703
+ $Infer: {
1704
+ Passkey: _better_auth_passkey.Passkey;
1705
+ };
1706
+ };
1707
+ getAtoms($fetch: _better_fetch_fetch.BetterFetch): {
1708
+ listPasskeys: better_auth_client.AuthQueryAtom<_better_auth_passkey.Passkey[]>;
1709
+ $listPasskeys: nanostores.PreinitializedWritableAtom<any> & object;
1710
+ };
1637
1711
  pathMethods: {
1638
- "/two-factor/disable": "POST";
1639
- "/two-factor/enable": "POST";
1640
- "/two-factor/send-otp": "POST";
1641
- "/two-factor/generate-backup-codes": "POST";
1642
- "/two-factor/get-totp-uri": "POST";
1643
- "/two-factor/verify-totp": "POST";
1644
- "/two-factor/verify-otp": "POST";
1645
- "/two-factor/verify-backup-code": "POST";
1712
+ "/passkey/register": "POST";
1713
+ "/passkey/authenticate": "POST";
1714
+ };
1715
+ atomListeners: ({
1716
+ matcher(path: string): path is "/passkey/delete-passkey" | "/passkey/update-passkey" | "/passkey/verify-registration" | "/sign-out";
1717
+ signal: "$listPasskeys";
1718
+ } | {
1719
+ matcher: (path: string) => path is "/passkey/verify-authentication";
1720
+ signal: "$sessionSignal";
1721
+ })[];
1722
+ $ERROR_CODES: {
1723
+ ORIGIN_NOT_CONFIGURED: better_auth.RawError<"ORIGIN_NOT_CONFIGURED">;
1724
+ CHALLENGE_NOT_FOUND: better_auth.RawError<"CHALLENGE_NOT_FOUND">;
1725
+ YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
1726
+ FAILED_TO_VERIFY_REGISTRATION: better_auth.RawError<"FAILED_TO_VERIFY_REGISTRATION">;
1727
+ PASSKEY_NOT_FOUND: better_auth.RawError<"PASSKEY_NOT_FOUND">;
1728
+ AUTHENTICATION_FAILED: better_auth.RawError<"AUTHENTICATION_FAILED">;
1729
+ UNABLE_TO_CREATE_SESSION: better_auth.RawError<"UNABLE_TO_CREATE_SESSION">;
1730
+ USER_NOT_FOUND: better_auth.RawError<"USER_NOT_FOUND">;
1731
+ FAILED_TO_UPDATE_PASSKEY: better_auth.RawError<"FAILED_TO_UPDATE_PASSKEY">;
1732
+ PREVIOUSLY_REGISTERED: better_auth.RawError<"PREVIOUSLY_REGISTERED">;
1733
+ REGISTRATION_CANCELLED: better_auth.RawError<"REGISTRATION_CANCELLED">;
1734
+ AUTH_CANCELLED: better_auth.RawError<"AUTH_CANCELLED">;
1735
+ UNKNOWN_ERROR: better_auth.RawError<"UNKNOWN_ERROR">;
1736
+ SESSION_REQUIRED: better_auth.RawError<"SESSION_REQUIRED">;
1737
+ RESOLVE_USER_REQUIRED: better_auth.RawError<"RESOLVE_USER_REQUIRED">;
1738
+ RESOLVED_USER_INVALID: better_auth.RawError<"RESOLVED_USER_INVALID">;
1646
1739
  };
1740
+ } | {
1741
+ id: "one-tap";
1742
+ version: string;
1647
1743
  fetchPlugins: {
1648
1744
  id: string;
1649
1745
  name: string;
1650
1746
  hooks: {
1651
- onSuccess(context: _better_fetch_fetch.SuccessContext<any>): Promise<void>;
1747
+ onResponse(ctx: _better_fetch_fetch.ResponseContext): Promise<void>;
1652
1748
  };
1653
1749
  }[];
1654
- $ERROR_CODES: {
1655
- OTP_NOT_ENABLED: better_auth.RawError<"OTP_NOT_ENABLED">;
1656
- OTP_NOT_CONFIGURED: better_auth.RawError<"OTP_NOT_CONFIGURED">;
1657
- OTP_HAS_EXPIRED: better_auth.RawError<"OTP_HAS_EXPIRED">;
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">;
1661
- TWO_FACTOR_NOT_ENABLED: better_auth.RawError<"TWO_FACTOR_NOT_ENABLED">;
1662
- BACKUP_CODES_NOT_ENABLED: better_auth.RawError<"BACKUP_CODES_NOT_ENABLED">;
1663
- INVALID_BACKUP_CODE: better_auth.RawError<"INVALID_BACKUP_CODE">;
1664
- INVALID_CODE: better_auth.RawError<"INVALID_CODE">;
1665
- TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: better_auth.RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
1666
- ACCOUNT_TEMPORARILY_LOCKED: better_auth.RawError<"ACCOUNT_TEMPORARILY_LOCKED">;
1667
- INVALID_TWO_FACTOR_COOKIE: better_auth.RawError<"INVALID_TWO_FACTOR_COOKIE">;
1750
+ getActions: ($fetch: _better_fetch_fetch.BetterFetch, _$store: better_auth.ClientStore, _options: better_auth.BetterAuthClientOptions | undefined) => {
1751
+ oneTap: (opts?: better_auth_client_plugins.GoogleOneTapActionOptions | undefined, fetchOptions?: better_auth.ClientFetchOption | undefined) => Promise<void>;
1668
1752
  };
1669
- } | {
1670
- id: "passkey";
1671
- version: string;
1672
- $InferServerPlugin: ReturnType<(options?: _better_auth_passkey.PasskeyOptions | undefined) => {
1673
- id: "passkey";
1674
- version: string;
1675
- endpoints: {
1676
- generatePasskeyRegistrationOptions: better_call.StrictEndpoint<"/passkey/generate-register-options", {
1677
- method: "GET";
1678
- use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
1679
- session: {
1680
- session: Record<string, any> & {
1681
- id: string;
1682
- createdAt: Date;
1683
- updatedAt: Date;
1684
- userId: string;
1685
- expiresAt: Date;
1686
- token: string;
1687
- ipAddress?: string | null | undefined;
1688
- userAgent?: string | null | undefined;
1689
- };
1690
- user: Record<string, any> & {
1691
- id: string;
1692
- createdAt: Date;
1693
- updatedAt: Date;
1694
- email: string;
1695
- emailVerified: boolean;
1696
- name: string;
1697
- image?: string | null | undefined;
1698
- };
1699
- };
1700
- }>>[];
1701
- query: zod.ZodOptional<zod.ZodObject<{
1702
- authenticatorAttachment: zod.ZodOptional<zod.ZodEnum<{
1703
- platform: "platform";
1704
- "cross-platform": "cross-platform";
1705
- }>>;
1706
- name: zod.ZodOptional<zod.ZodString>;
1707
- context: zod.ZodOptional<zod.ZodString>;
1708
- }, zod_v4_core.$strip>>;
1709
- metadata: {
1710
- openapi: {
1711
- operationId: string;
1712
- description: string;
1713
- parameters: better_call.OpenAPIParameter[];
1714
- responses: {
1715
- 200: {
1716
- description: string;
1717
- content: {
1718
- "application/json": {
1719
- schema: {
1720
- type: "object";
1721
- properties: {
1722
- challenge: {
1723
- type: string;
1724
- };
1725
- rp: {
1726
- type: string;
1727
- properties: {
1728
- name: {
1729
- type: string;
1730
- };
1731
- id: {
1732
- type: string;
1733
- };
1734
- };
1735
- };
1736
- user: {
1737
- type: string;
1738
- properties: {
1739
- id: {
1740
- type: string;
1741
- };
1742
- name: {
1743
- type: string;
1744
- };
1745
- displayName: {
1746
- type: string;
1747
- };
1748
- };
1749
- };
1750
- pubKeyCredParams: {
1751
- type: string;
1752
- items: {
1753
- type: string;
1754
- properties: {
1755
- type: {
1756
- type: string;
1757
- };
1758
- alg: {
1759
- type: string;
1760
- };
1761
- };
1762
- };
1763
- };
1764
- timeout: {
1765
- type: string;
1766
- };
1767
- excludeCredentials: {
1768
- type: string;
1769
- items: {
1770
- type: string;
1771
- properties: {
1772
- id: {
1773
- type: string;
1774
- };
1775
- type: {
1776
- type: string;
1777
- };
1778
- transports: {
1779
- type: string;
1780
- items: {
1781
- type: string;
1782
- };
1783
- };
1784
- };
1785
- };
1786
- };
1787
- authenticatorSelection: {
1788
- type: string;
1789
- properties: {
1790
- authenticatorAttachment: {
1791
- type: string;
1792
- };
1793
- requireResidentKey: {
1794
- type: string;
1795
- };
1796
- userVerification: {
1797
- type: string;
1798
- };
1799
- };
1800
- };
1801
- attestation: {
1802
- type: string;
1803
- };
1804
- extensions: {
1805
- type: string;
1806
- };
1807
- };
1808
- };
1809
- };
1810
- };
1811
- };
1812
- };
1813
- };
1814
- };
1815
- }, _simplewebauthn_server.PublicKeyCredentialCreationOptionsJSON>;
1816
- generatePasskeyAuthenticationOptions: better_call.StrictEndpoint<"/passkey/generate-authenticate-options", {
1817
- method: "GET";
1818
- metadata: {
1819
- openapi: {
1820
- operationId: string;
1821
- description: string;
1822
- responses: {
1823
- 200: {
1824
- description: string;
1825
- content: {
1826
- "application/json": {
1827
- schema: {
1828
- type: "object";
1829
- properties: {
1830
- challenge: {
1831
- type: string;
1832
- };
1833
- rp: {
1834
- type: string;
1835
- properties: {
1836
- name: {
1837
- type: string;
1838
- };
1839
- id: {
1840
- type: string;
1841
- };
1842
- };
1843
- };
1844
- user: {
1845
- type: string;
1846
- properties: {
1847
- id: {
1848
- type: string;
1849
- };
1850
- name: {
1851
- type: string;
1852
- };
1853
- displayName: {
1854
- type: string;
1855
- };
1856
- };
1857
- };
1858
- timeout: {
1859
- type: string;
1860
- };
1861
- allowCredentials: {
1862
- type: string;
1863
- items: {
1864
- type: string;
1865
- properties: {
1866
- id: {
1867
- type: string;
1868
- };
1869
- type: {
1870
- type: string;
1871
- };
1872
- transports: {
1873
- type: string;
1874
- items: {
1875
- type: string;
1876
- };
1877
- };
1878
- };
1879
- };
1880
- };
1881
- userVerification: {
1882
- type: string;
1883
- };
1884
- authenticatorSelection: {
1885
- type: string;
1886
- properties: {
1887
- authenticatorAttachment: {
1888
- type: string;
1889
- };
1890
- requireResidentKey: {
1891
- type: string;
1892
- };
1893
- userVerification: {
1894
- type: string;
1895
- };
1896
- };
1897
- };
1898
- extensions: {
1899
- type: string;
1900
- };
1901
- };
1902
- };
1903
- };
1904
- };
1905
- };
1906
- };
1907
- };
1908
- };
1909
- }, _simplewebauthn_server.PublicKeyCredentialRequestOptionsJSON>;
1910
- verifyPasskeyRegistration: better_call.StrictEndpoint<"/passkey/verify-registration", {
1911
- method: "POST";
1912
- body: zod.ZodObject<{
1913
- response: zod.ZodAny;
1914
- name: zod.ZodOptional<zod.ZodString>;
1915
- createSession: zod.ZodOptional<zod.ZodBoolean>;
1916
- }, zod_v4_core.$strip>;
1917
- use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
1918
- session: {
1919
- session: Record<string, any> & {
1920
- id: string;
1921
- createdAt: Date;
1922
- updatedAt: Date;
1923
- userId: string;
1924
- expiresAt: Date;
1925
- token: string;
1926
- ipAddress?: string | null | undefined;
1927
- userAgent?: string | null | undefined;
1928
- };
1929
- user: Record<string, any> & {
1930
- id: string;
1931
- createdAt: Date;
1932
- updatedAt: Date;
1933
- email: string;
1934
- emailVerified: boolean;
1935
- name: string;
1936
- image?: string | null | undefined;
1937
- };
1938
- };
1939
- }>>[];
1940
- metadata: {
1941
- openapi: {
1942
- operationId: string;
1943
- description: string;
1944
- responses: {
1945
- 200: {
1946
- description: string;
1947
- content: {
1948
- "application/json": {
1949
- schema: {
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
- }];
1964
- };
1965
- };
1966
- };
1967
- };
1968
- 400: {
1969
- description: string;
1970
- };
1971
- };
1972
- };
1973
- };
1974
- }, _better_auth_passkey.Passkey>;
1975
- verifyPasskeyAuthentication: better_call.StrictEndpoint<"/passkey/verify-authentication", {
1976
- method: "POST";
1977
- body: zod.ZodObject<{
1978
- response: zod.ZodRecord<zod.ZodAny, zod.ZodAny>;
1979
- }, zod_v4_core.$strip>;
1980
- metadata: {
1981
- openapi: {
1982
- operationId: string;
1983
- description: string;
1984
- responses: {
1985
- 200: {
1986
- description: string;
1987
- content: {
1988
- "application/json": {
1989
- schema: {
1990
- type: "object";
1991
- properties: {
1992
- session: {
1993
- $ref: string;
1994
- };
1995
- user: {
1996
- $ref: string;
1997
- };
1998
- };
1999
- };
2000
- };
2001
- };
2002
- };
2003
- };
2004
- };
2005
- $Infer: {
2006
- body: {
2007
- response: _simplewebauthn_server.AuthenticationResponseJSON;
2008
- };
2009
- };
2010
- };
2011
- }, {
2012
- session: {
2013
- id: string;
2014
- createdAt: Date;
2015
- updatedAt: Date;
2016
- userId: string;
2017
- expiresAt: Date;
2018
- token: string;
2019
- ipAddress?: string | null | undefined;
2020
- userAgent?: string | null | undefined;
2021
- };
2022
- user: {
2023
- id: string;
2024
- createdAt: Date;
2025
- updatedAt: Date;
2026
- email: string;
2027
- emailVerified: boolean;
2028
- name: string;
2029
- image?: string | null | undefined;
2030
- };
2031
- }>;
2032
- listPasskeys: better_call.StrictEndpoint<"/passkey/list-user-passkeys", {
2033
- method: "GET";
2034
- use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
2035
- session: {
2036
- session: Record<string, any> & {
2037
- id: string;
2038
- createdAt: Date;
2039
- updatedAt: Date;
2040
- userId: string;
2041
- expiresAt: Date;
2042
- token: string;
2043
- ipAddress?: string | null | undefined;
2044
- userAgent?: string | null | undefined;
2045
- };
2046
- user: Record<string, any> & {
2047
- id: string;
2048
- createdAt: Date;
2049
- updatedAt: Date;
2050
- email: string;
2051
- emailVerified: boolean;
2052
- name: string;
2053
- image?: string | null | undefined;
2054
- };
2055
- };
2056
- }>>[];
2057
- metadata: {
2058
- openapi: {
2059
- description: string;
2060
- responses: {
2061
- "200": {
2062
- description: string;
2063
- content: {
2064
- "application/json": {
2065
- schema: {
2066
- type: "array";
2067
- items: {
2068
- $ref: string;
2069
- required: string[];
2070
- };
2071
- description: string;
2072
- };
2073
- };
2074
- };
2075
- };
2076
- };
2077
- };
2078
- };
2079
- }, _better_auth_passkey.Passkey[]>;
2080
- deletePasskey: better_call.StrictEndpoint<"/passkey/delete-passkey", {
2081
- method: "POST";
2082
- body: zod.ZodObject<{
2083
- id: zod.ZodString;
2084
- }, zod_v4_core.$strip>;
2085
- use: (better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
2086
- session: {
2087
- session: Record<string, any> & {
2088
- id: string;
2089
- createdAt: Date;
2090
- updatedAt: Date;
2091
- userId: string;
2092
- expiresAt: Date;
2093
- token: string;
2094
- ipAddress?: string | null | undefined;
2095
- userAgent?: string | null | undefined;
2096
- };
2097
- user: Record<string, any> & {
2098
- id: string;
2099
- createdAt: Date;
2100
- updatedAt: Date;
2101
- email: string;
2102
- emailVerified: boolean;
2103
- name: string;
2104
- image?: string | null | undefined;
2105
- };
2106
- };
2107
- }>> | better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
2108
- verifiedResource: {};
2109
- }>>)[];
2110
- metadata: {
2111
- openapi: {
2112
- description: string;
2113
- responses: {
2114
- "200": {
2115
- description: string;
2116
- content: {
2117
- "application/json": {
2118
- schema: {
2119
- type: "object";
2120
- properties: {
2121
- status: {
2122
- type: string;
2123
- description: string;
2124
- };
2125
- };
2126
- required: string[];
2127
- };
2128
- };
2129
- };
2130
- };
2131
- };
2132
- };
2133
- };
2134
- }, {
2135
- status: boolean;
2136
- }>;
2137
- updatePasskey: better_call.StrictEndpoint<"/passkey/update-passkey", {
2138
- method: "POST";
2139
- body: zod.ZodObject<{
2140
- id: zod.ZodString;
2141
- name: zod.ZodString;
2142
- }, zod_v4_core.$strip>;
2143
- use: (better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
2144
- session: {
2145
- session: Record<string, any> & {
2146
- id: string;
2147
- createdAt: Date;
2148
- updatedAt: Date;
2149
- userId: string;
2150
- expiresAt: Date;
2151
- token: string;
2152
- ipAddress?: string | null | undefined;
2153
- userAgent?: string | null | undefined;
2154
- };
2155
- user: Record<string, any> & {
2156
- id: string;
2157
- createdAt: Date;
2158
- updatedAt: Date;
2159
- email: string;
2160
- emailVerified: boolean;
2161
- name: string;
2162
- image?: string | null | undefined;
2163
- };
2164
- };
2165
- }>> | better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
2166
- verifiedResource: {};
2167
- }>>)[];
2168
- metadata: {
2169
- openapi: {
2170
- description: string;
2171
- responses: {
2172
- "200": {
2173
- description: string;
2174
- content: {
2175
- "application/json": {
2176
- schema: {
2177
- type: "object";
2178
- properties: {
2179
- passkey: {
2180
- $ref: string;
2181
- };
2182
- };
2183
- required: string[];
2184
- };
2185
- };
2186
- };
2187
- };
2188
- };
2189
- };
2190
- };
2191
- }, {
2192
- passkey: _better_auth_passkey.Passkey;
2193
- }>;
2194
- };
2195
- schema: {
2196
- passkey: {
2197
- fields: {
2198
- name: {
2199
- type: "string";
2200
- required: false;
2201
- };
2202
- publicKey: {
2203
- type: "string";
2204
- required: true;
2205
- };
2206
- userId: {
2207
- type: "string";
2208
- references: {
2209
- model: string;
2210
- field: string;
2211
- };
2212
- required: true;
2213
- index: true;
2214
- };
2215
- credentialID: {
2216
- type: "string";
2217
- required: true;
2218
- index: true;
2219
- };
2220
- counter: {
2221
- type: "number";
2222
- required: true;
2223
- };
2224
- deviceType: {
2225
- type: "string";
2226
- required: true;
2227
- };
2228
- backedUp: {
2229
- type: "boolean";
2230
- required: true;
2231
- };
2232
- transports: {
2233
- type: "string";
2234
- required: false;
2235
- };
2236
- createdAt: {
2237
- type: "date";
2238
- required: false;
2239
- };
2240
- aaguid: {
2241
- type: "string";
2242
- required: false;
2243
- };
2244
- };
2245
- };
2246
- };
2247
- $ERROR_CODES: {
2248
- CHALLENGE_NOT_FOUND: better_auth.RawError<"CHALLENGE_NOT_FOUND">;
2249
- YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
2250
- FAILED_TO_VERIFY_REGISTRATION: better_auth.RawError<"FAILED_TO_VERIFY_REGISTRATION">;
2251
- PASSKEY_NOT_FOUND: better_auth.RawError<"PASSKEY_NOT_FOUND">;
2252
- AUTHENTICATION_FAILED: better_auth.RawError<"AUTHENTICATION_FAILED">;
2253
- UNABLE_TO_CREATE_SESSION: better_auth.RawError<"UNABLE_TO_CREATE_SESSION">;
2254
- USER_NOT_FOUND: better_auth.RawError<"USER_NOT_FOUND">;
2255
- FAILED_TO_UPDATE_PASSKEY: better_auth.RawError<"FAILED_TO_UPDATE_PASSKEY">;
2256
- PREVIOUSLY_REGISTERED: better_auth.RawError<"PREVIOUSLY_REGISTERED">;
2257
- REGISTRATION_CANCELLED: better_auth.RawError<"REGISTRATION_CANCELLED">;
2258
- AUTH_CANCELLED: better_auth.RawError<"AUTH_CANCELLED">;
2259
- UNKNOWN_ERROR: better_auth.RawError<"UNKNOWN_ERROR">;
2260
- SESSION_REQUIRED: better_auth.RawError<"SESSION_REQUIRED">;
2261
- RESOLVE_USER_REQUIRED: better_auth.RawError<"RESOLVE_USER_REQUIRED">;
2262
- RESOLVED_USER_INVALID: better_auth.RawError<"RESOLVED_USER_INVALID">;
2263
- };
2264
- options: _better_auth_passkey.PasskeyOptions | undefined;
2265
- }>;
2266
- getActions: ($fetch: _better_fetch_fetch.BetterFetch, $store: better_auth.ClientStore) => {
2267
- signIn: {
2268
- passkey: (opts?: {
2269
- autoFill?: boolean;
2270
- extensions?: _simplewebauthn_server.AuthenticationExtensionsClientInputs;
2271
- returnWebAuthnResponse?: boolean;
2272
- fetchOptions?: better_auth.ClientFetchOption;
2273
- } | undefined, options?: better_auth.ClientFetchOption | undefined) => Promise<{
2274
- data: null;
2275
- error: {
2276
- message?: string | undefined;
2277
- status: number;
2278
- statusText: string;
2279
- };
2280
- } | {
2281
- data: {
2282
- session: better_auth.Session;
2283
- user: better_auth.User;
2284
- };
2285
- error: null;
2286
- } | {
2287
- data: null;
2288
- error: {
2289
- code: string;
2290
- message: string;
2291
- status: number;
2292
- statusText: string;
2293
- };
2294
- } | {
2295
- webauthn: {
2296
- response: _simplewebauthn_server.AuthenticationResponseJSON;
2297
- clientExtensionResults: _simplewebauthn_server.AuthenticationExtensionsClientOutputs;
2298
- };
2299
- data: null;
2300
- error: {
2301
- message?: string | undefined;
2302
- status: number;
2303
- statusText: string;
2304
- };
2305
- } | {
2306
- webauthn: {
2307
- response: _simplewebauthn_server.AuthenticationResponseJSON;
2308
- clientExtensionResults: _simplewebauthn_server.AuthenticationExtensionsClientOutputs;
2309
- };
2310
- data: {
2311
- session: better_auth.Session;
2312
- user: better_auth.User;
2313
- };
2314
- error: null;
2315
- }>;
2316
- };
2317
- passkey: {
2318
- addPasskey: (opts?: {
2319
- fetchOptions?: better_auth.ClientFetchOption;
2320
- name?: string;
2321
- authenticatorAttachment?: "platform" | "cross-platform";
2322
- context?: string | null;
2323
- createSession?: boolean;
2324
- extensions?: _simplewebauthn_server.AuthenticationExtensionsClientInputs;
2325
- useAutoRegister?: boolean;
2326
- returnWebAuthnResponse?: boolean;
2327
- } | undefined, fetchOpts?: better_auth.ClientFetchOption | undefined) => Promise<{
2328
- data: null;
2329
- error: {
2330
- message?: string | undefined;
2331
- status: number;
2332
- statusText: string;
2333
- };
2334
- } | {
2335
- data: _better_auth_passkey.Passkey & {
2336
- session?: better_auth.Session;
2337
- user?: better_auth.User;
2338
- };
2339
- error: null;
2340
- } | {
2341
- webauthn: {
2342
- response: _simplewebauthn_server.RegistrationResponseJSON;
2343
- clientExtensionResults: _simplewebauthn_server.AuthenticationExtensionsClientOutputs;
2344
- };
2345
- data: _better_auth_passkey.Passkey & {
2346
- session?: better_auth.Session;
2347
- user?: better_auth.User;
2348
- };
2349
- error: null;
2350
- } | {
2351
- data: null;
2352
- error: {
2353
- code: string;
2354
- message: string;
2355
- status: number;
2356
- statusText: string;
2357
- };
2358
- }>;
2359
- };
2360
- $Infer: {
2361
- Passkey: _better_auth_passkey.Passkey;
2362
- };
2363
- };
2364
- getAtoms($fetch: _better_fetch_fetch.BetterFetch): {
2365
- listPasskeys: better_auth_client.AuthQueryAtom<_better_auth_passkey.Passkey[]>;
2366
- $listPasskeys: nanostores.PreinitializedWritableAtom<any> & object;
2367
- };
2368
- pathMethods: {
2369
- "/passkey/register": "POST";
2370
- "/passkey/authenticate": "POST";
2371
- };
2372
- atomListeners: ({
2373
- matcher(path: string): path is "/passkey/delete-passkey" | "/passkey/update-passkey" | "/passkey/verify-registration" | "/sign-out";
2374
- signal: "$listPasskeys";
2375
- } | {
2376
- matcher: (path: string) => path is "/passkey/verify-authentication";
2377
- signal: "$sessionSignal";
2378
- })[];
2379
- $ERROR_CODES: {
2380
- CHALLENGE_NOT_FOUND: better_auth.RawError<"CHALLENGE_NOT_FOUND">;
2381
- YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
2382
- FAILED_TO_VERIFY_REGISTRATION: better_auth.RawError<"FAILED_TO_VERIFY_REGISTRATION">;
2383
- PASSKEY_NOT_FOUND: better_auth.RawError<"PASSKEY_NOT_FOUND">;
2384
- AUTHENTICATION_FAILED: better_auth.RawError<"AUTHENTICATION_FAILED">;
2385
- UNABLE_TO_CREATE_SESSION: better_auth.RawError<"UNABLE_TO_CREATE_SESSION">;
2386
- USER_NOT_FOUND: better_auth.RawError<"USER_NOT_FOUND">;
2387
- FAILED_TO_UPDATE_PASSKEY: better_auth.RawError<"FAILED_TO_UPDATE_PASSKEY">;
2388
- PREVIOUSLY_REGISTERED: better_auth.RawError<"PREVIOUSLY_REGISTERED">;
2389
- REGISTRATION_CANCELLED: better_auth.RawError<"REGISTRATION_CANCELLED">;
2390
- AUTH_CANCELLED: better_auth.RawError<"AUTH_CANCELLED">;
2391
- UNKNOWN_ERROR: better_auth.RawError<"UNKNOWN_ERROR">;
2392
- SESSION_REQUIRED: better_auth.RawError<"SESSION_REQUIRED">;
2393
- RESOLVE_USER_REQUIRED: better_auth.RawError<"RESOLVE_USER_REQUIRED">;
2394
- RESOLVED_USER_INVALID: better_auth.RawError<"RESOLVED_USER_INVALID">;
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): {};
2410
- })[];
2411
- }>;
2412
- declare const useSession: () => {
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;
2444
- isPending: boolean;
2445
- isRefetching: boolean;
2446
- error: _better_fetch_fetch.BetterFetchError | null;
2447
- refetch: (queryParams?: {
2448
- query?: better_auth.SessionQueryParams;
2449
- } | undefined) => Promise<void>;
2450
- };
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
- } & {
2594
- passkey: (opts?: {
2595
- autoFill?: boolean;
2596
- extensions?: _simplewebauthn_server.AuthenticationExtensionsClientInputs;
2597
- returnWebAuthnResponse?: boolean;
2598
- fetchOptions?: better_auth.ClientFetchOption;
2599
- } | undefined, options?: better_auth.ClientFetchOption | undefined) => Promise<{
2600
- data: null;
2601
- error: {
2602
- message?: string | undefined;
2603
- status: number;
2604
- statusText: string;
2605
- };
2606
- } | {
2607
- data: {
2608
- session: better_auth.Session;
2609
- user: better_auth.User;
2610
- };
2611
- error: null;
2612
- } | {
2613
- data: null;
2614
- error: {
2615
- code: string;
2616
- message: string;
2617
- status: number;
2618
- statusText: string;
2619
- };
2620
- } | {
2621
- webauthn: {
2622
- response: _simplewebauthn_server.AuthenticationResponseJSON;
2623
- clientExtensionResults: _simplewebauthn_server.AuthenticationExtensionsClientOutputs;
2624
- };
2625
- data: null;
2626
- error: {
2627
- message?: string | undefined;
2628
- status: number;
2629
- statusText: string;
2630
- };
2631
- } | {
2632
- webauthn: {
2633
- response: _simplewebauthn_server.AuthenticationResponseJSON;
2634
- clientExtensionResults: _simplewebauthn_server.AuthenticationExtensionsClientOutputs;
2635
- };
2636
- data: {
2637
- session: better_auth.Session;
2638
- user: better_auth.User;
2639
- };
2640
- error: null;
2641
- }>;
2642
- };
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;
1753
+ getAtoms($fetch: _better_fetch_fetch.BetterFetch): {};
1754
+ })[];
1755
+ }>;
1756
+ declare const useSession: () => {
1757
+ data: {
1758
+ user: better_auth.StripEmptyObjects<{
1759
+ id: string;
1760
+ createdAt: Date;
1761
+ updatedAt: Date;
1762
+ email: string;
1763
+ emailVerified: boolean;
1764
+ name: string;
1765
+ image?: string | null | undefined;
1766
+ } & {
1767
+ banned: boolean | null | undefined;
1768
+ } & {
1769
+ role?: string | null | undefined;
1770
+ banReason?: string | null | undefined;
1771
+ banExpires?: Date | null | undefined;
1772
+ } & {
1773
+ twoFactorEnabled: boolean | null | undefined;
1774
+ } & {}>;
1775
+ session: better_auth.StripEmptyObjects<{
1776
+ id: string;
1777
+ createdAt: Date;
1778
+ updatedAt: Date;
1779
+ userId: string;
1780
+ expiresAt: Date;
1781
+ token: string;
1782
+ ipAddress?: string | null | undefined;
1783
+ userAgent?: string | null | undefined;
1784
+ } & {} & {
1785
+ impersonatedBy?: string | null | undefined;
1786
+ }>;
1787
+ } | null;
1788
+ isPending: boolean;
1789
+ isRefetching: boolean;
1790
+ error: _better_fetch_fetch.BetterFetchError | null;
1791
+ refetch: (queryParams?: {
1792
+ query?: better_auth.SessionQueryParams;
1793
+ } | undefined) => Promise<void>;
1794
+ };
1795
+ declare const signIn: {
1796
+ social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1797
+ 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";
1798
+ callbackURL?: string | undefined;
1799
+ newUserCallbackURL?: string | undefined;
1800
+ errorCallbackURL?: string | undefined;
1801
+ disableRedirect?: boolean | undefined;
1802
+ idToken?: {
1803
+ token: string;
1804
+ nonce?: string | undefined;
1805
+ accessToken?: string | undefined;
1806
+ refreshToken?: string | undefined;
1807
+ expiresAt?: number | undefined;
1808
+ user?: {
1809
+ name?: {
1810
+ firstName?: string | undefined;
1811
+ lastName?: string | undefined;
1812
+ } | undefined;
1813
+ email?: string | undefined;
1814
+ } | undefined;
1815
+ } | undefined;
1816
+ scopes?: string[] | undefined;
1817
+ requestSignUp?: boolean | undefined;
1818
+ loginHint?: string | undefined;
1819
+ additionalParams?: Record<string, string> | undefined;
1820
+ additionalData?: Record<string, any> | undefined;
1821
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, string | undefined> | undefined>>(data_0: better_auth.Prettify<Omit<{
1822
+ 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";
1823
+ callbackURL?: string | undefined;
1824
+ newUserCallbackURL?: string | undefined;
1825
+ errorCallbackURL?: string | undefined;
1826
+ disableRedirect?: boolean | undefined;
1827
+ idToken?: {
1828
+ token: string;
1829
+ nonce?: string | undefined;
1830
+ accessToken?: string | undefined;
1831
+ refreshToken?: string | undefined;
1832
+ expiresAt?: number | undefined;
1833
+ user?: {
1834
+ name?: {
1835
+ firstName?: string | undefined;
1836
+ lastName?: string | undefined;
1837
+ } | undefined;
1838
+ email?: string | undefined;
1839
+ } | undefined;
1840
+ } | undefined;
1841
+ scopes?: string[] | undefined;
1842
+ requestSignUp?: boolean | undefined;
1843
+ loginHint?: string | undefined;
1844
+ additionalParams?: Record<string, string> | undefined;
1845
+ additionalData?: Record<string, any> | undefined;
1846
+ } & {
1847
+ fetchOptions?: FetchOptions | undefined;
1848
+ }, "provider"> & {
1849
+ 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";
1850
+ fetchOptions?: FetchOptions | undefined;
1851
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1852
+ redirect: boolean;
1853
+ url: string;
1854
+ } | (Omit<{
1855
+ redirect: boolean;
1856
+ token: string;
1857
+ url: undefined;
1858
+ user: {
1859
+ id: string;
1860
+ createdAt: Date;
1861
+ updatedAt: Date;
1862
+ email: string;
1863
+ emailVerified: boolean;
1864
+ name: string;
1865
+ image?: string | null | undefined | undefined;
1866
+ };
1867
+ }, "user"> & {
1868
+ user: better_auth.StripEmptyObjects<{
1869
+ id: string;
1870
+ createdAt: Date;
1871
+ updatedAt: Date;
1872
+ email: string;
1873
+ emailVerified: boolean;
1874
+ name: string;
1875
+ image?: string | null | undefined;
1876
+ } & {
1877
+ banned: boolean | null | undefined;
1878
+ } & {
1879
+ role?: string | null | undefined;
1880
+ banReason?: string | null | undefined;
1881
+ banExpires?: Date | null | undefined;
1882
+ } & {
1883
+ twoFactorEnabled: boolean | null | undefined;
1884
+ } & {}>;
1885
+ }), {
1886
+ code?: string | undefined;
1887
+ message?: string | undefined;
1888
+ }, FetchOptions["throw"] extends true ? true : false>>;
1889
+ } & {
1890
+ email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1891
+ email: string;
1892
+ password: string;
1893
+ callbackURL?: string | undefined;
1894
+ rememberMe?: boolean | undefined;
1895
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, string | undefined> | undefined>>(data_0: better_auth.Prettify<{
1896
+ email: string;
1897
+ password: string;
1898
+ callbackURL?: string | undefined;
1899
+ rememberMe?: boolean | undefined;
1900
+ } & {
1901
+ fetchOptions?: FetchOptions | undefined;
1902
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<Omit<{
1903
+ redirect: boolean;
1904
+ token: string;
1905
+ url?: string | undefined;
1906
+ user: {
1907
+ id: string;
1908
+ createdAt: Date;
1909
+ updatedAt: Date;
1910
+ email: string;
1911
+ emailVerified: boolean;
1912
+ name: string;
1913
+ image?: string | null | undefined | undefined;
1914
+ };
1915
+ }, "user"> & {
1916
+ user: better_auth.StripEmptyObjects<{
1917
+ id: string;
1918
+ createdAt: Date;
1919
+ updatedAt: Date;
1920
+ email: string;
1921
+ emailVerified: boolean;
1922
+ name: string;
1923
+ image?: string | null | undefined;
1924
+ } & {
1925
+ banned: boolean | null | undefined;
1926
+ } & {
1927
+ role?: string | null | undefined;
1928
+ banReason?: string | null | undefined;
1929
+ banExpires?: Date | null | undefined;
1930
+ } & {
1931
+ twoFactorEnabled: boolean | null | undefined;
1932
+ } & {}>;
1933
+ }, {
1934
+ code?: string | undefined;
1935
+ message?: string | undefined;
1936
+ }, FetchOptions["throw"] extends true ? true : false>>;
1937
+ } & {
1938
+ passkey: (opts?: {
1939
+ autoFill?: boolean;
1940
+ extensions?: _simplewebauthn_server.AuthenticationExtensionsClientInputs;
1941
+ returnWebAuthnResponse?: boolean;
1942
+ fetchOptions?: better_auth.ClientFetchOption;
1943
+ } | undefined, options?: better_auth.ClientFetchOption | undefined) => Promise<{
1944
+ data: null;
1945
+ error: {
1946
+ message?: string | undefined;
1947
+ status: number;
1948
+ statusText: string;
1949
+ };
1950
+ } | {
1951
+ data: {
1952
+ session: better_auth.Session;
1953
+ user: better_auth.User;
1954
+ };
1955
+ error: null;
1956
+ } | {
1957
+ data: null;
1958
+ error: {
1959
+ code: string;
1960
+ message: string;
1961
+ status: number;
1962
+ statusText: string;
1963
+ };
1964
+ } | {
1965
+ webauthn: {
1966
+ response: _simplewebauthn_server.AuthenticationResponseJSON;
1967
+ clientExtensionResults: _simplewebauthn_server.AuthenticationExtensionsClientOutputs;
1968
+ };
1969
+ data: null;
1970
+ error: {
1971
+ message?: string | undefined;
1972
+ status: number;
1973
+ statusText: string;
1974
+ };
1975
+ } | {
1976
+ webauthn: {
1977
+ response: _simplewebauthn_server.AuthenticationResponseJSON;
1978
+ clientExtensionResults: _simplewebauthn_server.AuthenticationExtensionsClientOutputs;
1979
+ };
1980
+ data: {
1981
+ session: better_auth.Session;
1982
+ user: better_auth.User;
1983
+ };
1984
+ error: null;
1985
+ }>;
1986
+ };
1987
+ declare const signOut: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1988
+ callbackURL?: string | undefined;
1989
+ disableRedirect?: boolean | undefined;
1990
+ state?: string | undefined;
1991
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, string | undefined> | undefined>>(data_0?: better_auth.Prettify<{
1992
+ callbackURL?: string | undefined;
1993
+ disableRedirect?: boolean | undefined;
1994
+ state?: string | undefined;
1995
+ } & {
1996
+ fetchOptions?: FetchOptions | undefined;
1997
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1998
+ success: boolean;
1999
+ url: string | undefined;
2000
+ redirect: boolean | undefined;
2001
+ }, {
2002
+ code?: string | undefined;
2003
+ message?: string | undefined;
2004
+ }, FetchOptions["throw"] extends true ? true : false>>;
2005
+ declare const signUp: {
2006
+ email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2007
+ name: string;
2008
+ email: string;
2009
+ password: string;
2010
+ image?: string | undefined;
2011
+ callbackURL?: string | undefined;
2012
+ rememberMe?: boolean | undefined;
2013
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, string | undefined> | undefined>>(data_0: better_auth.Prettify<better_auth_client.InferSignUpEmailCtx<{
2014
+ baseURL: string | undefined;
2015
+ plugins: ({
2016
+ id: "admin-client";
2017
+ version: string;
2018
+ $InferServerPlugin: {
2019
+ id: "admin";
2020
+ version: string;
2021
+ init(authContext: better_auth.AuthContext): {
2022
+ options: {
2023
+ databaseHooks: {
2024
+ user: {
2025
+ create: {
2026
+ before(user: {
2027
+ id: string;
2028
+ createdAt: Date;
2029
+ updatedAt: Date;
2030
+ email: string;
2031
+ emailVerified: boolean;
2032
+ name: string;
2033
+ image?: string | null | undefined;
2034
+ } & Record<string, unknown>): Promise<{
2035
+ data: {
2036
+ id: string;
2037
+ createdAt: Date;
2038
+ updatedAt: Date;
2039
+ email: string;
2040
+ emailVerified: boolean;
2041
+ name: string;
2042
+ image?: string | null | undefined;
2043
+ role: string;
2044
+ };
2045
+ }>;
3025
2046
  };
3026
2047
  };
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
- };
2048
+ session: {
2049
+ create: {
2050
+ before(session: {
2051
+ id: string;
2052
+ createdAt: Date;
2053
+ updatedAt: Date;
2054
+ userId: string;
2055
+ expiresAt: Date;
2056
+ token: string;
2057
+ ipAddress?: string | null | undefined;
2058
+ userAgent?: string | null | undefined;
2059
+ } & Record<string, unknown>, ctx: better_auth.GenericEndpointContext | null): Promise<void>;
3055
2060
  };
3056
2061
  };
3057
2062
  };
3058
- }, {
3059
- sessions: better_auth_plugins.SessionWithImpersonatedBy[];
3060
- }>;
3061
- unbanUser: better_call.StrictEndpoint<"/admin/unban-user", {
2063
+ };
2064
+ };
2065
+ hooks: {
2066
+ after: {
2067
+ matcher(context: better_auth.HookEndpointContext): boolean;
2068
+ handler: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<better_auth_plugins.SessionWithImpersonatedBy[] | undefined>>;
2069
+ }[];
2070
+ };
2071
+ endpoints: {
2072
+ setRole: better_call.StrictEndpoint<"/admin/set-role", {
3062
2073
  method: "POST";
3063
2074
  body: zod.ZodObject<{
3064
2075
  userId: zod.ZodCoercedString<unknown>;
2076
+ role: zod.ZodUnion<readonly [zod.ZodString, zod.ZodArray<zod.ZodString>]>;
3065
2077
  }, zod_v4_core.$strip>;
2078
+ requireHeaders: true;
3066
2079
  use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
3067
2080
  session: {
3068
2081
  user: better_auth_plugins.UserWithRole;
@@ -3101,63 +2114,20 @@ declare const signUp: {
3101
2114
  };
3102
2115
  };
3103
2116
  };
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;
2117
+ $Infer: {
2118
+ body: {
3122
2119
  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
- };
2120
+ role: "user" | "admin" | ("user" | "admin")[];
3151
2121
  };
3152
2122
  };
3153
2123
  };
3154
2124
  }, {
3155
2125
  user: better_auth_plugins.UserWithRole;
3156
2126
  }>;
3157
- impersonateUser: better_call.StrictEndpoint<"/admin/impersonate-user", {
3158
- method: "POST";
3159
- body: zod.ZodObject<{
3160
- userId: zod.ZodCoercedString<unknown>;
2127
+ getUser: better_call.StrictEndpoint<"/admin/get-user", {
2128
+ method: "GET";
2129
+ query: zod.ZodObject<{
2130
+ id: zod.ZodString;
3161
2131
  }, zod_v4_core.$strip>;
3162
2132
  use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
3163
2133
  session: {
@@ -3187,9 +2157,6 @@ declare const signUp: {
3187
2157
  schema: {
3188
2158
  type: "object";
3189
2159
  properties: {
3190
- session: {
3191
- $ref: string;
3192
- };
3193
2160
  user: {
3194
2161
  $ref: string;
3195
2162
  };
@@ -3201,63 +2168,16 @@ declare const signUp: {
3201
2168
  };
3202
2169
  };
3203
2170
  };
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", {
2171
+ }, better_auth_plugins.UserWithRole>;
2172
+ createUser: better_call.StrictEndpoint<"/admin/create-user", {
3242
2173
  method: "POST";
3243
2174
  body: zod.ZodObject<{
3244
- sessionToken: zod.ZodString;
2175
+ email: zod.ZodString;
2176
+ password: zod.ZodOptional<zod.ZodString>;
2177
+ name: zod.ZodString;
2178
+ role: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodString, zod.ZodArray<zod.ZodString>]>>;
2179
+ data: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodAny>>;
3245
2180
  }, 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
2181
  metadata: {
3262
2182
  openapi: {
3263
2183
  operationId: string;
@@ -3271,8 +2191,8 @@ declare const signUp: {
3271
2191
  schema: {
3272
2192
  type: "object";
3273
2193
  properties: {
3274
- success: {
3275
- type: string;
2194
+ user: {
2195
+ $ref: string;
3276
2196
  };
3277
2197
  };
3278
2198
  };
@@ -3281,61 +2201,24 @@ declare const signUp: {
3281
2201
  };
3282
2202
  };
3283
2203
  };
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
- };
2204
+ $Infer: {
2205
+ body: {
2206
+ email: string;
2207
+ password?: string | undefined;
2208
+ name: string;
2209
+ role?: "user" | "admin" | ("user" | "admin")[] | undefined;
2210
+ data?: Record<string, any> | undefined;
3329
2211
  };
3330
2212
  };
3331
2213
  };
3332
2214
  }, {
3333
- success: boolean;
2215
+ user: better_auth_plugins.UserWithRole;
3334
2216
  }>;
3335
- removeUser: better_call.StrictEndpoint<"/admin/remove-user", {
2217
+ adminUpdateUser: better_call.StrictEndpoint<"/admin/update-user", {
3336
2218
  method: "POST";
3337
2219
  body: zod.ZodObject<{
3338
2220
  userId: zod.ZodCoercedString<unknown>;
2221
+ data: zod.ZodRecord<zod.ZodAny, zod.ZodAny>;
3339
2222
  }, zod_v4_core.$strip>;
3340
2223
  use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
3341
2224
  session: {
@@ -3365,8 +2248,8 @@ declare const signUp: {
3365
2248
  schema: {
3366
2249
  type: "object";
3367
2250
  properties: {
3368
- success: {
3369
- type: string;
2251
+ user: {
2252
+ $ref: string;
3370
2253
  };
3371
2254
  };
3372
2255
  };
@@ -3374,17 +2257,11 @@ declare const signUp: {
3374
2257
  };
3375
2258
  };
3376
2259
  };
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>;
2260
+ };
2261
+ };
2262
+ }, better_auth_plugins.UserWithRole>;
2263
+ listUsers: better_call.StrictEndpoint<"/admin/list-users", {
2264
+ method: "GET";
3388
2265
  use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
3389
2266
  session: {
3390
2267
  user: better_auth_plugins.UserWithRole;
@@ -3400,6 +2277,40 @@ declare const signUp: {
3400
2277
  };
3401
2278
  };
3402
2279
  }>>[];
2280
+ query: zod.ZodObject<{
2281
+ searchValue: zod.ZodOptional<zod.ZodString>;
2282
+ searchField: zod.ZodOptional<zod.ZodEnum<{
2283
+ email: "email";
2284
+ name: "name";
2285
+ }>>;
2286
+ searchOperator: zod.ZodOptional<zod.ZodEnum<{
2287
+ contains: "contains";
2288
+ starts_with: "starts_with";
2289
+ ends_with: "ends_with";
2290
+ }>>;
2291
+ limit: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>>;
2292
+ offset: zod.ZodOptional<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>>;
2293
+ sortBy: zod.ZodOptional<zod.ZodString>;
2294
+ sortDirection: zod.ZodOptional<zod.ZodEnum<{
2295
+ asc: "asc";
2296
+ desc: "desc";
2297
+ }>>;
2298
+ filterField: zod.ZodOptional<zod.ZodString>;
2299
+ 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>]>>;
2300
+ filterOperator: zod.ZodOptional<zod.ZodEnum<{
2301
+ in: "in";
2302
+ lte: "lte";
2303
+ eq: "eq";
2304
+ ne: "ne";
2305
+ lt: "lt";
2306
+ gt: "gt";
2307
+ gte: "gte";
2308
+ not_in: "not_in";
2309
+ contains: "contains";
2310
+ starts_with: "starts_with";
2311
+ ends_with: "ends_with";
2312
+ }>>;
2313
+ }, zod_v4_core.$strip>;
3403
2314
  metadata: {
3404
2315
  openapi: {
3405
2316
  operationId: string;
@@ -3413,61 +2324,19 @@ declare const signUp: {
3413
2324
  schema: {
3414
2325
  type: "object";
3415
2326
  properties: {
3416
- status: {
2327
+ users: {
3417
2328
  type: string;
2329
+ items: {
2330
+ $ref: string;
2331
+ };
3418
2332
  };
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: {
2333
+ total: {
3468
2334
  type: string;
3469
2335
  };
3470
- success: {
2336
+ limit: {
2337
+ type: string;
2338
+ };
2339
+ offset: {
3471
2340
  type: string;
3472
2341
  };
3473
2342
  };
@@ -3478,190 +2347,34 @@ declare const signUp: {
3478
2347
  };
3479
2348
  };
3480
2349
  };
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
2350
  };
3493
2351
  }, {
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"];
2352
+ users: better_auth_plugins.UserWithRole[];
2353
+ total: number;
3563
2354
  }>;
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", {
2355
+ listUserSessions: better_call.StrictEndpoint<"/admin/list-user-sessions", {
3624
2356
  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
2357
  use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
3641
2358
  session: {
3642
- session: Record<string, any> & {
2359
+ user: better_auth_plugins.UserWithRole;
2360
+ session: {
3643
2361
  id: string;
3644
2362
  createdAt: Date;
3645
2363
  updatedAt: Date;
3646
2364
  userId: string;
3647
2365
  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;
2366
+ token: string;
2367
+ ipAddress?: string | null | undefined;
2368
+ userAgent?: string | null | undefined;
3660
2369
  };
3661
2370
  };
3662
2371
  }>>[];
2372
+ body: zod.ZodObject<{
2373
+ userId: zod.ZodCoercedString<unknown>;
2374
+ }, zod_v4_core.$strip>;
3663
2375
  metadata: {
3664
2376
  openapi: {
2377
+ operationId: string;
3665
2378
  summary: string;
3666
2379
  description: string;
3667
2380
  responses: {
@@ -3672,24 +2385,13 @@ declare const signUp: {
3672
2385
  schema: {
3673
2386
  type: "object";
3674
2387
  properties: {
3675
- method: {
3676
- type: string;
3677
- enum: string[];
3678
- description: string;
3679
- };
3680
- totpURI: {
3681
- type: string;
3682
- description: string;
3683
- };
3684
- backupCodes: {
2388
+ sessions: {
3685
2389
  type: string;
3686
2390
  items: {
3687
- type: string;
2391
+ $ref: string;
3688
2392
  };
3689
- description: string;
3690
2393
  };
3691
2394
  };
3692
- required: string[];
3693
2395
  };
3694
2396
  };
3695
2397
  };
@@ -3698,22 +2400,17 @@ declare const signUp: {
3698
2400
  };
3699
2401
  };
3700
2402
  }, {
3701
- method: "otp";
3702
- } | {
3703
- method: "totp";
3704
- totpURI: string;
3705
- backupCodes: string[];
2403
+ sessions: better_auth_plugins.SessionWithImpersonatedBy[];
3706
2404
  }>;
3707
- disableTwoFactor: better_call.StrictEndpoint<"/two-factor/disable", {
2405
+ unbanUser: better_call.StrictEndpoint<"/admin/unban-user", {
3708
2406
  method: "POST";
3709
2407
  body: zod.ZodObject<{
3710
- password: zod.ZodOptional<zod.ZodString>;
3711
- }, zod_v4_core.$strip> | zod.ZodObject<{
3712
- password: zod.ZodString;
2408
+ userId: zod.ZodCoercedString<unknown>;
3713
2409
  }, zod_v4_core.$strip>;
3714
2410
  use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
3715
2411
  session: {
3716
- session: Record<string, any> & {
2412
+ user: better_auth_plugins.UserWithRole;
2413
+ session: {
3717
2414
  id: string;
3718
2415
  createdAt: Date;
3719
2416
  updatedAt: Date;
@@ -3723,19 +2420,11 @@ declare const signUp: {
3723
2420
  ipAddress?: string | null | undefined;
3724
2421
  userAgent?: string | null | undefined;
3725
2422
  };
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
2423
  };
3736
2424
  }>>[];
3737
2425
  metadata: {
3738
2426
  openapi: {
2427
+ operationId: string;
3739
2428
  summary: string;
3740
2429
  description: string;
3741
2430
  responses: {
@@ -3746,8 +2435,8 @@ declare const signUp: {
3746
2435
  schema: {
3747
2436
  type: "object";
3748
2437
  properties: {
3749
- status: {
3750
- type: string;
2438
+ user: {
2439
+ $ref: string;
3751
2440
  };
3752
2441
  };
3753
2442
  };
@@ -3758,20 +2447,37 @@ declare const signUp: {
3758
2447
  };
3759
2448
  };
3760
2449
  }, {
3761
- status: boolean;
2450
+ user: better_auth_plugins.UserWithRole;
3762
2451
  }>;
3763
- verifyBackupCode: better_call.StrictEndpoint<"/two-factor/verify-backup-code", {
2452
+ banUser: better_call.StrictEndpoint<"/admin/ban-user", {
3764
2453
  method: "POST";
3765
2454
  body: zod.ZodObject<{
3766
- code: zod.ZodString;
3767
- disableSession: zod.ZodOptional<zod.ZodBoolean>;
3768
- trustDevice: zod.ZodOptional<zod.ZodBoolean>;
2455
+ userId: zod.ZodCoercedString<unknown>;
2456
+ banReason: zod.ZodOptional<zod.ZodString>;
2457
+ banExpiresIn: zod.ZodOptional<zod.ZodNumber>;
3769
2458
  }, zod_v4_core.$strip>;
2459
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
2460
+ session: {
2461
+ user: better_auth_plugins.UserWithRole;
2462
+ session: {
2463
+ id: string;
2464
+ createdAt: Date;
2465
+ updatedAt: Date;
2466
+ userId: string;
2467
+ expiresAt: Date;
2468
+ token: string;
2469
+ ipAddress?: string | null | undefined;
2470
+ userAgent?: string | null | undefined;
2471
+ };
2472
+ };
2473
+ }>>[];
3770
2474
  metadata: {
3771
2475
  openapi: {
2476
+ operationId: string;
2477
+ summary: string;
3772
2478
  description: string;
3773
2479
  responses: {
3774
- "200": {
2480
+ 200: {
3775
2481
  description: string;
3776
2482
  content: {
3777
2483
  "application/json": {
@@ -3779,79 +2485,9 @@ declare const signUp: {
3779
2485
  type: "object";
3780
2486
  properties: {
3781
2487
  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;
2488
+ $ref: string;
3852
2489
  };
3853
2490
  };
3854
- required: string[];
3855
2491
  };
3856
2492
  };
3857
2493
  };
@@ -3860,27 +2496,17 @@ declare const signUp: {
3860
2496
  };
3861
2497
  };
3862
2498
  }, {
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;
2499
+ user: better_auth_plugins.UserWithRole;
3873
2500
  }>;
3874
- generateBackupCodes: better_call.StrictEndpoint<"/two-factor/generate-backup-codes", {
2501
+ impersonateUser: better_call.StrictEndpoint<"/admin/impersonate-user", {
3875
2502
  method: "POST";
3876
2503
  body: zod.ZodObject<{
3877
- password: zod.ZodOptional<zod.ZodString>;
3878
- }, zod_v4_core.$strip> | zod.ZodObject<{
3879
- password: zod.ZodString;
2504
+ userId: zod.ZodCoercedString<unknown>;
3880
2505
  }, zod_v4_core.$strip>;
3881
2506
  use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
3882
2507
  session: {
3883
- session: Record<string, any> & {
2508
+ user: better_auth_plugins.UserWithRole;
2509
+ session: {
3884
2510
  id: string;
3885
2511
  createdAt: Date;
3886
2512
  updatedAt: Date;
@@ -3890,42 +2516,28 @@ declare const signUp: {
3890
2516
  ipAddress?: string | null | undefined;
3891
2517
  userAgent?: string | null | undefined;
3892
2518
  };
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
2519
  };
3903
2520
  }>>[];
3904
2521
  metadata: {
3905
2522
  openapi: {
2523
+ operationId: string;
2524
+ summary: string;
3906
2525
  description: string;
3907
2526
  responses: {
3908
- "200": {
2527
+ 200: {
3909
2528
  description: string;
3910
2529
  content: {
3911
2530
  "application/json": {
3912
2531
  schema: {
3913
2532
  type: "object";
3914
2533
  properties: {
3915
- status: {
3916
- type: string;
3917
- description: string;
3918
- enum: boolean[];
2534
+ session: {
2535
+ $ref: string;
3919
2536
  };
3920
- backupCodes: {
3921
- type: string;
3922
- items: {
3923
- type: string;
3924
- };
3925
- description: string;
2537
+ user: {
2538
+ $ref: string;
3926
2539
  };
3927
2540
  };
3928
- required: string[];
3929
2541
  };
3930
2542
  };
3931
2543
  };
@@ -3934,25 +2546,65 @@ declare const signUp: {
3934
2546
  };
3935
2547
  };
3936
2548
  }, {
3937
- status: boolean;
3938
- backupCodes: string[];
2549
+ session: {
2550
+ id: string;
2551
+ createdAt: Date;
2552
+ updatedAt: Date;
2553
+ userId: string;
2554
+ expiresAt: Date;
2555
+ token: string;
2556
+ ipAddress?: string | null | undefined;
2557
+ userAgent?: string | null | undefined;
2558
+ };
2559
+ user: better_auth_plugins.UserWithRole;
3939
2560
  }>;
3940
- viewBackupCodes: better_call.StrictEndpoint<string, {
2561
+ stopImpersonating: better_call.StrictEndpoint<"/admin/stop-impersonating", {
3941
2562
  method: "POST";
3942
- body: zod.ZodObject<{
3943
- userId: zod.ZodCoercedString<unknown>;
3944
- }, zod_v4_core.$strip>;
2563
+ requireHeaders: true;
3945
2564
  }, {
3946
- status: boolean;
3947
- backupCodes: string[];
2565
+ session: {
2566
+ id: string;
2567
+ createdAt: Date;
2568
+ updatedAt: Date;
2569
+ userId: string;
2570
+ expiresAt: Date;
2571
+ token: string;
2572
+ ipAddress?: string | null | undefined;
2573
+ userAgent?: string | null | undefined;
2574
+ } & Record<string, any>;
2575
+ user: {
2576
+ id: string;
2577
+ createdAt: Date;
2578
+ updatedAt: Date;
2579
+ email: string;
2580
+ emailVerified: boolean;
2581
+ name: string;
2582
+ image?: string | null | undefined;
2583
+ } & Record<string, any>;
3948
2584
  }>;
3949
- sendTwoFactorOTP: better_call.StrictEndpoint<"/two-factor/send-otp", {
2585
+ revokeUserSession: better_call.StrictEndpoint<"/admin/revoke-user-session", {
3950
2586
  method: "POST";
3951
- body: zod.ZodOptional<zod.ZodObject<{
3952
- trustDevice: zod.ZodOptional<zod.ZodBoolean>;
3953
- }, zod_v4_core.$strip>>;
2587
+ body: zod.ZodObject<{
2588
+ sessionToken: zod.ZodString;
2589
+ }, zod_v4_core.$strip>;
2590
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
2591
+ session: {
2592
+ user: better_auth_plugins.UserWithRole;
2593
+ session: {
2594
+ id: string;
2595
+ createdAt: Date;
2596
+ updatedAt: Date;
2597
+ userId: string;
2598
+ expiresAt: Date;
2599
+ token: string;
2600
+ ipAddress?: string | null | undefined;
2601
+ userAgent?: string | null | undefined;
2602
+ };
2603
+ };
2604
+ }>>[];
3954
2605
  metadata: {
3955
2606
  openapi: {
2607
+ operationId: string;
3956
2608
  summary: string;
3957
2609
  description: string;
3958
2610
  responses: {
@@ -3963,7 +2615,7 @@ declare const signUp: {
3963
2615
  schema: {
3964
2616
  type: "object";
3965
2617
  properties: {
3966
- status: {
2618
+ success: {
3967
2619
  type: string;
3968
2620
  };
3969
2621
  };
@@ -3975,75 +2627,45 @@ declare const signUp: {
3975
2627
  };
3976
2628
  };
3977
2629
  }, {
3978
- status: boolean;
2630
+ success: boolean;
3979
2631
  }>;
3980
- verifyTwoFactorOTP: better_call.StrictEndpoint<"/two-factor/verify-otp", {
2632
+ revokeUserSessions: better_call.StrictEndpoint<"/admin/revoke-user-sessions", {
3981
2633
  method: "POST";
3982
2634
  body: zod.ZodObject<{
3983
- code: zod.ZodString;
3984
- trustDevice: zod.ZodOptional<zod.ZodBoolean>;
2635
+ userId: zod.ZodCoercedString<unknown>;
3985
2636
  }, zod_v4_core.$strip>;
2637
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
2638
+ session: {
2639
+ user: better_auth_plugins.UserWithRole;
2640
+ session: {
2641
+ id: string;
2642
+ createdAt: Date;
2643
+ updatedAt: Date;
2644
+ userId: string;
2645
+ expiresAt: Date;
2646
+ token: string;
2647
+ ipAddress?: string | null | undefined;
2648
+ userAgent?: string | null | undefined;
2649
+ };
2650
+ };
2651
+ }>>[];
3986
2652
  metadata: {
3987
2653
  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;
2654
+ operationId: string;
2655
+ summary: string;
2656
+ description: string;
2657
+ responses: {
2658
+ 200: {
2659
+ description: string;
2660
+ content: {
2661
+ "application/json": {
2662
+ schema: {
2663
+ type: "object";
2664
+ properties: {
2665
+ success: {
2666
+ type: string;
4044
2667
  };
4045
2668
  };
4046
- required: string[];
4047
2669
  };
4048
2670
  };
4049
2671
  };
@@ -4052,27 +2674,31 @@ declare const signUp: {
4052
2674
  };
4053
2675
  };
4054
2676
  }, {
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
- };
2677
+ success: boolean;
4068
2678
  }>;
4069
- generateTOTP: better_call.StrictEndpoint<string, {
2679
+ removeUser: better_call.StrictEndpoint<"/admin/remove-user", {
4070
2680
  method: "POST";
4071
2681
  body: zod.ZodObject<{
4072
- secret: zod.ZodString;
2682
+ userId: zod.ZodCoercedString<unknown>;
4073
2683
  }, zod_v4_core.$strip>;
2684
+ use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
2685
+ session: {
2686
+ user: better_auth_plugins.UserWithRole;
2687
+ session: {
2688
+ id: string;
2689
+ createdAt: Date;
2690
+ updatedAt: Date;
2691
+ userId: string;
2692
+ expiresAt: Date;
2693
+ token: string;
2694
+ ipAddress?: string | null | undefined;
2695
+ userAgent?: string | null | undefined;
2696
+ };
2697
+ };
2698
+ }>>[];
4074
2699
  metadata: {
4075
2700
  openapi: {
2701
+ operationId: string;
4076
2702
  summary: string;
4077
2703
  description: string;
4078
2704
  responses: {
@@ -4083,7 +2709,7 @@ declare const signUp: {
4083
2709
  schema: {
4084
2710
  type: "object";
4085
2711
  properties: {
4086
- code: {
2712
+ success: {
4087
2713
  type: string;
4088
2714
  };
4089
2715
  };
@@ -4095,13 +2721,18 @@ declare const signUp: {
4095
2721
  };
4096
2722
  };
4097
2723
  }, {
4098
- code: string;
2724
+ success: boolean;
4099
2725
  }>;
4100
- getTOTPURI: better_call.StrictEndpoint<"/two-factor/get-totp-uri", {
2726
+ setUserPassword: better_call.StrictEndpoint<"/admin/set-user-password", {
4101
2727
  method: "POST";
2728
+ body: zod.ZodObject<{
2729
+ newPassword: zod.ZodString;
2730
+ userId: zod.ZodCoercedString<unknown>;
2731
+ }, zod_v4_core.$strip>;
4102
2732
  use: better_call.Middleware<better_call.MiddlewareOptions, (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<{
4103
2733
  session: {
4104
- session: Record<string, any> & {
2734
+ user: better_auth_plugins.UserWithRole;
2735
+ session: {
4105
2736
  id: string;
4106
2737
  createdAt: Date;
4107
2738
  updatedAt: Date;
@@ -4111,24 +2742,11 @@ declare const signUp: {
4111
2742
  ipAddress?: string | null | undefined;
4112
2743
  userAgent?: string | null | undefined;
4113
2744
  };
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
2745
  };
4124
2746
  }>>[];
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
2747
  metadata: {
4131
2748
  openapi: {
2749
+ operationId: string;
4132
2750
  summary: string;
4133
2751
  description: string;
4134
2752
  responses: {
@@ -4139,7 +2757,7 @@ declare const signUp: {
4139
2757
  schema: {
4140
2758
  type: "object";
4141
2759
  properties: {
4142
- totpURI: {
2760
+ status: {
4143
2761
  type: string;
4144
2762
  };
4145
2763
  };
@@ -4151,140 +2769,202 @@ declare const signUp: {
4151
2769
  };
4152
2770
  };
4153
2771
  }, {
4154
- totpURI: string;
2772
+ status: boolean;
4155
2773
  }>;
4156
- verifyTOTP: better_call.StrictEndpoint<"/two-factor/verify-totp", {
2774
+ userHasPermission: better_call.StrictEndpoint<"/admin/has-permission", {
4157
2775
  method: "POST";
4158
- body: zod.ZodObject<{
4159
- code: zod.ZodString;
4160
- trustDevice: zod.ZodOptional<zod.ZodBoolean>;
4161
- }, zod_v4_core.$strip>;
2776
+ body: zod.ZodIntersection<zod.ZodObject<{
2777
+ userId: zod.ZodOptional<zod.ZodCoercedString<unknown>>;
2778
+ role: zod.ZodOptional<zod.ZodString>;
2779
+ }, zod_v4_core.$strip>, zod.ZodXor<readonly [zod.ZodObject<{
2780
+ permission: zod.ZodRecord<zod.ZodString, zod.ZodArray<zod.ZodString>>;
2781
+ }, zod_v4_core.$strip>, zod.ZodObject<{
2782
+ permissions: zod.ZodRecord<zod.ZodString, zod.ZodArray<zod.ZodString>>;
2783
+ }, zod_v4_core.$strip>]>>;
4162
2784
  metadata: {
4163
2785
  openapi: {
4164
- summary: string;
4165
2786
  description: string;
2787
+ requestBody: {
2788
+ content: {
2789
+ "application/json": {
2790
+ schema: {
2791
+ type: "object";
2792
+ properties: {
2793
+ permissions: {
2794
+ type: string;
2795
+ description: string;
2796
+ };
2797
+ };
2798
+ required: string[];
2799
+ };
2800
+ };
2801
+ };
2802
+ };
4166
2803
  responses: {
4167
- 200: {
2804
+ "200": {
4168
2805
  description: string;
4169
2806
  content: {
4170
2807
  "application/json": {
4171
2808
  schema: {
4172
2809
  type: "object";
4173
2810
  properties: {
4174
- status: {
2811
+ error: {
2812
+ type: string;
2813
+ };
2814
+ success: {
4175
2815
  type: string;
4176
2816
  };
4177
2817
  };
2818
+ required: string[];
4178
2819
  };
4179
2820
  };
4180
2821
  };
4181
2822
  };
4182
2823
  };
4183
2824
  };
2825
+ $Infer: {
2826
+ body: {
2827
+ permissions: {
2828
+ readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "set-phone" | "get" | "update")[] | undefined;
2829
+ readonly session?: ("list" | "delete" | "revoke")[] | undefined;
2830
+ };
2831
+ } & {
2832
+ userId?: string | undefined;
2833
+ role?: "user" | "admin" | undefined;
2834
+ };
2835
+ };
4184
2836
  };
4185
2837
  }, {
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
- };
2838
+ error: null;
2839
+ success: boolean;
4199
2840
  }>;
4200
2841
  };
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
- }[];
2842
+ $ERROR_CODES: {
2843
+ USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: better_auth.RawError<"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL">;
2844
+ FAILED_TO_CREATE_USER: better_auth.RawError<"FAILED_TO_CREATE_USER">;
2845
+ USER_ALREADY_EXISTS: better_auth.RawError<"USER_ALREADY_EXISTS">;
2846
+ YOU_CANNOT_BAN_YOURSELF: better_auth.RawError<"YOU_CANNOT_BAN_YOURSELF">;
2847
+ YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE">;
2848
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS">;
2849
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS">;
2850
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS">;
2851
+ YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_BAN_USERS">;
2852
+ YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS">;
2853
+ YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS">;
2854
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS">;
2855
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD">;
2856
+ BANNED_USER: better_auth.RawError<"BANNED_USER">;
2857
+ YOU_ARE_NOT_ALLOWED_TO_GET_USER: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_USER">;
2858
+ NO_DATA_TO_UPDATE: better_auth.RawError<"NO_DATA_TO_UPDATE">;
2859
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS">;
2860
+ YOU_CANNOT_REMOVE_YOURSELF: better_auth.RawError<"YOU_CANNOT_REMOVE_YOURSELF">;
2861
+ YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE">;
2862
+ YOU_CANNOT_IMPERSONATE_ADMINS: better_auth.RawError<"YOU_CANNOT_IMPERSONATE_ADMINS">;
2863
+ INVALID_ROLE_TYPE: better_auth.RawError<"INVALID_ROLE_TYPE">;
2864
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL">;
2865
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PHONE_NUMBER: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PHONE_NUMBER">;
2866
+ PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER: better_auth.RawError<"PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER">;
2867
+ USER_ID_CANNOT_BE_UPDATED: better_auth.RawError<"USER_ID_CANNOT_BE_UPDATED">;
4210
2868
  };
4211
2869
  schema: {
4212
2870
  user: {
4213
2871
  fields: {
4214
- twoFactorEnabled: {
4215
- type: "boolean";
2872
+ role: {
2873
+ type: "string";
4216
2874
  required: false;
4217
- defaultValue: false;
4218
2875
  input: false;
4219
2876
  };
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: {
2877
+ banned: {
4246
2878
  type: "boolean";
2879
+ defaultValue: false;
4247
2880
  required: false;
4248
- defaultValue: true;
4249
2881
  input: false;
4250
2882
  };
4251
- failedVerificationCount: {
4252
- type: "number";
2883
+ banReason: {
2884
+ type: "string";
4253
2885
  required: false;
4254
- defaultValue: number;
4255
2886
  input: false;
4256
- returned: false;
4257
2887
  };
4258
- lockedUntil: {
2888
+ banExpires: {
4259
2889
  type: "date";
4260
2890
  required: false;
4261
2891
  input: false;
4262
- returned: false;
2892
+ };
2893
+ };
2894
+ };
2895
+ session: {
2896
+ fields: {
2897
+ impersonatedBy: {
2898
+ type: "string";
2899
+ required: false;
2900
+ input: false;
4263
2901
  };
4264
2902
  };
4265
2903
  };
4266
2904
  };
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">;
2905
+ options: NoInfer<{
2906
+ ac: better_auth_plugins.AccessControl<{
2907
+ readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "impersonate-admins", "delete", "set-password", "set-email", "set-phone", "get", "update"];
2908
+ readonly session: readonly ["list", "revoke", "delete"];
2909
+ }>;
2910
+ roles: {
2911
+ admin: better_auth_plugins.Role;
2912
+ user: better_auth_plugins.Role;
2913
+ };
2914
+ }>;
2915
+ };
2916
+ getActions: () => {
2917
+ admin: {
2918
+ checkRolePermission: <R extends "user" | "admin">(data: {
2919
+ permissions: {
2920
+ readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "set-phone" | "get" | "update")[] | undefined;
2921
+ readonly session?: ("list" | "delete" | "revoke")[] | undefined;
2922
+ };
2923
+ } & {
2924
+ role: R;
2925
+ }) => boolean;
4286
2926
  };
4287
- })>;
2927
+ };
2928
+ pathMethods: {
2929
+ "/admin/list-users": "GET";
2930
+ "/admin/impersonate-user": "POST";
2931
+ "/admin/stop-impersonating": "POST";
2932
+ };
2933
+ atomListeners: {
2934
+ matcher: (path: string) => path is "/admin/impersonate-user" | "/admin/stop-impersonating";
2935
+ signal: "$sessionSignal";
2936
+ }[];
2937
+ $ERROR_CODES: {
2938
+ USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: better_auth.RawError<"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL">;
2939
+ FAILED_TO_CREATE_USER: better_auth.RawError<"FAILED_TO_CREATE_USER">;
2940
+ USER_ALREADY_EXISTS: better_auth.RawError<"USER_ALREADY_EXISTS">;
2941
+ YOU_CANNOT_BAN_YOURSELF: better_auth.RawError<"YOU_CANNOT_BAN_YOURSELF">;
2942
+ YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE">;
2943
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS">;
2944
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS">;
2945
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS">;
2946
+ YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_BAN_USERS">;
2947
+ YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS">;
2948
+ YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS">;
2949
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS">;
2950
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD">;
2951
+ BANNED_USER: better_auth.RawError<"BANNED_USER">;
2952
+ YOU_ARE_NOT_ALLOWED_TO_GET_USER: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_USER">;
2953
+ NO_DATA_TO_UPDATE: better_auth.RawError<"NO_DATA_TO_UPDATE">;
2954
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS">;
2955
+ YOU_CANNOT_REMOVE_YOURSELF: better_auth.RawError<"YOU_CANNOT_REMOVE_YOURSELF">;
2956
+ YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE">;
2957
+ YOU_CANNOT_IMPERSONATE_ADMINS: better_auth.RawError<"YOU_CANNOT_IMPERSONATE_ADMINS">;
2958
+ INVALID_ROLE_TYPE: better_auth.RawError<"INVALID_ROLE_TYPE">;
2959
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL">;
2960
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PHONE_NUMBER: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PHONE_NUMBER">;
2961
+ PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER: better_auth.RawError<"PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER">;
2962
+ USER_ID_CANNOT_BE_UPDATED: better_auth.RawError<"USER_ID_CANNOT_BE_UPDATED">;
2963
+ };
2964
+ } | {
2965
+ id: "two-factor";
2966
+ version: string;
2967
+ $InferServerPlugin: ReturnType<typeof better_auth_plugins.twoFactor>;
4288
2968
  atomListeners: {
4289
2969
  matcher: (path: string) => boolean;
4290
2970
  signal: "$sessionSignal";
@@ -4327,6 +3007,12 @@ declare const signUp: {
4327
3007
  $InferServerPlugin: ReturnType<(options?: _better_auth_passkey.PasskeyOptions | undefined) => {
4328
3008
  id: "passkey";
4329
3009
  version: string;
3010
+ init(ctx: better_auth.AuthContext): {
3011
+ context: {
3012
+ passkeyBaseURLFromRequest: boolean;
3013
+ passkeyWildcardCoversRpID: boolean;
3014
+ };
3015
+ };
4330
3016
  endpoints: {
4331
3017
  generatePasskeyRegistrationOptions: better_call.StrictEndpoint<"/passkey/generate-register-options", {
4332
3018
  method: "GET";
@@ -4900,6 +3586,7 @@ declare const signUp: {
4900
3586
  };
4901
3587
  };
4902
3588
  $ERROR_CODES: {
3589
+ ORIGIN_NOT_CONFIGURED: better_auth.RawError<"ORIGIN_NOT_CONFIGURED">;
4903
3590
  CHALLENGE_NOT_FOUND: better_auth.RawError<"CHALLENGE_NOT_FOUND">;
4904
3591
  YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
4905
3592
  FAILED_TO_VERIFY_REGISTRATION: better_auth.RawError<"FAILED_TO_VERIFY_REGISTRATION">;
@@ -5100,6 +3787,7 @@ declare const signUp: {
5100
3787
  signal: "$sessionSignal";
5101
3788
  })[];
5102
3789
  $ERROR_CODES: {
3790
+ ORIGIN_NOT_CONFIGURED: better_auth.RawError<"ORIGIN_NOT_CONFIGURED">;
5103
3791
  CHALLENGE_NOT_FOUND: better_auth.RawError<"CHALLENGE_NOT_FOUND">;
5104
3792
  YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
5105
3793
  FAILED_TO_VERIFY_REGISTRATION: better_auth.RawError<"FAILED_TO_VERIFY_REGISTRATION">;