@protobase/client 0.3.5 → 0.4.1

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.
@@ -0,0 +1,2241 @@
1
+ import { $strip } from "./node_modules/.bun/zod@4.6.5/node_modules/zod/v4/core/schemas.js";
2
+ import { ZodAny, ZodBoolean, ZodDefault, ZodEnum, ZodIntersection, ZodObject, ZodOptional, ZodRecord, ZodString } from "./node_modules/.bun/zod@4.6.5/node_modules/zod/v4/classic/schemas.js";
3
+ import { ZodCoercedString } from "./node_modules/.bun/zod@4.6.5/node_modules/zod/v4/classic/coerce.js";
4
+ //#region src/better-auth-client.d.ts
5
+ /** Better Auth's browser client with the plugins `createAuth` turns on: tokens, emailed codes, two-factor authentication and passkeys. */
6
+ export declare const betterAuthClient: (baseURL: string, basePath: string, fetch: typeof globalThis.fetch) => import("better-auth/client").AuthClient<{
7
+ baseURL: string;
8
+ basePath: string;
9
+ plugins: ({
10
+ id: "better-auth-client";
11
+ version: string;
12
+ $InferServerPlugin: ReturnType<(<O extends import("better-auth/plugins/jwt").JwtOptions>(options?: O) => {
13
+ id: "jwt";
14
+ version: string;
15
+ options: NoInfer<O>;
16
+ init(ctx: import("better-auth").AuthContext): {
17
+ context: {
18
+ sessionConfig: {
19
+ cookieCacheSigner: import("better-auth").CookieCacheSigner;
20
+ updateAge: number;
21
+ expiresIn: number;
22
+ freshAge: number;
23
+ cookieRefreshCache: false | {
24
+ enabled: true;
25
+ updateAge: number;
26
+ };
27
+ };
28
+ };
29
+ } | undefined;
30
+ endpoints: {
31
+ getJwks: import("better-auth").StrictEndpoint<string, {
32
+ method: "GET";
33
+ metadata: {
34
+ openapi: {
35
+ operationId: string;
36
+ description: string;
37
+ responses: {
38
+ "200": {
39
+ description: string;
40
+ content: {
41
+ "application/json": {
42
+ schema: {
43
+ type: "object";
44
+ properties: {
45
+ keys: {
46
+ type: string;
47
+ description: string;
48
+ items: {
49
+ type: string;
50
+ properties: {
51
+ kid: {
52
+ type: string;
53
+ description: string;
54
+ };
55
+ kty: {
56
+ type: string;
57
+ description: string;
58
+ };
59
+ alg: {
60
+ type: string;
61
+ description: string;
62
+ };
63
+ use: {
64
+ type: string;
65
+ description: string;
66
+ enum: string[];
67
+ nullable: boolean;
68
+ };
69
+ n: {
70
+ type: string;
71
+ description: string;
72
+ nullable: boolean;
73
+ };
74
+ e: {
75
+ type: string;
76
+ description: string;
77
+ nullable: boolean;
78
+ };
79
+ crv: {
80
+ type: string;
81
+ description: string;
82
+ nullable: boolean;
83
+ };
84
+ x: {
85
+ type: string;
86
+ description: string;
87
+ nullable: boolean;
88
+ };
89
+ y: {
90
+ type: string;
91
+ description: string;
92
+ nullable: boolean;
93
+ };
94
+ };
95
+ required: string[];
96
+ };
97
+ };
98
+ };
99
+ required: string[];
100
+ };
101
+ };
102
+ };
103
+ };
104
+ };
105
+ };
106
+ };
107
+ }, import("better-auth").JSONWebKeySet>;
108
+ getToken: import("better-auth").StrictEndpoint<"/token", {
109
+ method: "GET";
110
+ requireHeaders: true;
111
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
112
+ session: {
113
+ session: Record<string, any> & {
114
+ id: string;
115
+ createdAt: Date;
116
+ updatedAt: Date;
117
+ userId: string;
118
+ expiresAt: Date;
119
+ token: string;
120
+ ipAddress?: string | null | undefined;
121
+ userAgent?: string | null | undefined;
122
+ };
123
+ user: Record<string, any> & {
124
+ id: string;
125
+ createdAt: Date;
126
+ updatedAt: Date;
127
+ email: string;
128
+ emailVerified: boolean;
129
+ name: string;
130
+ image?: string | null | undefined;
131
+ };
132
+ };
133
+ }>>[];
134
+ metadata: {
135
+ openapi: {
136
+ operationId: string;
137
+ description: string;
138
+ responses: {
139
+ 200: {
140
+ description: string;
141
+ content: {
142
+ "application/json": {
143
+ schema: {
144
+ type: "object";
145
+ properties: {
146
+ token: {
147
+ type: string;
148
+ };
149
+ };
150
+ };
151
+ };
152
+ };
153
+ };
154
+ };
155
+ };
156
+ };
157
+ }, {
158
+ token: string;
159
+ }>;
160
+ signJWT: import("better-auth").StrictEndpoint<string, {
161
+ method: "POST";
162
+ metadata: {
163
+ $Infer: {
164
+ body: {
165
+ payload: import("better-auth").JWTPayload;
166
+ overrideOptions?: import("better-auth/plugins/jwt").JwtOptions | undefined;
167
+ };
168
+ };
169
+ };
170
+ body: ZodObject<{
171
+ payload: ZodRecord<ZodString, ZodAny>;
172
+ overrideOptions: ZodOptional<ZodRecord<ZodString, ZodAny>>;
173
+ }, $strip>;
174
+ }, {
175
+ token: string;
176
+ }>;
177
+ verifyJWT: import("better-auth").StrictEndpoint<string, {
178
+ method: "POST";
179
+ metadata: {
180
+ $Infer: {
181
+ body: {
182
+ token: string;
183
+ issuer?: string;
184
+ };
185
+ response: {
186
+ payload: {
187
+ sub: string;
188
+ aud: string;
189
+ [key: string]: any;
190
+ } | null;
191
+ };
192
+ };
193
+ };
194
+ body: ZodObject<{
195
+ token: ZodString;
196
+ issuer: ZodOptional<ZodString>;
197
+ }, $strip>;
198
+ }, {
199
+ payload: (import("better-auth").JWTPayload & Required<Pick<import("better-auth").JWTPayload, "sub" | "aud">>) | null;
200
+ }>;
201
+ };
202
+ hooks: {
203
+ after: {
204
+ matcher(context: import("better-auth").HookEndpointContext): boolean;
205
+ handler: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>>;
206
+ }[];
207
+ };
208
+ schema: {
209
+ jwks: {
210
+ fields: {
211
+ publicKey: {
212
+ type: "string";
213
+ required: true;
214
+ };
215
+ privateKey: {
216
+ type: "string";
217
+ required: true;
218
+ };
219
+ createdAt: {
220
+ type: "date";
221
+ required: true;
222
+ };
223
+ expiresAt: {
224
+ type: "date";
225
+ required: false;
226
+ };
227
+ alg: {
228
+ type: "string";
229
+ required: false;
230
+ };
231
+ crv: {
232
+ type: "string";
233
+ required: false;
234
+ };
235
+ };
236
+ };
237
+ };
238
+ })>;
239
+ pathMethods: {
240
+ [x: string]: "GET";
241
+ };
242
+ getActions: ($fetch: import("better-auth/client").BetterFetch, _$store: import("better-auth").ClientStore, _options: import("better-auth").BetterAuthClientOptions | undefined) => {
243
+ jwks: (fetchOptions?: import("better-auth").ClientFetchOption) => Promise<{
244
+ data: null;
245
+ error: {
246
+ message?: string | undefined;
247
+ status: number;
248
+ statusText: string;
249
+ };
250
+ } | {
251
+ data: import("better-auth").JSONWebKeySet;
252
+ error: null;
253
+ }>;
254
+ };
255
+ } | {
256
+ id: "email-otp";
257
+ version: string;
258
+ $InferServerPlugin: ReturnType<(options: import("better-auth/plugins/email-otp").EmailOTPOptions) => {
259
+ id: "email-otp";
260
+ version: string;
261
+ init(ctx: import("better-auth").AuthContext): {
262
+ options: {
263
+ emailVerification: {
264
+ sendVerificationEmail(data: {
265
+ user: import("better-auth").User;
266
+ url: string;
267
+ token: string;
268
+ }, request: Request | undefined): Promise<void>;
269
+ };
270
+ };
271
+ } | undefined;
272
+ endpoints: {
273
+ sendVerificationOTP: import("better-auth").StrictEndpoint<"/email-otp/send-verification-otp", {
274
+ method: "POST";
275
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>>[];
276
+ body: ZodObject<{
277
+ email: ZodString;
278
+ type: ZodEnum<{
279
+ "sign-in": "sign-in";
280
+ "change-email": "change-email";
281
+ "email-verification": "email-verification";
282
+ "forget-password": "forget-password";
283
+ }>;
284
+ }, $strip>;
285
+ metadata: {
286
+ openapi: {
287
+ operationId: string;
288
+ description: string;
289
+ responses: {
290
+ 200: {
291
+ description: string;
292
+ content: {
293
+ "application/json": {
294
+ schema: {
295
+ type: "object";
296
+ properties: {
297
+ success: {
298
+ type: string;
299
+ };
300
+ };
301
+ };
302
+ };
303
+ };
304
+ };
305
+ };
306
+ };
307
+ };
308
+ }, {
309
+ success: boolean;
310
+ }>;
311
+ createVerificationOTP: import("better-auth").StrictEndpoint<string, {
312
+ method: "POST";
313
+ body: ZodObject<{
314
+ email: ZodString;
315
+ type: ZodEnum<{
316
+ "sign-in": "sign-in";
317
+ "change-email": "change-email";
318
+ "email-verification": "email-verification";
319
+ "forget-password": "forget-password";
320
+ }>;
321
+ }, $strip>;
322
+ metadata: {
323
+ openapi: {
324
+ operationId: string;
325
+ description: string;
326
+ responses: {
327
+ 200: {
328
+ description: string;
329
+ content: {
330
+ "application/json": {
331
+ schema: {
332
+ type: "string";
333
+ };
334
+ };
335
+ };
336
+ };
337
+ };
338
+ };
339
+ };
340
+ }, string>;
341
+ getVerificationOTP: import("better-auth").StrictEndpoint<string, {
342
+ method: "GET";
343
+ query: ZodObject<{
344
+ email: ZodString;
345
+ type: ZodEnum<{
346
+ "sign-in": "sign-in";
347
+ "change-email": "change-email";
348
+ "email-verification": "email-verification";
349
+ "forget-password": "forget-password";
350
+ }>;
351
+ }, $strip>;
352
+ metadata: {
353
+ openapi: {
354
+ operationId: string;
355
+ description: string;
356
+ responses: {
357
+ "200": {
358
+ description: string;
359
+ content: {
360
+ "application/json": {
361
+ schema: {
362
+ type: "object";
363
+ properties: {
364
+ otp: {
365
+ type: string;
366
+ nullable: boolean;
367
+ description: string;
368
+ };
369
+ };
370
+ required: string[];
371
+ };
372
+ };
373
+ };
374
+ };
375
+ };
376
+ };
377
+ };
378
+ }, {
379
+ otp: null;
380
+ } | {
381
+ otp: string;
382
+ }>;
383
+ checkVerificationOTP: import("better-auth").StrictEndpoint<"/email-otp/check-verification-otp", {
384
+ method: "POST";
385
+ body: ZodObject<{
386
+ email: ZodString;
387
+ type: ZodEnum<{
388
+ "sign-in": "sign-in";
389
+ "change-email": "change-email";
390
+ "email-verification": "email-verification";
391
+ "forget-password": "forget-password";
392
+ }>;
393
+ otp: ZodString;
394
+ }, $strip>;
395
+ metadata: {
396
+ openapi: {
397
+ operationId: string;
398
+ description: string;
399
+ responses: {
400
+ 200: {
401
+ description: string;
402
+ content: {
403
+ "application/json": {
404
+ schema: {
405
+ type: "object";
406
+ properties: {
407
+ success: {
408
+ type: string;
409
+ };
410
+ };
411
+ };
412
+ };
413
+ };
414
+ };
415
+ };
416
+ };
417
+ };
418
+ }, {
419
+ success: boolean;
420
+ }>;
421
+ verifyEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/verify-email", {
422
+ method: "POST";
423
+ body: ZodObject<{
424
+ email: ZodString;
425
+ otp: ZodString;
426
+ }, $strip>;
427
+ metadata: {
428
+ openapi: {
429
+ description: string;
430
+ responses: {
431
+ 200: {
432
+ description: string;
433
+ content: {
434
+ "application/json": {
435
+ schema: {
436
+ type: "object";
437
+ properties: {
438
+ status: {
439
+ type: string;
440
+ description: string;
441
+ enum: boolean[];
442
+ };
443
+ token: {
444
+ type: string;
445
+ nullable: boolean;
446
+ description: string;
447
+ };
448
+ user: {
449
+ $ref: string;
450
+ };
451
+ };
452
+ required: string[];
453
+ };
454
+ };
455
+ };
456
+ };
457
+ };
458
+ };
459
+ };
460
+ }, {
461
+ status: boolean;
462
+ token: string;
463
+ user: {
464
+ id: string;
465
+ createdAt: Date;
466
+ updatedAt: Date;
467
+ email: string;
468
+ emailVerified: boolean;
469
+ name: string;
470
+ image?: string | null | undefined;
471
+ } & Record<string, any>;
472
+ } | {
473
+ status: boolean;
474
+ token: null;
475
+ user: {
476
+ id: string;
477
+ createdAt: Date;
478
+ updatedAt: Date;
479
+ email: string;
480
+ emailVerified: boolean;
481
+ name: string;
482
+ image?: string | null | undefined;
483
+ } & Record<string, any>;
484
+ }>;
485
+ signInEmailOTP: import("better-auth").StrictEndpoint<"/sign-in/email-otp", {
486
+ method: "POST";
487
+ body: ZodIntersection<ZodObject<{
488
+ email: ZodString;
489
+ otp: ZodString;
490
+ name: ZodOptional<ZodString>;
491
+ image: ZodOptional<ZodString>;
492
+ }, $strip>, ZodRecord<ZodString, ZodAny>>;
493
+ metadata: {
494
+ openapi: {
495
+ operationId: string;
496
+ description: string;
497
+ responses: {
498
+ 200: {
499
+ description: string;
500
+ content: {
501
+ "application/json": {
502
+ schema: {
503
+ type: "object";
504
+ properties: {
505
+ token: {
506
+ type: string;
507
+ description: string;
508
+ };
509
+ user: {
510
+ $ref: string;
511
+ };
512
+ };
513
+ required: string[];
514
+ };
515
+ };
516
+ };
517
+ };
518
+ };
519
+ };
520
+ };
521
+ }, {
522
+ token: string;
523
+ user: {
524
+ id: string;
525
+ createdAt: Date;
526
+ updatedAt: Date;
527
+ email: string;
528
+ emailVerified: boolean;
529
+ name: string;
530
+ image?: string | null | undefined;
531
+ };
532
+ }>;
533
+ requestPasswordResetEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/request-password-reset", {
534
+ method: "POST";
535
+ body: ZodObject<{
536
+ email: ZodString;
537
+ }, $strip>;
538
+ metadata: {
539
+ openapi: {
540
+ operationId: string;
541
+ description: string;
542
+ responses: {
543
+ 200: {
544
+ description: string;
545
+ content: {
546
+ "application/json": {
547
+ schema: {
548
+ type: "object";
549
+ properties: {
550
+ success: {
551
+ type: string;
552
+ description: string;
553
+ };
554
+ };
555
+ };
556
+ };
557
+ };
558
+ };
559
+ };
560
+ };
561
+ };
562
+ }, {
563
+ success: boolean;
564
+ }>;
565
+ forgetPasswordEmailOTP: import("better-auth").StrictEndpoint<"/forget-password/email-otp", {
566
+ method: "POST";
567
+ body: ZodObject<{
568
+ email: ZodString;
569
+ }, $strip>;
570
+ metadata: {
571
+ openapi: {
572
+ operationId: string;
573
+ description: string;
574
+ responses: {
575
+ 200: {
576
+ description: string;
577
+ content: {
578
+ "application/json": {
579
+ schema: {
580
+ type: "object";
581
+ properties: {
582
+ success: {
583
+ type: string;
584
+ description: string;
585
+ };
586
+ };
587
+ };
588
+ };
589
+ };
590
+ };
591
+ };
592
+ };
593
+ };
594
+ }, {
595
+ success: boolean;
596
+ }>;
597
+ resetPasswordEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/reset-password", {
598
+ method: "POST";
599
+ body: ZodObject<{
600
+ email: ZodString;
601
+ otp: ZodString;
602
+ password: ZodString;
603
+ }, $strip>;
604
+ metadata: {
605
+ openapi: {
606
+ operationId: string;
607
+ description: string;
608
+ responses: {
609
+ 200: {
610
+ description: string;
611
+ content: {
612
+ "application/json": {
613
+ schema: {
614
+ type: "object";
615
+ properties: {
616
+ success: {
617
+ type: string;
618
+ };
619
+ };
620
+ };
621
+ };
622
+ };
623
+ };
624
+ };
625
+ };
626
+ };
627
+ }, {
628
+ success: boolean;
629
+ }>;
630
+ requestEmailChangeEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/request-email-change", {
631
+ method: "POST";
632
+ body: ZodObject<{
633
+ newEmail: ZodString;
634
+ otp: ZodOptional<ZodString>;
635
+ }, $strip>;
636
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
637
+ session: {
638
+ session: Record<string, any> & {
639
+ id: string;
640
+ createdAt: Date;
641
+ updatedAt: Date;
642
+ userId: string;
643
+ expiresAt: Date;
644
+ token: string;
645
+ ipAddress?: string | null | undefined;
646
+ userAgent?: string | null | undefined;
647
+ };
648
+ user: Record<string, any> & {
649
+ id: string;
650
+ createdAt: Date;
651
+ updatedAt: Date;
652
+ email: string;
653
+ emailVerified: boolean;
654
+ name: string;
655
+ image?: string | null | undefined;
656
+ };
657
+ };
658
+ }>>[];
659
+ metadata: {
660
+ openapi: {
661
+ operationId: string;
662
+ description: string;
663
+ responses: {
664
+ 200: {
665
+ description: string;
666
+ content: {
667
+ "application/json": {
668
+ schema: {
669
+ type: "object";
670
+ properties: {
671
+ success: {
672
+ type: string;
673
+ };
674
+ };
675
+ };
676
+ };
677
+ };
678
+ };
679
+ };
680
+ };
681
+ };
682
+ }, {
683
+ success: boolean;
684
+ }>;
685
+ changeEmailEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/change-email", {
686
+ method: "POST";
687
+ body: ZodObject<{
688
+ newEmail: ZodString;
689
+ otp: ZodString;
690
+ }, $strip>;
691
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
692
+ session: {
693
+ session: Record<string, any> & {
694
+ id: string;
695
+ createdAt: Date;
696
+ updatedAt: Date;
697
+ userId: string;
698
+ expiresAt: Date;
699
+ token: string;
700
+ ipAddress?: string | null | undefined;
701
+ userAgent?: string | null | undefined;
702
+ };
703
+ user: Record<string, any> & {
704
+ id: string;
705
+ createdAt: Date;
706
+ updatedAt: Date;
707
+ email: string;
708
+ emailVerified: boolean;
709
+ name: string;
710
+ image?: string | null | undefined;
711
+ };
712
+ };
713
+ }>>[];
714
+ metadata: {
715
+ openapi: {
716
+ operationId: string;
717
+ description: string;
718
+ responses: {
719
+ 200: {
720
+ description: string;
721
+ content: {
722
+ "application/json": {
723
+ schema: {
724
+ type: "object";
725
+ properties: {
726
+ success: {
727
+ type: string;
728
+ };
729
+ };
730
+ };
731
+ };
732
+ };
733
+ };
734
+ };
735
+ };
736
+ };
737
+ }, {
738
+ success: boolean;
739
+ }>;
740
+ };
741
+ hooks: {
742
+ after: {
743
+ matcher(context: import("better-auth").HookEndpointContext): boolean;
744
+ handler: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>>;
745
+ }[];
746
+ };
747
+ rateLimit: ({
748
+ pathMatcher(path: string): path is "/email-otp/send-verification-otp";
749
+ window: number;
750
+ max: number;
751
+ } | {
752
+ pathMatcher(path: string): path is "/email-otp/check-verification-otp";
753
+ window: number;
754
+ max: number;
755
+ } | {
756
+ pathMatcher(path: string): path is "/email-otp/verify-email";
757
+ window: number;
758
+ max: number;
759
+ } | {
760
+ pathMatcher(path: string): path is "/sign-in/email-otp";
761
+ window: number;
762
+ max: number;
763
+ } | {
764
+ pathMatcher(path: string): path is "/email-otp/request-password-reset";
765
+ window: number;
766
+ max: number;
767
+ } | {
768
+ pathMatcher(path: string): path is "/email-otp/reset-password";
769
+ window: number;
770
+ max: number;
771
+ } | {
772
+ pathMatcher(path: string): path is "/forget-password/email-otp";
773
+ window: number;
774
+ max: number;
775
+ } | {
776
+ pathMatcher(path: string): path is "/email-otp/request-email-change";
777
+ window: number;
778
+ max: number;
779
+ } | {
780
+ pathMatcher(path: string): path is "/email-otp/change-email";
781
+ window: number;
782
+ max: number;
783
+ })[];
784
+ options: import("better-auth/plugins/email-otp").EmailOTPOptions;
785
+ $ERROR_CODES: {
786
+ OTP_EXPIRED: import("better-auth").RawError<"OTP_EXPIRED">;
787
+ INVALID_OTP: import("better-auth").RawError<"INVALID_OTP">;
788
+ TOO_MANY_ATTEMPTS: import("better-auth").RawError<"TOO_MANY_ATTEMPTS">;
789
+ };
790
+ }>;
791
+ atomListeners: {
792
+ matcher: (path: string) => path is "/email-otp/verify-email" | "/sign-in/email-otp" | "/email-otp/request-email-change";
793
+ signal: "$sessionSignal";
794
+ }[];
795
+ $ERROR_CODES: {
796
+ OTP_EXPIRED: import("better-auth").RawError<"OTP_EXPIRED">;
797
+ INVALID_OTP: import("better-auth").RawError<"INVALID_OTP">;
798
+ TOO_MANY_ATTEMPTS: import("better-auth").RawError<"TOO_MANY_ATTEMPTS">;
799
+ };
800
+ } | {
801
+ id: "two-factor";
802
+ version: string;
803
+ $InferServerPlugin: ReturnType<(<O extends import("better-auth/plugins/two-factor").TwoFactorOptions>(options?: O) => {
804
+ id: "two-factor";
805
+ version: string;
806
+ endpoints: {
807
+ enableTwoFactor: import("better-auth").StrictEndpoint<"/two-factor/enable", {
808
+ method: "POST";
809
+ body: ZodObject<{
810
+ password: ZodOptional<ZodString>;
811
+ method: ZodDefault<ZodEnum<{
812
+ otp: "otp";
813
+ totp: "totp";
814
+ }>>;
815
+ issuer: ZodOptional<ZodString>;
816
+ }, $strip> | ZodObject<{
817
+ password: ZodString;
818
+ method: ZodDefault<ZodEnum<{
819
+ otp: "otp";
820
+ totp: "totp";
821
+ }>>;
822
+ issuer: ZodOptional<ZodString>;
823
+ }, $strip>;
824
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
825
+ session: {
826
+ session: Record<string, any> & {
827
+ id: string;
828
+ createdAt: Date;
829
+ updatedAt: Date;
830
+ userId: string;
831
+ expiresAt: Date;
832
+ token: string;
833
+ ipAddress?: string | null | undefined;
834
+ userAgent?: string | null | undefined;
835
+ };
836
+ user: Record<string, any> & {
837
+ id: string;
838
+ createdAt: Date;
839
+ updatedAt: Date;
840
+ email: string;
841
+ emailVerified: boolean;
842
+ name: string;
843
+ image?: string | null | undefined;
844
+ };
845
+ };
846
+ }>>[];
847
+ metadata: {
848
+ openapi: {
849
+ summary: string;
850
+ description: string;
851
+ responses: {
852
+ 200: {
853
+ description: string;
854
+ content: {
855
+ "application/json": {
856
+ schema: {
857
+ type: "object";
858
+ properties: {
859
+ method: {
860
+ type: string;
861
+ enum: string[];
862
+ description: string;
863
+ };
864
+ totpURI: {
865
+ type: string;
866
+ description: string;
867
+ };
868
+ backupCodes: {
869
+ type: string;
870
+ items: {
871
+ type: string;
872
+ };
873
+ description: string;
874
+ };
875
+ };
876
+ required: string[];
877
+ };
878
+ };
879
+ };
880
+ };
881
+ };
882
+ };
883
+ };
884
+ }, {
885
+ method: "otp";
886
+ } | {
887
+ method: "totp";
888
+ totpURI: string;
889
+ backupCodes: string[];
890
+ }>;
891
+ disableTwoFactor: import("better-auth").StrictEndpoint<"/two-factor/disable", {
892
+ method: "POST";
893
+ body: ZodObject<{
894
+ password: ZodOptional<ZodString>;
895
+ }, $strip> | ZodObject<{
896
+ password: ZodString;
897
+ }, $strip>;
898
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
899
+ session: {
900
+ session: Record<string, any> & {
901
+ id: string;
902
+ createdAt: Date;
903
+ updatedAt: Date;
904
+ userId: string;
905
+ expiresAt: Date;
906
+ token: string;
907
+ ipAddress?: string | null | undefined;
908
+ userAgent?: string | null | undefined;
909
+ };
910
+ user: Record<string, any> & {
911
+ id: string;
912
+ createdAt: Date;
913
+ updatedAt: Date;
914
+ email: string;
915
+ emailVerified: boolean;
916
+ name: string;
917
+ image?: string | null | undefined;
918
+ };
919
+ };
920
+ }>>[];
921
+ metadata: {
922
+ openapi: {
923
+ summary: string;
924
+ description: string;
925
+ responses: {
926
+ 200: {
927
+ description: string;
928
+ content: {
929
+ "application/json": {
930
+ schema: {
931
+ type: "object";
932
+ properties: {
933
+ status: {
934
+ type: string;
935
+ };
936
+ };
937
+ };
938
+ };
939
+ };
940
+ };
941
+ };
942
+ };
943
+ };
944
+ }, {
945
+ status: boolean;
946
+ }>;
947
+ verifyBackupCode: import("better-auth").StrictEndpoint<"/two-factor/verify-backup-code", {
948
+ method: "POST";
949
+ body: ZodObject<{
950
+ code: ZodString;
951
+ disableSession: ZodOptional<ZodBoolean>;
952
+ trustDevice: ZodOptional<ZodBoolean>;
953
+ }, $strip>;
954
+ metadata: {
955
+ openapi: {
956
+ description: string;
957
+ responses: {
958
+ "200": {
959
+ description: string;
960
+ content: {
961
+ "application/json": {
962
+ schema: {
963
+ type: "object";
964
+ properties: {
965
+ user: {
966
+ type: string;
967
+ properties: {
968
+ id: {
969
+ type: string;
970
+ description: string;
971
+ };
972
+ email: {
973
+ type: string;
974
+ format: string;
975
+ nullable: boolean;
976
+ description: string;
977
+ };
978
+ emailVerified: {
979
+ type: string;
980
+ nullable: boolean;
981
+ description: string;
982
+ };
983
+ name: {
984
+ type: string;
985
+ nullable: boolean;
986
+ description: string;
987
+ };
988
+ image: {
989
+ type: string;
990
+ format: string;
991
+ nullable: boolean;
992
+ description: string;
993
+ };
994
+ twoFactorEnabled: {
995
+ type: string;
996
+ description: string;
997
+ };
998
+ createdAt: {
999
+ type: string;
1000
+ format: string;
1001
+ description: string;
1002
+ };
1003
+ updatedAt: {
1004
+ type: string;
1005
+ format: string;
1006
+ description: string;
1007
+ };
1008
+ };
1009
+ required: string[];
1010
+ description: string;
1011
+ };
1012
+ session: {
1013
+ type: string;
1014
+ properties: {
1015
+ token: {
1016
+ type: string;
1017
+ description: string;
1018
+ };
1019
+ userId: {
1020
+ type: string;
1021
+ description: string;
1022
+ };
1023
+ createdAt: {
1024
+ type: string;
1025
+ format: string;
1026
+ description: string;
1027
+ };
1028
+ expiresAt: {
1029
+ type: string;
1030
+ format: string;
1031
+ description: string;
1032
+ };
1033
+ };
1034
+ required: string[];
1035
+ description: string;
1036
+ };
1037
+ };
1038
+ required: string[];
1039
+ };
1040
+ };
1041
+ };
1042
+ };
1043
+ };
1044
+ };
1045
+ };
1046
+ }, {
1047
+ token: string | undefined;
1048
+ user: (Record<string, any> & {
1049
+ id: string;
1050
+ createdAt: Date;
1051
+ updatedAt: Date;
1052
+ email: string;
1053
+ emailVerified: boolean;
1054
+ name: string;
1055
+ image?: string | null | undefined;
1056
+ }) | import("better-auth/plugins/two-factor").UserWithTwoFactor;
1057
+ }>;
1058
+ generateBackupCodes: import("better-auth").StrictEndpoint<"/two-factor/generate-backup-codes", {
1059
+ method: "POST";
1060
+ body: ZodObject<{
1061
+ password: ZodOptional<ZodString>;
1062
+ }, $strip> | ZodObject<{
1063
+ password: ZodString;
1064
+ }, $strip>;
1065
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1066
+ session: {
1067
+ session: Record<string, any> & {
1068
+ id: string;
1069
+ createdAt: Date;
1070
+ updatedAt: Date;
1071
+ userId: string;
1072
+ expiresAt: Date;
1073
+ token: string;
1074
+ ipAddress?: string | null | undefined;
1075
+ userAgent?: string | null | undefined;
1076
+ };
1077
+ user: Record<string, any> & {
1078
+ id: string;
1079
+ createdAt: Date;
1080
+ updatedAt: Date;
1081
+ email: string;
1082
+ emailVerified: boolean;
1083
+ name: string;
1084
+ image?: string | null | undefined;
1085
+ };
1086
+ };
1087
+ }>>[];
1088
+ metadata: {
1089
+ openapi: {
1090
+ description: string;
1091
+ responses: {
1092
+ "200": {
1093
+ description: string;
1094
+ content: {
1095
+ "application/json": {
1096
+ schema: {
1097
+ type: "object";
1098
+ properties: {
1099
+ status: {
1100
+ type: string;
1101
+ description: string;
1102
+ enum: boolean[];
1103
+ };
1104
+ backupCodes: {
1105
+ type: string;
1106
+ items: {
1107
+ type: string;
1108
+ };
1109
+ description: string;
1110
+ };
1111
+ };
1112
+ required: string[];
1113
+ };
1114
+ };
1115
+ };
1116
+ };
1117
+ };
1118
+ };
1119
+ };
1120
+ }, {
1121
+ status: boolean;
1122
+ backupCodes: string[];
1123
+ }>;
1124
+ viewBackupCodes: import("better-auth").StrictEndpoint<string, {
1125
+ method: "POST";
1126
+ body: ZodObject<{
1127
+ userId: ZodCoercedString<unknown>;
1128
+ }, $strip>;
1129
+ }, {
1130
+ status: boolean;
1131
+ backupCodes: string[];
1132
+ }>;
1133
+ sendTwoFactorOTP: import("better-auth").StrictEndpoint<"/two-factor/send-otp", {
1134
+ method: "POST";
1135
+ body: ZodOptional<ZodObject<{
1136
+ trustDevice: ZodOptional<ZodBoolean>;
1137
+ }, $strip>>;
1138
+ metadata: {
1139
+ openapi: {
1140
+ summary: string;
1141
+ description: string;
1142
+ responses: {
1143
+ 200: {
1144
+ description: string;
1145
+ content: {
1146
+ "application/json": {
1147
+ schema: {
1148
+ type: "object";
1149
+ properties: {
1150
+ status: {
1151
+ type: string;
1152
+ };
1153
+ };
1154
+ };
1155
+ };
1156
+ };
1157
+ };
1158
+ };
1159
+ };
1160
+ };
1161
+ }, {
1162
+ status: boolean;
1163
+ }>;
1164
+ verifyTwoFactorOTP: import("better-auth").StrictEndpoint<"/two-factor/verify-otp", {
1165
+ method: "POST";
1166
+ body: ZodObject<{
1167
+ code: ZodString;
1168
+ trustDevice: ZodOptional<ZodBoolean>;
1169
+ }, $strip>;
1170
+ metadata: {
1171
+ openapi: {
1172
+ summary: string;
1173
+ description: string;
1174
+ responses: {
1175
+ "200": {
1176
+ description: string;
1177
+ content: {
1178
+ "application/json": {
1179
+ schema: {
1180
+ type: "object";
1181
+ properties: {
1182
+ token: {
1183
+ type: string;
1184
+ description: string;
1185
+ };
1186
+ user: {
1187
+ type: string;
1188
+ properties: {
1189
+ id: {
1190
+ type: string;
1191
+ description: string;
1192
+ };
1193
+ email: {
1194
+ type: string;
1195
+ format: string;
1196
+ nullable: boolean;
1197
+ description: string;
1198
+ };
1199
+ emailVerified: {
1200
+ type: string;
1201
+ nullable: boolean;
1202
+ description: string;
1203
+ };
1204
+ name: {
1205
+ type: string;
1206
+ nullable: boolean;
1207
+ description: string;
1208
+ };
1209
+ image: {
1210
+ type: string;
1211
+ format: string;
1212
+ nullable: boolean;
1213
+ description: string;
1214
+ };
1215
+ createdAt: {
1216
+ type: string;
1217
+ format: string;
1218
+ description: string;
1219
+ };
1220
+ updatedAt: {
1221
+ type: string;
1222
+ format: string;
1223
+ description: string;
1224
+ };
1225
+ };
1226
+ required: string[];
1227
+ description: string;
1228
+ };
1229
+ };
1230
+ required: string[];
1231
+ };
1232
+ };
1233
+ };
1234
+ };
1235
+ };
1236
+ };
1237
+ };
1238
+ }, {
1239
+ token: string;
1240
+ user: import("better-auth/plugins/two-factor").UserWithTwoFactor;
1241
+ } | {
1242
+ token: string;
1243
+ user: Record<string, any> & {
1244
+ id: string;
1245
+ createdAt: Date;
1246
+ updatedAt: Date;
1247
+ email: string;
1248
+ emailVerified: boolean;
1249
+ name: string;
1250
+ image?: string | null | undefined;
1251
+ };
1252
+ }>;
1253
+ generateTOTP: import("better-auth").StrictEndpoint<string, {
1254
+ method: "POST";
1255
+ body: ZodObject<{
1256
+ secret: ZodString;
1257
+ }, $strip>;
1258
+ metadata: {
1259
+ openapi: {
1260
+ summary: string;
1261
+ description: string;
1262
+ responses: {
1263
+ 200: {
1264
+ description: string;
1265
+ content: {
1266
+ "application/json": {
1267
+ schema: {
1268
+ type: "object";
1269
+ properties: {
1270
+ code: {
1271
+ type: string;
1272
+ };
1273
+ };
1274
+ };
1275
+ };
1276
+ };
1277
+ };
1278
+ };
1279
+ };
1280
+ };
1281
+ }, {
1282
+ code: string;
1283
+ }>;
1284
+ getTOTPURI: import("better-auth").StrictEndpoint<"/two-factor/get-totp-uri", {
1285
+ method: "POST";
1286
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1287
+ session: {
1288
+ session: Record<string, any> & {
1289
+ id: string;
1290
+ createdAt: Date;
1291
+ updatedAt: Date;
1292
+ userId: string;
1293
+ expiresAt: Date;
1294
+ token: string;
1295
+ ipAddress?: string | null | undefined;
1296
+ userAgent?: string | null | undefined;
1297
+ };
1298
+ user: Record<string, any> & {
1299
+ id: string;
1300
+ createdAt: Date;
1301
+ updatedAt: Date;
1302
+ email: string;
1303
+ emailVerified: boolean;
1304
+ name: string;
1305
+ image?: string | null | undefined;
1306
+ };
1307
+ };
1308
+ }>>[];
1309
+ body: ZodObject<{
1310
+ password: ZodOptional<ZodString>;
1311
+ }, $strip> | ZodObject<{
1312
+ password: ZodString;
1313
+ }, $strip>;
1314
+ metadata: {
1315
+ openapi: {
1316
+ summary: string;
1317
+ description: string;
1318
+ responses: {
1319
+ 200: {
1320
+ description: string;
1321
+ content: {
1322
+ "application/json": {
1323
+ schema: {
1324
+ type: "object";
1325
+ properties: {
1326
+ totpURI: {
1327
+ type: string;
1328
+ };
1329
+ };
1330
+ };
1331
+ };
1332
+ };
1333
+ };
1334
+ };
1335
+ };
1336
+ };
1337
+ }, {
1338
+ totpURI: string;
1339
+ }>;
1340
+ verifyTOTP: import("better-auth").StrictEndpoint<"/two-factor/verify-totp", {
1341
+ method: "POST";
1342
+ body: ZodObject<{
1343
+ code: ZodString;
1344
+ trustDevice: ZodOptional<ZodBoolean>;
1345
+ }, $strip>;
1346
+ metadata: {
1347
+ openapi: {
1348
+ summary: string;
1349
+ description: string;
1350
+ responses: {
1351
+ 200: {
1352
+ description: string;
1353
+ content: {
1354
+ "application/json": {
1355
+ schema: {
1356
+ type: "object";
1357
+ properties: {
1358
+ status: {
1359
+ type: string;
1360
+ };
1361
+ };
1362
+ };
1363
+ };
1364
+ };
1365
+ };
1366
+ };
1367
+ };
1368
+ };
1369
+ }, {
1370
+ token: string;
1371
+ user: import("better-auth/plugins/two-factor").UserWithTwoFactor;
1372
+ } | {
1373
+ token: string;
1374
+ user: Record<string, any> & {
1375
+ id: string;
1376
+ createdAt: Date;
1377
+ updatedAt: Date;
1378
+ email: string;
1379
+ emailVerified: boolean;
1380
+ name: string;
1381
+ image?: string | null | undefined;
1382
+ };
1383
+ }>;
1384
+ };
1385
+ options: NoInfer<O>;
1386
+ hooks: {
1387
+ after: {
1388
+ matcher(context: import("better-auth").HookEndpointContext): boolean;
1389
+ handler: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1390
+ twoFactorRedirect: boolean;
1391
+ twoFactorMethods: string[];
1392
+ } | undefined>>;
1393
+ }[];
1394
+ };
1395
+ schema: {
1396
+ user: {
1397
+ fields: {
1398
+ twoFactorEnabled: {
1399
+ type: "boolean";
1400
+ required: false;
1401
+ defaultValue: false;
1402
+ input: false;
1403
+ };
1404
+ };
1405
+ };
1406
+ twoFactor: {
1407
+ fields: {
1408
+ secret: {
1409
+ type: "string";
1410
+ required: true;
1411
+ returned: false;
1412
+ index: true;
1413
+ };
1414
+ backupCodes: {
1415
+ type: "string";
1416
+ required: true;
1417
+ returned: false;
1418
+ };
1419
+ userId: {
1420
+ type: "string";
1421
+ required: true;
1422
+ returned: false;
1423
+ references: {
1424
+ model: string;
1425
+ field: string;
1426
+ };
1427
+ index: true;
1428
+ };
1429
+ verified: {
1430
+ type: "boolean";
1431
+ required: false;
1432
+ defaultValue: true;
1433
+ input: false;
1434
+ };
1435
+ failedVerificationCount: {
1436
+ type: "number";
1437
+ required: false;
1438
+ defaultValue: number;
1439
+ input: false;
1440
+ returned: false;
1441
+ };
1442
+ lockedUntil: {
1443
+ type: "date";
1444
+ required: false;
1445
+ input: false;
1446
+ returned: false;
1447
+ };
1448
+ };
1449
+ };
1450
+ };
1451
+ rateLimit: {
1452
+ pathMatcher(path: string): boolean;
1453
+ window: number;
1454
+ max: number;
1455
+ }[];
1456
+ $ERROR_CODES: {
1457
+ OTP_NOT_ENABLED: import("better-auth").RawError<"OTP_NOT_ENABLED">;
1458
+ OTP_NOT_CONFIGURED: import("better-auth").RawError<"OTP_NOT_CONFIGURED">;
1459
+ OTP_HAS_EXPIRED: import("better-auth").RawError<"OTP_HAS_EXPIRED">;
1460
+ TOTP_NOT_ENABLED: import("better-auth").RawError<"TOTP_NOT_ENABLED">;
1461
+ TOTP_ALREADY_ENABLED: import("better-auth").RawError<"TOTP_ALREADY_ENABLED">;
1462
+ TOTP_NOT_CONFIGURED: import("better-auth").RawError<"TOTP_NOT_CONFIGURED">;
1463
+ TWO_FACTOR_NOT_ENABLED: import("better-auth").RawError<"TWO_FACTOR_NOT_ENABLED">;
1464
+ BACKUP_CODES_NOT_ENABLED: import("better-auth").RawError<"BACKUP_CODES_NOT_ENABLED">;
1465
+ INVALID_BACKUP_CODE: import("better-auth").RawError<"INVALID_BACKUP_CODE">;
1466
+ INVALID_CODE: import("better-auth").RawError<"INVALID_CODE">;
1467
+ TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: import("better-auth").RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
1468
+ ACCOUNT_TEMPORARILY_LOCKED: import("better-auth").RawError<"ACCOUNT_TEMPORARILY_LOCKED">;
1469
+ INVALID_TWO_FACTOR_COOKIE: import("better-auth").RawError<"INVALID_TWO_FACTOR_COOKIE">;
1470
+ };
1471
+ })>;
1472
+ atomListeners: {
1473
+ matcher: (path: string) => boolean;
1474
+ signal: "$sessionSignal";
1475
+ }[];
1476
+ pathMethods: {
1477
+ "/two-factor/disable": "POST";
1478
+ "/two-factor/enable": "POST";
1479
+ "/two-factor/send-otp": "POST";
1480
+ "/two-factor/generate-backup-codes": "POST";
1481
+ "/two-factor/get-totp-uri": "POST";
1482
+ "/two-factor/verify-totp": "POST";
1483
+ "/two-factor/verify-otp": "POST";
1484
+ "/two-factor/verify-backup-code": "POST";
1485
+ };
1486
+ fetchPlugins: {
1487
+ id: string;
1488
+ name: string;
1489
+ hooks: {
1490
+ onSuccess(context: import("better-auth/client").SuccessContext<any>): Promise<void>;
1491
+ };
1492
+ }[];
1493
+ $ERROR_CODES: {
1494
+ OTP_NOT_ENABLED: import("better-auth").RawError<"OTP_NOT_ENABLED">;
1495
+ OTP_NOT_CONFIGURED: import("better-auth").RawError<"OTP_NOT_CONFIGURED">;
1496
+ OTP_HAS_EXPIRED: import("better-auth").RawError<"OTP_HAS_EXPIRED">;
1497
+ TOTP_NOT_ENABLED: import("better-auth").RawError<"TOTP_NOT_ENABLED">;
1498
+ TOTP_ALREADY_ENABLED: import("better-auth").RawError<"TOTP_ALREADY_ENABLED">;
1499
+ TOTP_NOT_CONFIGURED: import("better-auth").RawError<"TOTP_NOT_CONFIGURED">;
1500
+ TWO_FACTOR_NOT_ENABLED: import("better-auth").RawError<"TWO_FACTOR_NOT_ENABLED">;
1501
+ BACKUP_CODES_NOT_ENABLED: import("better-auth").RawError<"BACKUP_CODES_NOT_ENABLED">;
1502
+ INVALID_BACKUP_CODE: import("better-auth").RawError<"INVALID_BACKUP_CODE">;
1503
+ INVALID_CODE: import("better-auth").RawError<"INVALID_CODE">;
1504
+ TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: import("better-auth").RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
1505
+ ACCOUNT_TEMPORARILY_LOCKED: import("better-auth").RawError<"ACCOUNT_TEMPORARILY_LOCKED">;
1506
+ INVALID_TWO_FACTOR_COOKIE: import("better-auth").RawError<"INVALID_TWO_FACTOR_COOKIE">;
1507
+ };
1508
+ } | {
1509
+ id: "passkey";
1510
+ version: string;
1511
+ $InferServerPlugin: ReturnType<(options?: import("@better-auth/passkey/client").PasskeyOptions | undefined) => {
1512
+ id: "passkey";
1513
+ version: string;
1514
+ endpoints: {
1515
+ generatePasskeyRegistrationOptions: import("better-auth").StrictEndpoint<"/passkey/generate-register-options", {
1516
+ method: "GET";
1517
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1518
+ session: {
1519
+ session: Record<string, any> & {
1520
+ id: string;
1521
+ createdAt: Date;
1522
+ updatedAt: Date;
1523
+ userId: string;
1524
+ expiresAt: Date;
1525
+ token: string;
1526
+ ipAddress?: string | null | undefined;
1527
+ userAgent?: string | null | undefined;
1528
+ };
1529
+ user: Record<string, any> & {
1530
+ id: string;
1531
+ createdAt: Date;
1532
+ updatedAt: Date;
1533
+ email: string;
1534
+ emailVerified: boolean;
1535
+ name: string;
1536
+ image?: string | null | undefined;
1537
+ };
1538
+ };
1539
+ }>>[];
1540
+ query: ZodOptional<ZodObject<{
1541
+ authenticatorAttachment: ZodOptional<ZodEnum<{
1542
+ platform: "platform";
1543
+ "cross-platform": "cross-platform";
1544
+ }>>;
1545
+ name: ZodOptional<ZodString>;
1546
+ context: ZodOptional<ZodString>;
1547
+ }, $strip>>;
1548
+ metadata: {
1549
+ openapi: {
1550
+ operationId: string;
1551
+ description: string;
1552
+ parameters: import("better-auth").OpenAPIParameter[];
1553
+ responses: {
1554
+ 200: {
1555
+ description: string;
1556
+ content: {
1557
+ "application/json": {
1558
+ schema: {
1559
+ type: "object";
1560
+ properties: {
1561
+ challenge: {
1562
+ type: string;
1563
+ };
1564
+ rp: {
1565
+ type: string;
1566
+ properties: {
1567
+ name: {
1568
+ type: string;
1569
+ };
1570
+ id: {
1571
+ type: string;
1572
+ };
1573
+ };
1574
+ };
1575
+ user: {
1576
+ type: string;
1577
+ properties: {
1578
+ id: {
1579
+ type: string;
1580
+ };
1581
+ name: {
1582
+ type: string;
1583
+ };
1584
+ displayName: {
1585
+ type: string;
1586
+ };
1587
+ };
1588
+ };
1589
+ pubKeyCredParams: {
1590
+ type: string;
1591
+ items: {
1592
+ type: string;
1593
+ properties: {
1594
+ type: {
1595
+ type: string;
1596
+ };
1597
+ alg: {
1598
+ type: string;
1599
+ };
1600
+ };
1601
+ };
1602
+ };
1603
+ timeout: {
1604
+ type: string;
1605
+ };
1606
+ excludeCredentials: {
1607
+ type: string;
1608
+ items: {
1609
+ type: string;
1610
+ properties: {
1611
+ id: {
1612
+ type: string;
1613
+ };
1614
+ type: {
1615
+ type: string;
1616
+ };
1617
+ transports: {
1618
+ type: string;
1619
+ items: {
1620
+ type: string;
1621
+ };
1622
+ };
1623
+ };
1624
+ };
1625
+ };
1626
+ authenticatorSelection: {
1627
+ type: string;
1628
+ properties: {
1629
+ authenticatorAttachment: {
1630
+ type: string;
1631
+ };
1632
+ requireResidentKey: {
1633
+ type: string;
1634
+ };
1635
+ userVerification: {
1636
+ type: string;
1637
+ };
1638
+ };
1639
+ };
1640
+ attestation: {
1641
+ type: string;
1642
+ };
1643
+ extensions: {
1644
+ type: string;
1645
+ };
1646
+ };
1647
+ };
1648
+ };
1649
+ };
1650
+ };
1651
+ };
1652
+ };
1653
+ };
1654
+ }, import("@better-auth/passkey/client").PublicKeyCredentialCreationOptionsJSON>;
1655
+ generatePasskeyAuthenticationOptions: import("better-auth").StrictEndpoint<"/passkey/generate-authenticate-options", {
1656
+ method: "GET";
1657
+ metadata: {
1658
+ openapi: {
1659
+ operationId: string;
1660
+ description: string;
1661
+ responses: {
1662
+ 200: {
1663
+ description: string;
1664
+ content: {
1665
+ "application/json": {
1666
+ schema: {
1667
+ type: "object";
1668
+ properties: {
1669
+ challenge: {
1670
+ type: string;
1671
+ };
1672
+ rp: {
1673
+ type: string;
1674
+ properties: {
1675
+ name: {
1676
+ type: string;
1677
+ };
1678
+ id: {
1679
+ type: string;
1680
+ };
1681
+ };
1682
+ };
1683
+ user: {
1684
+ type: string;
1685
+ properties: {
1686
+ id: {
1687
+ type: string;
1688
+ };
1689
+ name: {
1690
+ type: string;
1691
+ };
1692
+ displayName: {
1693
+ type: string;
1694
+ };
1695
+ };
1696
+ };
1697
+ timeout: {
1698
+ type: string;
1699
+ };
1700
+ allowCredentials: {
1701
+ type: string;
1702
+ items: {
1703
+ type: string;
1704
+ properties: {
1705
+ id: {
1706
+ type: string;
1707
+ };
1708
+ type: {
1709
+ type: string;
1710
+ };
1711
+ transports: {
1712
+ type: string;
1713
+ items: {
1714
+ type: string;
1715
+ };
1716
+ };
1717
+ };
1718
+ };
1719
+ };
1720
+ userVerification: {
1721
+ type: string;
1722
+ };
1723
+ authenticatorSelection: {
1724
+ type: string;
1725
+ properties: {
1726
+ authenticatorAttachment: {
1727
+ type: string;
1728
+ };
1729
+ requireResidentKey: {
1730
+ type: string;
1731
+ };
1732
+ userVerification: {
1733
+ type: string;
1734
+ };
1735
+ };
1736
+ };
1737
+ extensions: {
1738
+ type: string;
1739
+ };
1740
+ };
1741
+ };
1742
+ };
1743
+ };
1744
+ };
1745
+ };
1746
+ };
1747
+ };
1748
+ }, import("@better-auth/passkey/client").PublicKeyCredentialRequestOptionsJSON>;
1749
+ verifyPasskeyRegistration: import("better-auth").StrictEndpoint<"/passkey/verify-registration", {
1750
+ method: "POST";
1751
+ body: ZodObject<{
1752
+ response: ZodAny;
1753
+ name: ZodOptional<ZodString>;
1754
+ createSession: ZodOptional<ZodBoolean>;
1755
+ }, $strip>;
1756
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1757
+ session: {
1758
+ session: Record<string, any> & {
1759
+ id: string;
1760
+ createdAt: Date;
1761
+ updatedAt: Date;
1762
+ userId: string;
1763
+ expiresAt: Date;
1764
+ token: string;
1765
+ ipAddress?: string | null | undefined;
1766
+ userAgent?: string | null | undefined;
1767
+ };
1768
+ user: Record<string, any> & {
1769
+ id: string;
1770
+ createdAt: Date;
1771
+ updatedAt: Date;
1772
+ email: string;
1773
+ emailVerified: boolean;
1774
+ name: string;
1775
+ image?: string | null | undefined;
1776
+ };
1777
+ };
1778
+ }>>[];
1779
+ metadata: {
1780
+ openapi: {
1781
+ operationId: string;
1782
+ description: string;
1783
+ responses: {
1784
+ 200: {
1785
+ description: string;
1786
+ content: {
1787
+ "application/json": {
1788
+ schema: {
1789
+ readonly type: "object";
1790
+ readonly allOf: readonly [{
1791
+ readonly $ref: "#/components/schemas/Passkey";
1792
+ }, {
1793
+ readonly type: "object";
1794
+ readonly properties: {
1795
+ readonly session: {
1796
+ readonly $ref: "#/components/schemas/Session";
1797
+ };
1798
+ readonly user: {
1799
+ readonly $ref: "#/components/schemas/User";
1800
+ };
1801
+ };
1802
+ }];
1803
+ };
1804
+ };
1805
+ };
1806
+ };
1807
+ 400: {
1808
+ description: string;
1809
+ };
1810
+ };
1811
+ };
1812
+ };
1813
+ }, import("@better-auth/passkey/client").Passkey>;
1814
+ verifyPasskeyAuthentication: import("better-auth").StrictEndpoint<"/passkey/verify-authentication", {
1815
+ method: "POST";
1816
+ body: ZodObject<{
1817
+ response: ZodRecord<ZodAny, ZodAny>;
1818
+ }, $strip>;
1819
+ metadata: {
1820
+ openapi: {
1821
+ operationId: string;
1822
+ description: string;
1823
+ responses: {
1824
+ 200: {
1825
+ description: string;
1826
+ content: {
1827
+ "application/json": {
1828
+ schema: {
1829
+ type: "object";
1830
+ properties: {
1831
+ session: {
1832
+ $ref: string;
1833
+ };
1834
+ user: {
1835
+ $ref: string;
1836
+ };
1837
+ };
1838
+ };
1839
+ };
1840
+ };
1841
+ };
1842
+ };
1843
+ };
1844
+ $Infer: {
1845
+ body: {
1846
+ response: import("@better-auth/passkey/client").AuthenticationResponseJSON;
1847
+ };
1848
+ };
1849
+ };
1850
+ }, {
1851
+ session: {
1852
+ id: string;
1853
+ createdAt: Date;
1854
+ updatedAt: Date;
1855
+ userId: string;
1856
+ expiresAt: Date;
1857
+ token: string;
1858
+ ipAddress?: string | null | undefined;
1859
+ userAgent?: string | null | undefined;
1860
+ };
1861
+ user: {
1862
+ id: string;
1863
+ createdAt: Date;
1864
+ updatedAt: Date;
1865
+ email: string;
1866
+ emailVerified: boolean;
1867
+ name: string;
1868
+ image?: string | null | undefined;
1869
+ };
1870
+ }>;
1871
+ listPasskeys: import("better-auth").StrictEndpoint<"/passkey/list-user-passkeys", {
1872
+ method: "GET";
1873
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1874
+ session: {
1875
+ session: Record<string, any> & {
1876
+ id: string;
1877
+ createdAt: Date;
1878
+ updatedAt: Date;
1879
+ userId: string;
1880
+ expiresAt: Date;
1881
+ token: string;
1882
+ ipAddress?: string | null | undefined;
1883
+ userAgent?: string | null | undefined;
1884
+ };
1885
+ user: Record<string, any> & {
1886
+ id: string;
1887
+ createdAt: Date;
1888
+ updatedAt: Date;
1889
+ email: string;
1890
+ emailVerified: boolean;
1891
+ name: string;
1892
+ image?: string | null | undefined;
1893
+ };
1894
+ };
1895
+ }>>[];
1896
+ metadata: {
1897
+ openapi: {
1898
+ description: string;
1899
+ responses: {
1900
+ "200": {
1901
+ description: string;
1902
+ content: {
1903
+ "application/json": {
1904
+ schema: {
1905
+ type: "array";
1906
+ items: {
1907
+ $ref: string;
1908
+ required: string[];
1909
+ };
1910
+ description: string;
1911
+ };
1912
+ };
1913
+ };
1914
+ };
1915
+ };
1916
+ };
1917
+ };
1918
+ }, import("@better-auth/passkey/client").Passkey[]>;
1919
+ deletePasskey: import("better-auth").StrictEndpoint<"/passkey/delete-passkey", {
1920
+ method: "POST";
1921
+ body: ZodObject<{
1922
+ id: ZodString;
1923
+ }, $strip>;
1924
+ use: (import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1925
+ session: {
1926
+ session: Record<string, any> & {
1927
+ id: string;
1928
+ createdAt: Date;
1929
+ updatedAt: Date;
1930
+ userId: string;
1931
+ expiresAt: Date;
1932
+ token: string;
1933
+ ipAddress?: string | null | undefined;
1934
+ userAgent?: string | null | undefined;
1935
+ };
1936
+ user: Record<string, any> & {
1937
+ id: string;
1938
+ createdAt: Date;
1939
+ updatedAt: Date;
1940
+ email: string;
1941
+ emailVerified: boolean;
1942
+ name: string;
1943
+ image?: string | null | undefined;
1944
+ };
1945
+ };
1946
+ }>> | import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1947
+ verifiedResource: {};
1948
+ }>>)[];
1949
+ metadata: {
1950
+ openapi: {
1951
+ description: string;
1952
+ responses: {
1953
+ "200": {
1954
+ description: string;
1955
+ content: {
1956
+ "application/json": {
1957
+ schema: {
1958
+ type: "object";
1959
+ properties: {
1960
+ status: {
1961
+ type: string;
1962
+ description: string;
1963
+ };
1964
+ };
1965
+ required: string[];
1966
+ };
1967
+ };
1968
+ };
1969
+ };
1970
+ };
1971
+ };
1972
+ };
1973
+ }, {
1974
+ status: boolean;
1975
+ }>;
1976
+ updatePasskey: import("better-auth").StrictEndpoint<"/passkey/update-passkey", {
1977
+ method: "POST";
1978
+ body: ZodObject<{
1979
+ id: ZodString;
1980
+ name: ZodString;
1981
+ }, $strip>;
1982
+ use: (import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1983
+ session: {
1984
+ session: Record<string, any> & {
1985
+ id: string;
1986
+ createdAt: Date;
1987
+ updatedAt: Date;
1988
+ userId: string;
1989
+ expiresAt: Date;
1990
+ token: string;
1991
+ ipAddress?: string | null | undefined;
1992
+ userAgent?: string | null | undefined;
1993
+ };
1994
+ user: Record<string, any> & {
1995
+ id: string;
1996
+ createdAt: Date;
1997
+ updatedAt: Date;
1998
+ email: string;
1999
+ emailVerified: boolean;
2000
+ name: string;
2001
+ image?: string | null | undefined;
2002
+ };
2003
+ };
2004
+ }>> | import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2005
+ verifiedResource: {};
2006
+ }>>)[];
2007
+ metadata: {
2008
+ openapi: {
2009
+ description: string;
2010
+ responses: {
2011
+ "200": {
2012
+ description: string;
2013
+ content: {
2014
+ "application/json": {
2015
+ schema: {
2016
+ type: "object";
2017
+ properties: {
2018
+ passkey: {
2019
+ $ref: string;
2020
+ };
2021
+ };
2022
+ required: string[];
2023
+ };
2024
+ };
2025
+ };
2026
+ };
2027
+ };
2028
+ };
2029
+ };
2030
+ }, {
2031
+ passkey: import("@better-auth/passkey/client").Passkey;
2032
+ }>;
2033
+ };
2034
+ schema: {
2035
+ passkey: {
2036
+ fields: {
2037
+ name: {
2038
+ type: "string";
2039
+ required: false;
2040
+ };
2041
+ publicKey: {
2042
+ type: "string";
2043
+ required: true;
2044
+ };
2045
+ userId: {
2046
+ type: "string";
2047
+ references: {
2048
+ model: string;
2049
+ field: string;
2050
+ };
2051
+ required: true;
2052
+ index: true;
2053
+ };
2054
+ credentialID: {
2055
+ type: "string";
2056
+ required: true;
2057
+ index: true;
2058
+ };
2059
+ counter: {
2060
+ type: "number";
2061
+ required: true;
2062
+ };
2063
+ deviceType: {
2064
+ type: "string";
2065
+ required: true;
2066
+ };
2067
+ backedUp: {
2068
+ type: "boolean";
2069
+ required: true;
2070
+ };
2071
+ transports: {
2072
+ type: "string";
2073
+ required: false;
2074
+ };
2075
+ createdAt: {
2076
+ type: "date";
2077
+ required: false;
2078
+ };
2079
+ aaguid: {
2080
+ type: "string";
2081
+ required: false;
2082
+ };
2083
+ };
2084
+ };
2085
+ };
2086
+ $ERROR_CODES: {
2087
+ CHALLENGE_NOT_FOUND: import("better-auth").RawError<"CHALLENGE_NOT_FOUND">;
2088
+ YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
2089
+ FAILED_TO_VERIFY_REGISTRATION: import("better-auth").RawError<"FAILED_TO_VERIFY_REGISTRATION">;
2090
+ PASSKEY_NOT_FOUND: import("better-auth").RawError<"PASSKEY_NOT_FOUND">;
2091
+ AUTHENTICATION_FAILED: import("better-auth").RawError<"AUTHENTICATION_FAILED">;
2092
+ UNABLE_TO_CREATE_SESSION: import("better-auth").RawError<"UNABLE_TO_CREATE_SESSION">;
2093
+ USER_NOT_FOUND: import("better-auth").RawError<"USER_NOT_FOUND">;
2094
+ FAILED_TO_UPDATE_PASSKEY: import("better-auth").RawError<"FAILED_TO_UPDATE_PASSKEY">;
2095
+ PREVIOUSLY_REGISTERED: import("better-auth").RawError<"PREVIOUSLY_REGISTERED">;
2096
+ REGISTRATION_CANCELLED: import("better-auth").RawError<"REGISTRATION_CANCELLED">;
2097
+ AUTH_CANCELLED: import("better-auth").RawError<"AUTH_CANCELLED">;
2098
+ UNKNOWN_ERROR: import("better-auth").RawError<"UNKNOWN_ERROR">;
2099
+ SESSION_REQUIRED: import("better-auth").RawError<"SESSION_REQUIRED">;
2100
+ RESOLVE_USER_REQUIRED: import("better-auth").RawError<"RESOLVE_USER_REQUIRED">;
2101
+ RESOLVED_USER_INVALID: import("better-auth").RawError<"RESOLVED_USER_INVALID">;
2102
+ };
2103
+ options: import("@better-auth/passkey/client").PasskeyOptions | undefined;
2104
+ }>;
2105
+ getActions: ($fetch: import("better-auth/client").BetterFetch, $store: import("better-auth").ClientStore) => {
2106
+ signIn: {
2107
+ passkey: (opts?: {
2108
+ autoFill?: boolean;
2109
+ extensions?: import("@better-auth/passkey/client").AuthenticationExtensionsClientInputs;
2110
+ returnWebAuthnResponse?: boolean;
2111
+ fetchOptions?: import("better-auth").ClientFetchOption;
2112
+ } | undefined, options?: import("better-auth").ClientFetchOption | undefined) => Promise<{
2113
+ data: null;
2114
+ error: {
2115
+ message?: string | undefined;
2116
+ status: number;
2117
+ statusText: string;
2118
+ };
2119
+ } | {
2120
+ data: {
2121
+ session: import("better-auth").Session;
2122
+ user: import("better-auth").User;
2123
+ };
2124
+ error: null;
2125
+ } | {
2126
+ data: null;
2127
+ error: {
2128
+ code: string;
2129
+ message: string;
2130
+ status: number;
2131
+ statusText: string;
2132
+ };
2133
+ } | {
2134
+ webauthn: {
2135
+ response: import("@better-auth/passkey/client").AuthenticationResponseJSON;
2136
+ clientExtensionResults: import("@better-auth/passkey/client").AuthenticationExtensionsClientOutputs;
2137
+ };
2138
+ data: null;
2139
+ error: {
2140
+ message?: string | undefined;
2141
+ status: number;
2142
+ statusText: string;
2143
+ };
2144
+ } | {
2145
+ webauthn: {
2146
+ response: import("@better-auth/passkey/client").AuthenticationResponseJSON;
2147
+ clientExtensionResults: import("@better-auth/passkey/client").AuthenticationExtensionsClientOutputs;
2148
+ };
2149
+ data: {
2150
+ session: import("better-auth").Session;
2151
+ user: import("better-auth").User;
2152
+ };
2153
+ error: null;
2154
+ }>;
2155
+ };
2156
+ passkey: {
2157
+ addPasskey: (opts?: {
2158
+ fetchOptions?: import("better-auth").ClientFetchOption;
2159
+ name?: string;
2160
+ authenticatorAttachment?: "platform" | "cross-platform";
2161
+ context?: string | null;
2162
+ createSession?: boolean;
2163
+ extensions?: import("@better-auth/passkey/client").AuthenticationExtensionsClientInputs;
2164
+ useAutoRegister?: boolean;
2165
+ returnWebAuthnResponse?: boolean;
2166
+ } | undefined, fetchOpts?: import("better-auth").ClientFetchOption | undefined) => Promise<{
2167
+ data: null;
2168
+ error: {
2169
+ message?: string | undefined;
2170
+ status: number;
2171
+ statusText: string;
2172
+ };
2173
+ } | {
2174
+ data: import("@better-auth/passkey/client").Passkey & {
2175
+ session?: import("better-auth").Session;
2176
+ user?: import("better-auth").User;
2177
+ };
2178
+ error: null;
2179
+ } | {
2180
+ webauthn: {
2181
+ response: import("@better-auth/passkey/client").RegistrationResponseJSON;
2182
+ clientExtensionResults: import("@better-auth/passkey/client").AuthenticationExtensionsClientOutputs;
2183
+ };
2184
+ data: import("@better-auth/passkey/client").Passkey & {
2185
+ session?: import("better-auth").Session;
2186
+ user?: import("better-auth").User;
2187
+ };
2188
+ error: null;
2189
+ } | {
2190
+ data: null;
2191
+ error: {
2192
+ code: string;
2193
+ message: string;
2194
+ status: number;
2195
+ statusText: string;
2196
+ };
2197
+ }>;
2198
+ };
2199
+ $Infer: {
2200
+ Passkey: import("@better-auth/passkey/client").Passkey;
2201
+ };
2202
+ };
2203
+ getAtoms($fetch: import("better-auth/client").BetterFetch): {
2204
+ listPasskeys: import("better-auth/client").AuthQueryAtom<import("@better-auth/passkey/client").Passkey[]>;
2205
+ $listPasskeys: import("better-auth/client").PreinitializedWritableAtom<any> & object;
2206
+ };
2207
+ pathMethods: {
2208
+ "/passkey/register": "POST";
2209
+ "/passkey/authenticate": "POST";
2210
+ };
2211
+ atomListeners: ({
2212
+ matcher(path: string): path is "/passkey/delete-passkey" | "/passkey/update-passkey" | "/passkey/verify-registration" | "/sign-out";
2213
+ signal: "$listPasskeys";
2214
+ } | {
2215
+ matcher: (path: string) => path is "/passkey/verify-authentication";
2216
+ signal: "$sessionSignal";
2217
+ })[];
2218
+ $ERROR_CODES: {
2219
+ CHALLENGE_NOT_FOUND: import("better-auth").RawError<"CHALLENGE_NOT_FOUND">;
2220
+ YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
2221
+ FAILED_TO_VERIFY_REGISTRATION: import("better-auth").RawError<"FAILED_TO_VERIFY_REGISTRATION">;
2222
+ PASSKEY_NOT_FOUND: import("better-auth").RawError<"PASSKEY_NOT_FOUND">;
2223
+ AUTHENTICATION_FAILED: import("better-auth").RawError<"AUTHENTICATION_FAILED">;
2224
+ UNABLE_TO_CREATE_SESSION: import("better-auth").RawError<"UNABLE_TO_CREATE_SESSION">;
2225
+ USER_NOT_FOUND: import("better-auth").RawError<"USER_NOT_FOUND">;
2226
+ FAILED_TO_UPDATE_PASSKEY: import("better-auth").RawError<"FAILED_TO_UPDATE_PASSKEY">;
2227
+ PREVIOUSLY_REGISTERED: import("better-auth").RawError<"PREVIOUSLY_REGISTERED">;
2228
+ REGISTRATION_CANCELLED: import("better-auth").RawError<"REGISTRATION_CANCELLED">;
2229
+ AUTH_CANCELLED: import("better-auth").RawError<"AUTH_CANCELLED">;
2230
+ UNKNOWN_ERROR: import("better-auth").RawError<"UNKNOWN_ERROR">;
2231
+ SESSION_REQUIRED: import("better-auth").RawError<"SESSION_REQUIRED">;
2232
+ RESOLVE_USER_REQUIRED: import("better-auth").RawError<"RESOLVE_USER_REQUIRED">;
2233
+ RESOLVED_USER_INVALID: import("better-auth").RawError<"RESOLVED_USER_INVALID">;
2234
+ };
2235
+ })[];
2236
+ fetchOptions: {
2237
+ customFetchImpl: typeof globalThis.fetch;
2238
+ };
2239
+ }>;
2240
+ export type BetterAuthClient = ReturnType<typeof betterAuthClient>;
2241
+ //#endregion