@delmaredigital/payload-better-auth 0.6.9 → 0.7.0

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.
@@ -7,12 +7,18 @@
7
7
  * because webpack resolves all static imports at build time, breaking consumers
8
8
  * who don't have those packages installed.
9
9
  */
10
+ import { createAuthClient } from 'better-auth/react';
11
+ import type { BetterAuthClientPlugin } from 'better-auth/client';
10
12
  export { createAuthClient } from 'better-auth/react';
11
13
  export { twoFactorClient } from 'better-auth/client/plugins';
12
14
  /**
13
15
  * Default plugins included with Payload Better Auth (core only).
14
16
  * Add optional plugins (passkeyClient, apiKeyClient) from their own packages.
15
17
  *
18
+ * Typed as `BetterAuthClientPlugin[]` so consumers' `.d.ts` files don't need
19
+ * to name Better Auth's zod-backed inferred plugin types (not portable across
20
+ * installs).
21
+ *
16
22
  * @example
17
23
  * ```typescript
18
24
  * import { createAuthClient, payloadAuthPlugins } from '@delmaredigital/payload-better-auth/client'
@@ -24,663 +30,12 @@ export { twoFactorClient } from 'better-auth/client/plugins';
24
30
  * })
25
31
  * ```
26
32
  */
27
- export declare const payloadAuthPlugins: readonly [{
28
- id: "two-factor";
29
- $InferServerPlugin: ReturnType<(<O extends import("better-auth/plugins").TwoFactorOptions>(options?: O) => {
30
- id: "two-factor";
31
- endpoints: {
32
- enableTwoFactor: import("better-auth").StrictEndpoint<"/two-factor/enable", {
33
- method: "POST";
34
- body: import("better-auth").ZodObject<{
35
- password: import("better-auth").ZodString;
36
- issuer: import("better-auth").ZodOptional<import("better-auth").ZodString>;
37
- }, import("better-auth").$strip>;
38
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
39
- session: {
40
- session: Record<string, any> & {
41
- id: string;
42
- createdAt: Date;
43
- updatedAt: Date;
44
- userId: string;
45
- expiresAt: Date;
46
- token: string;
47
- ipAddress?: string | null | undefined;
48
- userAgent?: string | null | undefined;
49
- };
50
- user: Record<string, any> & {
51
- id: string;
52
- createdAt: Date;
53
- updatedAt: Date;
54
- email: string;
55
- emailVerified: boolean;
56
- name: string;
57
- image?: string | null | undefined;
58
- };
59
- };
60
- }>)[];
61
- metadata: {
62
- openapi: {
63
- summary: string;
64
- description: string;
65
- responses: {
66
- 200: {
67
- description: string;
68
- content: {
69
- "application/json": {
70
- schema: {
71
- type: "object";
72
- properties: {
73
- totpURI: {
74
- type: string;
75
- description: string;
76
- };
77
- backupCodes: {
78
- type: string;
79
- items: {
80
- type: string;
81
- };
82
- description: string;
83
- };
84
- };
85
- };
86
- };
87
- };
88
- };
89
- };
90
- };
91
- };
92
- }, {
93
- totpURI: string;
94
- backupCodes: string[];
95
- }>;
96
- disableTwoFactor: import("better-auth").StrictEndpoint<"/two-factor/disable", {
97
- method: "POST";
98
- body: import("better-auth").ZodObject<{
99
- password: import("better-auth").ZodString;
100
- }, import("better-auth").$strip>;
101
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
102
- session: {
103
- session: Record<string, any> & {
104
- id: string;
105
- createdAt: Date;
106
- updatedAt: Date;
107
- userId: string;
108
- expiresAt: Date;
109
- token: string;
110
- ipAddress?: string | null | undefined;
111
- userAgent?: string | null | undefined;
112
- };
113
- user: Record<string, any> & {
114
- id: string;
115
- createdAt: Date;
116
- updatedAt: Date;
117
- email: string;
118
- emailVerified: boolean;
119
- name: string;
120
- image?: string | null | undefined;
121
- };
122
- };
123
- }>)[];
124
- metadata: {
125
- openapi: {
126
- summary: string;
127
- description: string;
128
- responses: {
129
- 200: {
130
- description: string;
131
- content: {
132
- "application/json": {
133
- schema: {
134
- type: "object";
135
- properties: {
136
- status: {
137
- type: string;
138
- };
139
- };
140
- };
141
- };
142
- };
143
- };
144
- };
145
- };
146
- };
147
- }, {
148
- status: boolean;
149
- }>;
150
- verifyBackupCode: import("better-auth").StrictEndpoint<"/two-factor/verify-backup-code", {
151
- method: "POST";
152
- body: import("better-auth").ZodObject<{
153
- code: import("better-auth").ZodString;
154
- disableSession: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
155
- trustDevice: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
156
- }, import("better-auth").$strip>;
157
- metadata: {
158
- openapi: {
159
- description: string;
160
- responses: {
161
- "200": {
162
- description: string;
163
- content: {
164
- "application/json": {
165
- schema: {
166
- type: "object";
167
- properties: {
168
- user: {
169
- type: string;
170
- properties: {
171
- id: {
172
- type: string;
173
- description: string;
174
- };
175
- email: {
176
- type: string;
177
- format: string;
178
- nullable: boolean;
179
- description: string;
180
- };
181
- emailVerified: {
182
- type: string;
183
- nullable: boolean;
184
- description: string;
185
- };
186
- name: {
187
- type: string;
188
- nullable: boolean;
189
- description: string;
190
- };
191
- image: {
192
- type: string;
193
- format: string;
194
- nullable: boolean;
195
- description: string;
196
- };
197
- twoFactorEnabled: {
198
- type: string;
199
- description: string;
200
- };
201
- createdAt: {
202
- type: string;
203
- format: string;
204
- description: string;
205
- };
206
- updatedAt: {
207
- type: string;
208
- format: string;
209
- description: string;
210
- };
211
- };
212
- required: string[];
213
- description: string;
214
- };
215
- session: {
216
- type: string;
217
- properties: {
218
- token: {
219
- type: string;
220
- description: string;
221
- };
222
- userId: {
223
- type: string;
224
- description: string;
225
- };
226
- createdAt: {
227
- type: string;
228
- format: string;
229
- description: string;
230
- };
231
- expiresAt: {
232
- type: string;
233
- format: string;
234
- description: string;
235
- };
236
- };
237
- required: string[];
238
- description: string;
239
- };
240
- };
241
- required: string[];
242
- };
243
- };
244
- };
245
- };
246
- };
247
- };
248
- };
249
- }, {
250
- token: string | undefined;
251
- user: (Record<string, any> & {
252
- id: string;
253
- createdAt: Date;
254
- updatedAt: Date;
255
- email: string;
256
- emailVerified: boolean;
257
- name: string;
258
- image?: string | null | undefined;
259
- }) | import("better-auth/plugins").UserWithTwoFactor;
260
- }>;
261
- generateBackupCodes: import("better-auth").StrictEndpoint<"/two-factor/generate-backup-codes", {
262
- method: "POST";
263
- body: import("better-auth").ZodObject<{
264
- password: import("better-auth").ZodString;
265
- }, import("better-auth").$strip>;
266
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
267
- session: {
268
- session: Record<string, any> & {
269
- id: string;
270
- createdAt: Date;
271
- updatedAt: Date;
272
- userId: string;
273
- expiresAt: Date;
274
- token: string;
275
- ipAddress?: string | null | undefined;
276
- userAgent?: string | null | undefined;
277
- };
278
- user: Record<string, any> & {
279
- id: string;
280
- createdAt: Date;
281
- updatedAt: Date;
282
- email: string;
283
- emailVerified: boolean;
284
- name: string;
285
- image?: string | null | undefined;
286
- };
287
- };
288
- }>)[];
289
- metadata: {
290
- openapi: {
291
- description: string;
292
- responses: {
293
- "200": {
294
- description: string;
295
- content: {
296
- "application/json": {
297
- schema: {
298
- type: "object";
299
- properties: {
300
- status: {
301
- type: string;
302
- description: string;
303
- enum: boolean[];
304
- };
305
- backupCodes: {
306
- type: string;
307
- items: {
308
- type: string;
309
- };
310
- description: string;
311
- };
312
- };
313
- required: string[];
314
- };
315
- };
316
- };
317
- };
318
- };
319
- };
320
- };
321
- }, {
322
- status: boolean;
323
- backupCodes: string[];
324
- }>;
325
- viewBackupCodes: import("better-auth").StrictEndpoint<string, {
326
- method: "POST";
327
- body: import("better-auth").ZodObject<{
328
- userId: import("better-auth").ZodCoercedString<unknown>;
329
- }, import("better-auth").$strip>;
330
- }, {
331
- status: boolean;
332
- backupCodes: string[];
333
- }>;
334
- sendTwoFactorOTP: import("better-auth").StrictEndpoint<"/two-factor/send-otp", {
335
- method: "POST";
336
- body: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
337
- trustDevice: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
338
- }, import("better-auth").$strip>>;
339
- metadata: {
340
- openapi: {
341
- summary: string;
342
- description: string;
343
- responses: {
344
- 200: {
345
- description: string;
346
- content: {
347
- "application/json": {
348
- schema: {
349
- type: "object";
350
- properties: {
351
- status: {
352
- type: string;
353
- };
354
- };
355
- };
356
- };
357
- };
358
- };
359
- };
360
- };
361
- };
362
- }, {
363
- status: boolean;
364
- }>;
365
- verifyTwoFactorOTP: import("better-auth").StrictEndpoint<"/two-factor/verify-otp", {
366
- method: "POST";
367
- body: import("better-auth").ZodObject<{
368
- code: import("better-auth").ZodString;
369
- trustDevice: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
370
- }, import("better-auth").$strip>;
371
- metadata: {
372
- openapi: {
373
- summary: string;
374
- description: string;
375
- responses: {
376
- "200": {
377
- description: string;
378
- content: {
379
- "application/json": {
380
- schema: {
381
- type: "object";
382
- properties: {
383
- token: {
384
- type: string;
385
- description: string;
386
- };
387
- user: {
388
- type: string;
389
- properties: {
390
- id: {
391
- type: string;
392
- description: string;
393
- };
394
- email: {
395
- type: string;
396
- format: string;
397
- nullable: boolean;
398
- description: string;
399
- };
400
- emailVerified: {
401
- type: string;
402
- nullable: boolean;
403
- description: string;
404
- };
405
- name: {
406
- type: string;
407
- nullable: boolean;
408
- description: string;
409
- };
410
- image: {
411
- type: string;
412
- format: string;
413
- nullable: boolean;
414
- description: string;
415
- };
416
- createdAt: {
417
- type: string;
418
- format: string;
419
- description: string;
420
- };
421
- updatedAt: {
422
- type: string;
423
- format: string;
424
- description: string;
425
- };
426
- };
427
- required: string[];
428
- description: string;
429
- };
430
- };
431
- required: string[];
432
- };
433
- };
434
- };
435
- };
436
- };
437
- };
438
- };
439
- }, {
440
- token: string;
441
- user: import("better-auth/plugins").UserWithTwoFactor;
442
- } | {
443
- token: string;
444
- user: Record<string, any> & {
445
- id: string;
446
- createdAt: Date;
447
- updatedAt: Date;
448
- email: string;
449
- emailVerified: boolean;
450
- name: string;
451
- image?: string | null | undefined;
452
- };
453
- }>;
454
- generateTOTP: import("better-auth").StrictEndpoint<string, {
455
- method: "POST";
456
- body: import("better-auth").ZodObject<{
457
- secret: import("better-auth").ZodString;
458
- }, import("better-auth").$strip>;
459
- metadata: {
460
- openapi: {
461
- summary: string;
462
- description: string;
463
- responses: {
464
- 200: {
465
- description: string;
466
- content: {
467
- "application/json": {
468
- schema: {
469
- type: "object";
470
- properties: {
471
- code: {
472
- type: string;
473
- };
474
- };
475
- };
476
- };
477
- };
478
- };
479
- };
480
- };
481
- };
482
- }, {
483
- code: string;
484
- }>;
485
- getTOTPURI: import("better-auth").StrictEndpoint<"/two-factor/get-totp-uri", {
486
- method: "POST";
487
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
488
- session: {
489
- session: Record<string, any> & {
490
- id: string;
491
- createdAt: Date;
492
- updatedAt: Date;
493
- userId: string;
494
- expiresAt: Date;
495
- token: string;
496
- ipAddress?: string | null | undefined;
497
- userAgent?: string | null | undefined;
498
- };
499
- user: Record<string, any> & {
500
- id: string;
501
- createdAt: Date;
502
- updatedAt: Date;
503
- email: string;
504
- emailVerified: boolean;
505
- name: string;
506
- image?: string | null | undefined;
507
- };
508
- };
509
- }>)[];
510
- body: import("better-auth").ZodObject<{
511
- password: import("better-auth").ZodString;
512
- }, import("better-auth").$strip>;
513
- metadata: {
514
- openapi: {
515
- summary: string;
516
- description: string;
517
- responses: {
518
- 200: {
519
- description: string;
520
- content: {
521
- "application/json": {
522
- schema: {
523
- type: "object";
524
- properties: {
525
- totpURI: {
526
- type: string;
527
- };
528
- };
529
- };
530
- };
531
- };
532
- };
533
- };
534
- };
535
- };
536
- }, {
537
- totpURI: string;
538
- }>;
539
- verifyTOTP: import("better-auth").StrictEndpoint<"/two-factor/verify-totp", {
540
- method: "POST";
541
- body: import("better-auth").ZodObject<{
542
- code: import("better-auth").ZodString;
543
- trustDevice: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
544
- }, import("better-auth").$strip>;
545
- metadata: {
546
- openapi: {
547
- summary: string;
548
- description: string;
549
- responses: {
550
- 200: {
551
- description: string;
552
- content: {
553
- "application/json": {
554
- schema: {
555
- type: "object";
556
- properties: {
557
- status: {
558
- type: string;
559
- };
560
- };
561
- };
562
- };
563
- };
564
- };
565
- };
566
- };
567
- };
568
- }, {
569
- token: string;
570
- user: import("better-auth/plugins").UserWithTwoFactor;
571
- } | {
572
- token: string;
573
- user: Record<string, any> & {
574
- id: string;
575
- createdAt: Date;
576
- updatedAt: Date;
577
- email: string;
578
- emailVerified: boolean;
579
- name: string;
580
- image?: string | null | undefined;
581
- };
582
- }>;
583
- };
584
- options: NoInfer<O>;
585
- hooks: {
586
- after: {
587
- matcher(context: import("better-auth").HookEndpointContext): boolean;
588
- handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
589
- twoFactorRedirect: boolean;
590
- } | undefined>;
591
- }[];
592
- };
593
- schema: {
594
- user: {
595
- fields: {
596
- twoFactorEnabled: {
597
- type: "boolean";
598
- required: false;
599
- defaultValue: false;
600
- input: false;
601
- };
602
- };
603
- };
604
- twoFactor: {
605
- fields: {
606
- secret: {
607
- type: "string";
608
- required: true;
609
- returned: false;
610
- index: true;
611
- };
612
- backupCodes: {
613
- type: "string";
614
- required: true;
615
- returned: false;
616
- };
617
- userId: {
618
- type: "string";
619
- required: true;
620
- returned: false;
621
- references: {
622
- model: string;
623
- field: string;
624
- };
625
- index: true;
626
- };
627
- };
628
- };
629
- };
630
- rateLimit: {
631
- pathMatcher(path: string): boolean;
632
- window: number;
633
- max: number;
634
- }[];
635
- $ERROR_CODES: {
636
- OTP_NOT_ENABLED: import("better-auth").RawError<"OTP_NOT_ENABLED">;
637
- OTP_HAS_EXPIRED: import("better-auth").RawError<"OTP_HAS_EXPIRED">;
638
- TOTP_NOT_ENABLED: import("better-auth").RawError<"TOTP_NOT_ENABLED">;
639
- TWO_FACTOR_NOT_ENABLED: import("better-auth").RawError<"TWO_FACTOR_NOT_ENABLED">;
640
- BACKUP_CODES_NOT_ENABLED: import("better-auth").RawError<"BACKUP_CODES_NOT_ENABLED">;
641
- INVALID_BACKUP_CODE: import("better-auth").RawError<"INVALID_BACKUP_CODE">;
642
- INVALID_CODE: import("better-auth").RawError<"INVALID_CODE">;
643
- TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: import("better-auth").RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
644
- INVALID_TWO_FACTOR_COOKIE: import("better-auth").RawError<"INVALID_TWO_FACTOR_COOKIE">;
645
- };
646
- })>;
647
- atomListeners: {
648
- matcher: (path: string) => boolean;
649
- signal: "$sessionSignal";
650
- }[];
651
- pathMethods: {
652
- "/two-factor/disable": "POST";
653
- "/two-factor/enable": "POST";
654
- "/two-factor/send-otp": "POST";
655
- "/two-factor/generate-backup-codes": "POST";
656
- "/two-factor/get-totp-uri": "POST";
657
- "/two-factor/verify-totp": "POST";
658
- "/two-factor/verify-otp": "POST";
659
- "/two-factor/verify-backup-code": "POST";
660
- };
661
- fetchPlugins: {
662
- id: string;
663
- name: string;
664
- hooks: {
665
- onSuccess(context: import("better-auth/react").SuccessContext<any>): Promise<void>;
666
- };
667
- }[];
668
- $ERROR_CODES: {
669
- OTP_NOT_ENABLED: import("better-auth").RawError<"OTP_NOT_ENABLED">;
670
- OTP_HAS_EXPIRED: import("better-auth").RawError<"OTP_HAS_EXPIRED">;
671
- TOTP_NOT_ENABLED: import("better-auth").RawError<"TOTP_NOT_ENABLED">;
672
- TWO_FACTOR_NOT_ENABLED: import("better-auth").RawError<"TWO_FACTOR_NOT_ENABLED">;
673
- BACKUP_CODES_NOT_ENABLED: import("better-auth").RawError<"BACKUP_CODES_NOT_ENABLED">;
674
- INVALID_BACKUP_CODE: import("better-auth").RawError<"INVALID_BACKUP_CODE">;
675
- INVALID_CODE: import("better-auth").RawError<"INVALID_CODE">;
676
- TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: import("better-auth").RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
677
- INVALID_TWO_FACTOR_COOKIE: import("better-auth").RawError<"INVALID_TWO_FACTOR_COOKIE">;
678
- };
679
- }];
33
+ export declare const payloadAuthPlugins: BetterAuthClientPlugin[];
680
34
  export interface PayloadAuthClientOptions {
681
35
  /** Base URL for auth endpoints (defaults to window.location.origin) */
682
36
  baseURL?: string;
683
37
  }
38
+ export type PayloadAuthClient = ReturnType<typeof createAuthClient>;
684
39
  /**
685
40
  * Create a pre-configured auth client with default core plugins (twoFactor).
686
41
  *
@@ -702,1035 +57,4 @@ export interface PayloadAuthClientOptions {
702
57
  * })
703
58
  * ```
704
59
  */
705
- export declare function createPayloadAuthClient(options?: PayloadAuthClientOptions): {
706
- signOut: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
707
- query?: Record<string, any> | undefined;
708
- fetchOptions?: FetchOptions | undefined;
709
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
710
- success: boolean;
711
- }, {
712
- code?: string | undefined;
713
- message?: string | undefined;
714
- }, FetchOptions["throw"] extends true ? true : false>>;
715
- } & {
716
- resetPassword: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
717
- newPassword: string;
718
- token?: string | undefined;
719
- }> & Record<string, any>, Partial<{
720
- token?: string | undefined;
721
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
722
- newPassword: string;
723
- token?: string | undefined;
724
- } & {
725
- fetchOptions?: FetchOptions | undefined;
726
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
727
- status: boolean;
728
- }, {
729
- code?: string | undefined;
730
- message?: string | undefined;
731
- }, FetchOptions["throw"] extends true ? true : false>>;
732
- } & {
733
- verifyEmail: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
734
- token: string;
735
- callbackURL?: string | undefined;
736
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
737
- query: {
738
- token: string;
739
- callbackURL?: string | undefined;
740
- };
741
- fetchOptions?: FetchOptions | undefined;
742
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<NonNullable<void | {
743
- status: boolean;
744
- }>, {
745
- code?: string | undefined;
746
- message?: string | undefined;
747
- }, FetchOptions["throw"] extends true ? true : false>>;
748
- } & {
749
- sendVerificationEmail: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
750
- email: string;
751
- callbackURL?: string | undefined;
752
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
753
- email: string;
754
- callbackURL?: string | undefined;
755
- } & {
756
- fetchOptions?: FetchOptions | undefined;
757
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
758
- status: boolean;
759
- }, {
760
- code?: string | undefined;
761
- message?: string | undefined;
762
- }, FetchOptions["throw"] extends true ? true : false>>;
763
- } & {
764
- changeEmail: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
765
- newEmail: string;
766
- callbackURL?: string | undefined;
767
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
768
- newEmail: string;
769
- callbackURL?: string | undefined;
770
- } & {
771
- fetchOptions?: FetchOptions | undefined;
772
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
773
- status: boolean;
774
- }, {
775
- code?: string | undefined;
776
- message?: string | undefined;
777
- }, FetchOptions["throw"] extends true ? true : false>>;
778
- } & {
779
- changePassword: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
780
- newPassword: string;
781
- currentPassword: string;
782
- revokeOtherSessions?: boolean | undefined;
783
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
784
- newPassword: string;
785
- currentPassword: string;
786
- revokeOtherSessions?: boolean | undefined;
787
- } & {
788
- fetchOptions?: FetchOptions | undefined;
789
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<Omit<{
790
- token: string | null;
791
- user: {
792
- id: string;
793
- createdAt: Date;
794
- updatedAt: Date;
795
- email: string;
796
- emailVerified: boolean;
797
- name: string;
798
- image?: string | null | undefined;
799
- } & Record<string, any> & {
800
- id: string;
801
- createdAt: Date;
802
- updatedAt: Date;
803
- email: string;
804
- emailVerified: boolean;
805
- name: string;
806
- image?: string | null | undefined;
807
- };
808
- }, "user"> & {
809
- user: import("better-auth").StripEmptyObjects<{
810
- id: string;
811
- createdAt: Date;
812
- updatedAt: Date;
813
- email: string;
814
- emailVerified: boolean;
815
- name: string;
816
- image?: string | null | undefined;
817
- } & {
818
- twoFactorEnabled: boolean | null | undefined;
819
- } & {}>;
820
- }, {
821
- code?: string | undefined;
822
- message?: string | undefined;
823
- }, FetchOptions["throw"] extends true ? true : false>>;
824
- } & {
825
- deleteUser: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
826
- callbackURL?: string | undefined;
827
- password?: string | undefined;
828
- token?: string | undefined;
829
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
830
- callbackURL?: string | undefined;
831
- password?: string | undefined;
832
- token?: string | undefined;
833
- } & {
834
- fetchOptions?: FetchOptions | undefined;
835
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
836
- success: boolean;
837
- message: string;
838
- }, {
839
- code?: string | undefined;
840
- message?: string | undefined;
841
- }, FetchOptions["throw"] extends true ? true : false>>;
842
- } & {
843
- requestPasswordReset: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
844
- email: string;
845
- redirectTo?: string | undefined;
846
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
847
- email: string;
848
- redirectTo?: string | undefined;
849
- } & {
850
- fetchOptions?: FetchOptions | undefined;
851
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
852
- status: boolean;
853
- message: string;
854
- }, {
855
- code?: string | undefined;
856
- message?: string | undefined;
857
- }, FetchOptions["throw"] extends true ? true : false>>;
858
- } & {
859
- resetPassword: {
860
- ":token": <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
861
- callbackURL: string;
862
- }> & Record<string, any>, {
863
- token: string;
864
- }>>(data_0: import("better-auth").Prettify<{
865
- query: {
866
- callbackURL: string;
867
- };
868
- fetchOptions?: FetchOptions | undefined;
869
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<never, {
870
- code?: string | undefined;
871
- message?: string | undefined;
872
- }, FetchOptions["throw"] extends true ? true : false>>;
873
- };
874
- } & {
875
- revokeSession: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
876
- token: string;
877
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
878
- token: string;
879
- } & {
880
- fetchOptions?: FetchOptions | undefined;
881
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
882
- status: boolean;
883
- }, {
884
- code?: string | undefined;
885
- message?: string | undefined;
886
- }, FetchOptions["throw"] extends true ? true : false>>;
887
- } & {
888
- revokeSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
889
- query?: Record<string, any> | undefined;
890
- fetchOptions?: FetchOptions | undefined;
891
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
892
- status: boolean;
893
- }, {
894
- code?: string | undefined;
895
- message?: string | undefined;
896
- }, FetchOptions["throw"] extends true ? true : false>>;
897
- } & {
898
- revokeOtherSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
899
- query?: Record<string, any> | undefined;
900
- fetchOptions?: FetchOptions | undefined;
901
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
902
- status: boolean;
903
- }, {
904
- code?: string | undefined;
905
- message?: string | undefined;
906
- }, FetchOptions["throw"] extends true ? true : false>>;
907
- } & {
908
- linkSocial: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
909
- provider: unknown;
910
- callbackURL?: string | undefined;
911
- idToken?: {
912
- token: string;
913
- nonce?: string | undefined;
914
- accessToken?: string | undefined;
915
- refreshToken?: string | undefined;
916
- scopes?: string[] | undefined;
917
- } | undefined;
918
- requestSignUp?: boolean | undefined;
919
- scopes?: string[] | undefined;
920
- errorCallbackURL?: string | undefined;
921
- disableRedirect?: boolean | undefined;
922
- additionalData?: Record<string, any> | undefined;
923
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
924
- provider: unknown;
925
- callbackURL?: string | undefined;
926
- idToken?: {
927
- token: string;
928
- nonce?: string | undefined;
929
- accessToken?: string | undefined;
930
- refreshToken?: string | undefined;
931
- scopes?: string[] | undefined;
932
- } | undefined;
933
- requestSignUp?: boolean | undefined;
934
- scopes?: string[] | undefined;
935
- errorCallbackURL?: string | undefined;
936
- disableRedirect?: boolean | undefined;
937
- additionalData?: Record<string, any> | undefined;
938
- } & {
939
- fetchOptions?: FetchOptions | undefined;
940
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
941
- url: string;
942
- redirect: boolean;
943
- }, {
944
- code?: string | undefined;
945
- message?: string | undefined;
946
- }, FetchOptions["throw"] extends true ? true : false>>;
947
- } & {
948
- listAccounts: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
949
- query?: Record<string, any> | undefined;
950
- fetchOptions?: FetchOptions | undefined;
951
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
952
- scopes: string[];
953
- id: string;
954
- createdAt: Date;
955
- updatedAt: Date;
956
- userId: string;
957
- providerId: string;
958
- accountId: string;
959
- }[], {
960
- code?: string | undefined;
961
- message?: string | undefined;
962
- }, FetchOptions["throw"] extends true ? true : false>>;
963
- } & {
964
- deleteUser: {
965
- callback: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
966
- token: string;
967
- callbackURL?: string | undefined;
968
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
969
- query: {
970
- token: string;
971
- callbackURL?: string | undefined;
972
- };
973
- fetchOptions?: FetchOptions | undefined;
974
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
975
- success: boolean;
976
- message: string;
977
- }, {
978
- code?: string | undefined;
979
- message?: string | undefined;
980
- }, FetchOptions["throw"] extends true ? true : false>>;
981
- };
982
- } & {
983
- unlinkAccount: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
984
- providerId: string;
985
- accountId?: string | undefined;
986
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
987
- providerId: string;
988
- accountId?: string | undefined;
989
- } & {
990
- fetchOptions?: FetchOptions | undefined;
991
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
992
- status: boolean;
993
- }, {
994
- code?: string | undefined;
995
- message?: string | undefined;
996
- }, FetchOptions["throw"] extends true ? true : false>>;
997
- } & {
998
- refreshToken: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
999
- providerId: string;
1000
- accountId?: string | undefined;
1001
- userId?: string | undefined;
1002
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
1003
- providerId: string;
1004
- accountId?: string | undefined;
1005
- userId?: string | undefined;
1006
- } & {
1007
- fetchOptions?: FetchOptions | undefined;
1008
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
1009
- accessToken: string | undefined;
1010
- refreshToken: string;
1011
- accessTokenExpiresAt: Date | undefined;
1012
- refreshTokenExpiresAt: Date | null | undefined;
1013
- scope: string | null | undefined;
1014
- idToken: string | null | undefined;
1015
- providerId: string;
1016
- accountId: string;
1017
- }, {
1018
- code?: string | undefined;
1019
- message?: string | undefined;
1020
- }, FetchOptions["throw"] extends true ? true : false>>;
1021
- } & {
1022
- getAccessToken: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
1023
- providerId: string;
1024
- accountId?: string | undefined;
1025
- userId?: string | undefined;
1026
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
1027
- providerId: string;
1028
- accountId?: string | undefined;
1029
- userId?: string | undefined;
1030
- } & {
1031
- fetchOptions?: FetchOptions | undefined;
1032
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
1033
- accessToken: string;
1034
- accessTokenExpiresAt: Date | undefined;
1035
- scopes: string[];
1036
- idToken: string | undefined;
1037
- }, {
1038
- code?: string | undefined;
1039
- message?: string | undefined;
1040
- }, FetchOptions["throw"] extends true ? true : false>>;
1041
- } & {
1042
- accountInfo: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
1043
- accountId?: string | undefined;
1044
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
1045
- query?: {
1046
- accountId?: string | undefined;
1047
- } | undefined;
1048
- fetchOptions?: FetchOptions | undefined;
1049
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
1050
- user: import("better-auth").OAuth2UserInfo;
1051
- data: Record<string, any>;
1052
- }, {
1053
- code?: string | undefined;
1054
- message?: string | undefined;
1055
- }, FetchOptions["throw"] extends true ? true : false>>;
1056
- } & {
1057
- signIn: {
1058
- social: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
1059
- provider: (string & {}) | "github" | "apple" | "atlassian" | "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";
1060
- callbackURL?: string | undefined;
1061
- newUserCallbackURL?: string | undefined;
1062
- errorCallbackURL?: string | undefined;
1063
- disableRedirect?: boolean | undefined;
1064
- idToken?: {
1065
- token: string;
1066
- nonce?: string | undefined;
1067
- accessToken?: string | undefined;
1068
- refreshToken?: string | undefined;
1069
- expiresAt?: number | undefined;
1070
- } | undefined;
1071
- scopes?: string[] | undefined;
1072
- requestSignUp?: boolean | undefined;
1073
- loginHint?: string | undefined;
1074
- additionalData?: Record<string, any> | undefined;
1075
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
1076
- provider: (string & {}) | "github" | "apple" | "atlassian" | "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";
1077
- callbackURL?: string | undefined;
1078
- newUserCallbackURL?: string | undefined;
1079
- errorCallbackURL?: string | undefined;
1080
- disableRedirect?: boolean | undefined;
1081
- idToken?: {
1082
- token: string;
1083
- nonce?: string | undefined;
1084
- accessToken?: string | undefined;
1085
- refreshToken?: string | undefined;
1086
- expiresAt?: number | undefined;
1087
- } | undefined;
1088
- scopes?: string[] | undefined;
1089
- requestSignUp?: boolean | undefined;
1090
- loginHint?: string | undefined;
1091
- additionalData?: Record<string, any> | undefined;
1092
- } & {
1093
- fetchOptions?: FetchOptions | undefined;
1094
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
1095
- redirect: boolean;
1096
- url: string;
1097
- } | (Omit<{
1098
- redirect: boolean;
1099
- token: string;
1100
- url: undefined;
1101
- user: {
1102
- id: string;
1103
- createdAt: Date;
1104
- updatedAt: Date;
1105
- email: string;
1106
- emailVerified: boolean;
1107
- name: string;
1108
- image?: string | null | undefined | undefined;
1109
- };
1110
- }, "user"> & {
1111
- user: import("better-auth").StripEmptyObjects<{
1112
- id: string;
1113
- createdAt: Date;
1114
- updatedAt: Date;
1115
- email: string;
1116
- emailVerified: boolean;
1117
- name: string;
1118
- image?: string | null | undefined;
1119
- } & {
1120
- twoFactorEnabled: boolean | null | undefined;
1121
- } & {}>;
1122
- }), {
1123
- code?: string | undefined;
1124
- message?: string | undefined;
1125
- }, FetchOptions["throw"] extends true ? true : false>>;
1126
- };
1127
- } & {
1128
- signUp: {
1129
- email: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
1130
- name: string;
1131
- email: string;
1132
- password: string;
1133
- image?: string | undefined;
1134
- callbackURL?: string | undefined;
1135
- rememberMe?: boolean | undefined;
1136
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
1137
- email: string;
1138
- name: string;
1139
- password: string;
1140
- image?: string | undefined;
1141
- callbackURL?: string | undefined;
1142
- fetchOptions?: FetchOptions | undefined;
1143
- } & {} & {}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<(Omit<{
1144
- token: null;
1145
- user: {
1146
- id: string;
1147
- createdAt: Date;
1148
- updatedAt: Date;
1149
- email: string;
1150
- emailVerified: boolean;
1151
- name: string;
1152
- image?: string | null | undefined | undefined;
1153
- };
1154
- }, "user"> & {
1155
- user: import("better-auth").StripEmptyObjects<{
1156
- id: string;
1157
- createdAt: Date;
1158
- updatedAt: Date;
1159
- email: string;
1160
- emailVerified: boolean;
1161
- name: string;
1162
- image?: string | null | undefined;
1163
- } & {
1164
- twoFactorEnabled: boolean | null | undefined;
1165
- } & {}>;
1166
- }) | (Omit<{
1167
- token: string;
1168
- user: {
1169
- id: string;
1170
- createdAt: Date;
1171
- updatedAt: Date;
1172
- email: string;
1173
- emailVerified: boolean;
1174
- name: string;
1175
- image?: string | null | undefined | undefined;
1176
- };
1177
- }, "user"> & {
1178
- user: import("better-auth").StripEmptyObjects<{
1179
- id: string;
1180
- createdAt: Date;
1181
- updatedAt: Date;
1182
- email: string;
1183
- emailVerified: boolean;
1184
- name: string;
1185
- image?: string | null | undefined;
1186
- } & {
1187
- twoFactorEnabled: boolean | null | undefined;
1188
- } & {}>;
1189
- }), {
1190
- code?: string | undefined;
1191
- message?: string | undefined;
1192
- }, FetchOptions["throw"] extends true ? true : false>>;
1193
- };
1194
- } & {
1195
- signIn: {
1196
- email: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
1197
- email: string;
1198
- password: string;
1199
- callbackURL?: string | undefined;
1200
- rememberMe?: boolean | undefined;
1201
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
1202
- email: string;
1203
- password: string;
1204
- callbackURL?: string | undefined;
1205
- rememberMe?: boolean | undefined;
1206
- } & {
1207
- fetchOptions?: FetchOptions | undefined;
1208
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<Omit<{
1209
- redirect: boolean;
1210
- token: string;
1211
- url?: string | undefined;
1212
- user: {
1213
- id: string;
1214
- createdAt: Date;
1215
- updatedAt: Date;
1216
- email: string;
1217
- emailVerified: boolean;
1218
- name: string;
1219
- image?: string | null | undefined | undefined;
1220
- };
1221
- }, "user"> & {
1222
- user: import("better-auth").StripEmptyObjects<{
1223
- id: string;
1224
- createdAt: Date;
1225
- updatedAt: Date;
1226
- email: string;
1227
- emailVerified: boolean;
1228
- name: string;
1229
- image?: string | null | undefined;
1230
- } & {
1231
- twoFactorEnabled: boolean | null | undefined;
1232
- } & {}>;
1233
- }, {
1234
- code?: string | undefined;
1235
- message?: string | undefined;
1236
- }, FetchOptions["throw"] extends true ? true : false>>;
1237
- };
1238
- } & {
1239
- updateSession: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<Partial<{}>> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<Partial<{}> & {
1240
- fetchOptions?: FetchOptions | undefined;
1241
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
1242
- session: {
1243
- id: string;
1244
- createdAt: Date;
1245
- updatedAt: Date;
1246
- userId: string;
1247
- expiresAt: Date;
1248
- token: string;
1249
- ipAddress?: string | null | undefined;
1250
- userAgent?: string | null | undefined;
1251
- };
1252
- }, {
1253
- code?: string | undefined;
1254
- message?: string | undefined;
1255
- }, FetchOptions["throw"] extends true ? true : false>>;
1256
- } & {
1257
- updateUser: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<Partial<{}> & {
1258
- name?: string | undefined;
1259
- image?: string | undefined | null;
1260
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
1261
- image?: (string | null) | undefined;
1262
- name?: string | undefined;
1263
- fetchOptions?: FetchOptions | undefined;
1264
- } & Partial<{} & {}>> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
1265
- status: boolean;
1266
- }, {
1267
- code?: string | undefined;
1268
- message?: string | undefined;
1269
- }, FetchOptions["throw"] extends true ? true : false>>;
1270
- } & {
1271
- listSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
1272
- query?: Record<string, any> | undefined;
1273
- fetchOptions?: FetchOptions | undefined;
1274
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<import("better-auth").Prettify<{
1275
- id: string;
1276
- createdAt: Date;
1277
- updatedAt: Date;
1278
- userId: string;
1279
- expiresAt: Date;
1280
- token: string;
1281
- ipAddress?: string | null | undefined | undefined;
1282
- userAgent?: string | null | undefined | undefined;
1283
- }>[], {
1284
- code?: string | undefined;
1285
- message?: string | undefined;
1286
- }, FetchOptions["throw"] extends true ? true : false>>;
1287
- } & {
1288
- getSession: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
1289
- disableCookieCache?: unknown;
1290
- disableRefresh?: unknown;
1291
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
1292
- query?: {
1293
- disableCookieCache?: unknown;
1294
- disableRefresh?: unknown;
1295
- } | undefined;
1296
- fetchOptions?: FetchOptions | undefined;
1297
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
1298
- user: import("better-auth").StripEmptyObjects<{
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
- twoFactorEnabled: boolean | null | undefined;
1308
- } & {}>;
1309
- session: import("better-auth").StripEmptyObjects<{
1310
- id: string;
1311
- createdAt: Date;
1312
- updatedAt: Date;
1313
- userId: string;
1314
- expiresAt: Date;
1315
- token: string;
1316
- ipAddress?: string | null | undefined;
1317
- userAgent?: string | null | undefined;
1318
- }>;
1319
- } | null, {
1320
- code?: string | undefined;
1321
- message?: string | undefined;
1322
- }, FetchOptions["throw"] extends true ? true : false>>;
1323
- } & {
1324
- twoFactor: {
1325
- enable: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
1326
- password: string;
1327
- issuer?: string | undefined;
1328
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
1329
- password: string;
1330
- issuer?: string | undefined;
1331
- } & {
1332
- fetchOptions?: FetchOptions | undefined;
1333
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
1334
- totpURI: string;
1335
- backupCodes: string[];
1336
- }, {
1337
- code?: string | undefined;
1338
- message?: string | undefined;
1339
- }, FetchOptions["throw"] extends true ? true : false>>;
1340
- };
1341
- } & {
1342
- twoFactor: {
1343
- disable: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
1344
- password: string;
1345
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
1346
- password: string;
1347
- } & {
1348
- fetchOptions?: FetchOptions | undefined;
1349
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
1350
- status: boolean;
1351
- }, {
1352
- code?: string | undefined;
1353
- message?: string | undefined;
1354
- }, FetchOptions["throw"] extends true ? true : false>>;
1355
- };
1356
- } & {
1357
- twoFactor: {
1358
- verifyBackupCode: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
1359
- code: string;
1360
- disableSession?: boolean | undefined;
1361
- trustDevice?: boolean | undefined;
1362
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
1363
- code: string;
1364
- disableSession?: boolean | undefined;
1365
- trustDevice?: boolean | undefined;
1366
- } & {
1367
- fetchOptions?: FetchOptions | undefined;
1368
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<Omit<{
1369
- token: string | undefined;
1370
- user: (Record<string, any> & {
1371
- id: string;
1372
- createdAt: Date;
1373
- updatedAt: Date;
1374
- email: string;
1375
- emailVerified: boolean;
1376
- name: string;
1377
- image?: string | null | undefined;
1378
- }) | import("better-auth/plugins").UserWithTwoFactor;
1379
- }, "user"> & {
1380
- user: import("better-auth").StripEmptyObjects<{
1381
- id: string;
1382
- createdAt: Date;
1383
- updatedAt: Date;
1384
- email: string;
1385
- emailVerified: boolean;
1386
- name: string;
1387
- image?: string | null | undefined;
1388
- } & {
1389
- twoFactorEnabled: boolean | null | undefined;
1390
- } & {}>;
1391
- }, {
1392
- code?: string | undefined;
1393
- message?: string | undefined;
1394
- }, FetchOptions["throw"] extends true ? true : false>>;
1395
- };
1396
- } & {
1397
- twoFactor: {
1398
- generateBackupCodes: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
1399
- password: string;
1400
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
1401
- password: string;
1402
- } & {
1403
- fetchOptions?: FetchOptions | undefined;
1404
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
1405
- status: boolean;
1406
- backupCodes: string[];
1407
- }, {
1408
- code?: string | undefined;
1409
- message?: string | undefined;
1410
- }, FetchOptions["throw"] extends true ? true : false>>;
1411
- };
1412
- } & {
1413
- twoFactor: {
1414
- sendOtp: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
1415
- trustDevice?: boolean | undefined;
1416
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
1417
- query?: Record<string, any> | undefined;
1418
- fetchOptions?: FetchOptions | undefined;
1419
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
1420
- status: boolean;
1421
- }, {
1422
- code?: string | undefined;
1423
- message?: string | undefined;
1424
- }, FetchOptions["throw"] extends true ? true : false>>;
1425
- };
1426
- } & {
1427
- twoFactor: {
1428
- verifyOtp: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
1429
- code: string;
1430
- trustDevice?: boolean | undefined;
1431
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
1432
- code: string;
1433
- trustDevice?: boolean | undefined;
1434
- } & {
1435
- fetchOptions?: FetchOptions | undefined;
1436
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<(Omit<{
1437
- token: string;
1438
- user: import("better-auth/plugins").UserWithTwoFactor;
1439
- }, "user"> & {
1440
- user: import("better-auth").StripEmptyObjects<{
1441
- id: string;
1442
- createdAt: Date;
1443
- updatedAt: Date;
1444
- email: string;
1445
- emailVerified: boolean;
1446
- name: string;
1447
- image?: string | null | undefined;
1448
- } & {
1449
- twoFactorEnabled: boolean | null | undefined;
1450
- } & {}>;
1451
- }) | (Omit<{
1452
- token: string;
1453
- user: Record<string, any> & {
1454
- id: string;
1455
- createdAt: Date;
1456
- updatedAt: Date;
1457
- email: string;
1458
- emailVerified: boolean;
1459
- name: string;
1460
- image?: string | null | undefined;
1461
- };
1462
- }, "user"> & {
1463
- user: import("better-auth").StripEmptyObjects<{
1464
- id: string;
1465
- createdAt: Date;
1466
- updatedAt: Date;
1467
- email: string;
1468
- emailVerified: boolean;
1469
- name: string;
1470
- image?: string | null | undefined;
1471
- } & {
1472
- twoFactorEnabled: boolean | null | undefined;
1473
- } & {}>;
1474
- }), {
1475
- code?: string | undefined;
1476
- message?: string | undefined;
1477
- }, FetchOptions["throw"] extends true ? true : false>>;
1478
- };
1479
- } & {
1480
- twoFactor: {
1481
- getTotpUri: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
1482
- password: string;
1483
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
1484
- password: string;
1485
- } & {
1486
- fetchOptions?: FetchOptions | undefined;
1487
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
1488
- totpURI: string;
1489
- }, {
1490
- code?: string | undefined;
1491
- message?: string | undefined;
1492
- }, FetchOptions["throw"] extends true ? true : false>>;
1493
- };
1494
- } & {
1495
- twoFactor: {
1496
- verifyTotp: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
1497
- code: string;
1498
- trustDevice?: boolean | undefined;
1499
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
1500
- code: string;
1501
- trustDevice?: boolean | undefined;
1502
- } & {
1503
- fetchOptions?: FetchOptions | undefined;
1504
- }>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<(Omit<{
1505
- token: string;
1506
- user: import("better-auth/plugins").UserWithTwoFactor;
1507
- }, "user"> & {
1508
- user: import("better-auth").StripEmptyObjects<{
1509
- id: string;
1510
- createdAt: Date;
1511
- updatedAt: Date;
1512
- email: string;
1513
- emailVerified: boolean;
1514
- name: string;
1515
- image?: string | null | undefined;
1516
- } & {
1517
- twoFactorEnabled: boolean | null | undefined;
1518
- } & {}>;
1519
- }) | (Omit<{
1520
- token: string;
1521
- user: Record<string, any> & {
1522
- id: string;
1523
- createdAt: Date;
1524
- updatedAt: Date;
1525
- email: string;
1526
- emailVerified: boolean;
1527
- name: string;
1528
- image?: string | null | undefined;
1529
- };
1530
- }, "user"> & {
1531
- user: import("better-auth").StripEmptyObjects<{
1532
- id: string;
1533
- createdAt: Date;
1534
- updatedAt: Date;
1535
- email: string;
1536
- emailVerified: boolean;
1537
- name: string;
1538
- image?: string | null | undefined;
1539
- } & {
1540
- twoFactorEnabled: boolean | null | undefined;
1541
- } & {}>;
1542
- }), {
1543
- code?: string | undefined;
1544
- message?: string | undefined;
1545
- }, FetchOptions["throw"] extends true ? true : false>>;
1546
- };
1547
- } & {
1548
- useSession: () => {
1549
- data: {
1550
- user: import("better-auth").StripEmptyObjects<{
1551
- id: string;
1552
- createdAt: Date;
1553
- updatedAt: Date;
1554
- email: string;
1555
- emailVerified: boolean;
1556
- name: string;
1557
- image?: string | null | undefined;
1558
- } & {
1559
- twoFactorEnabled: boolean | null | undefined;
1560
- } & {}>;
1561
- session: import("better-auth").StripEmptyObjects<{
1562
- id: string;
1563
- createdAt: Date;
1564
- updatedAt: Date;
1565
- userId: string;
1566
- expiresAt: Date;
1567
- token: string;
1568
- ipAddress?: string | null | undefined;
1569
- userAgent?: string | null | undefined;
1570
- }>;
1571
- } | null;
1572
- isPending: boolean;
1573
- isRefetching: boolean;
1574
- error: import("better-auth/react").BetterFetchError | null;
1575
- refetch: (queryParams?: {
1576
- query?: import("better-auth").SessionQueryParams;
1577
- } | undefined) => Promise<void>;
1578
- };
1579
- $Infer: {
1580
- Session: {
1581
- user: import("better-auth").StripEmptyObjects<{
1582
- id: string;
1583
- createdAt: Date;
1584
- updatedAt: Date;
1585
- email: string;
1586
- emailVerified: boolean;
1587
- name: string;
1588
- image?: string | null | undefined;
1589
- } & {
1590
- twoFactorEnabled: boolean | null | undefined;
1591
- } & {}>;
1592
- session: import("better-auth").StripEmptyObjects<{
1593
- id: string;
1594
- createdAt: Date;
1595
- updatedAt: Date;
1596
- userId: string;
1597
- expiresAt: Date;
1598
- token: string;
1599
- ipAddress?: string | null | undefined;
1600
- userAgent?: string | null | undefined;
1601
- }>;
1602
- };
1603
- };
1604
- $fetch: import("better-auth/react").BetterFetch<{
1605
- plugins: (import("better-auth/react").BetterFetchPlugin<Record<string, any>> | {
1606
- id: string;
1607
- name: string;
1608
- hooks: {
1609
- onSuccess(context: import("better-auth/react").SuccessContext<any>): void;
1610
- };
1611
- } | {
1612
- id: string;
1613
- name: string;
1614
- hooks: {
1615
- onSuccess: ((context: import("better-auth/react").SuccessContext<any>) => Promise<void> | void) | undefined;
1616
- onError: ((context: import("better-auth/react").ErrorContext) => Promise<void> | void) | undefined;
1617
- onRequest: (<T extends Record<string, any>>(context: import("better-auth/react").RequestContext<T>) => Promise<import("better-auth/react").RequestContext | void> | import("better-auth/react").RequestContext | void) | undefined;
1618
- onResponse: ((context: import("better-auth/react").ResponseContext) => Promise<Response | void | import("better-auth/react").ResponseContext> | Response | import("better-auth/react").ResponseContext | void) | undefined;
1619
- };
1620
- })[];
1621
- cache?: RequestCache | undefined;
1622
- priority?: RequestPriority | undefined;
1623
- credentials?: RequestCredentials;
1624
- headers?: (HeadersInit & (HeadersInit | {
1625
- accept: "application/json" | "text/plain" | "application/octet-stream";
1626
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1627
- authorization: "Bearer" | "Basic";
1628
- })) | undefined;
1629
- integrity?: string | undefined;
1630
- keepalive?: boolean | undefined;
1631
- method: string;
1632
- mode?: RequestMode | undefined;
1633
- redirect?: RequestRedirect | undefined;
1634
- referrer?: string | undefined;
1635
- referrerPolicy?: ReferrerPolicy | undefined;
1636
- signal?: (AbortSignal | null) | undefined;
1637
- window?: null | undefined;
1638
- onRetry?: ((response: import("better-auth/react").ResponseContext) => Promise<void> | void) | undefined;
1639
- hookOptions?: {
1640
- cloneResponse?: boolean;
1641
- } | undefined;
1642
- timeout?: number | undefined;
1643
- customFetchImpl: import("better-auth/react").FetchEsque;
1644
- baseURL: string;
1645
- throw?: boolean | undefined;
1646
- auth?: ({
1647
- type: "Bearer";
1648
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1649
- } | {
1650
- type: "Basic";
1651
- username: string | (() => string | undefined) | undefined;
1652
- password: string | (() => string | undefined) | undefined;
1653
- } | {
1654
- type: "Custom";
1655
- prefix: string | (() => string | undefined) | undefined;
1656
- value: string | (() => string | undefined) | undefined;
1657
- }) | undefined;
1658
- body?: any;
1659
- query?: any;
1660
- params?: any;
1661
- duplex?: "full" | "half" | undefined;
1662
- jsonParser: (text: string) => Promise<any> | any;
1663
- retry?: import("better-auth/react").RetryOptions | undefined;
1664
- retryAttempt?: number | undefined;
1665
- output?: (import("better-auth/react").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1666
- errorSchema?: import("better-auth/react").StandardSchemaV1 | undefined;
1667
- disableValidation?: boolean | undefined;
1668
- disableSignal?: boolean | undefined;
1669
- }, unknown, unknown, {}>;
1670
- $store: {
1671
- notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
1672
- listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
1673
- atoms: Record<string, import("better-auth/react").WritableAtom<any>>;
1674
- };
1675
- $ERROR_CODES: {
1676
- OTP_NOT_ENABLED: import("better-auth").RawError<"OTP_NOT_ENABLED">;
1677
- OTP_HAS_EXPIRED: import("better-auth").RawError<"OTP_HAS_EXPIRED">;
1678
- TOTP_NOT_ENABLED: import("better-auth").RawError<"TOTP_NOT_ENABLED">;
1679
- TWO_FACTOR_NOT_ENABLED: import("better-auth").RawError<"TWO_FACTOR_NOT_ENABLED">;
1680
- BACKUP_CODES_NOT_ENABLED: import("better-auth").RawError<"BACKUP_CODES_NOT_ENABLED">;
1681
- INVALID_BACKUP_CODE: import("better-auth").RawError<"INVALID_BACKUP_CODE">;
1682
- INVALID_CODE: import("better-auth").RawError<"INVALID_CODE">;
1683
- TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: import("better-auth").RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
1684
- INVALID_TWO_FACTOR_COOKIE: import("better-auth").RawError<"INVALID_TWO_FACTOR_COOKIE">;
1685
- } & {
1686
- USER_NOT_FOUND: import("better-auth").RawError<"USER_NOT_FOUND">;
1687
- FAILED_TO_CREATE_USER: import("better-auth").RawError<"FAILED_TO_CREATE_USER">;
1688
- FAILED_TO_CREATE_SESSION: import("better-auth").RawError<"FAILED_TO_CREATE_SESSION">;
1689
- FAILED_TO_UPDATE_USER: import("better-auth").RawError<"FAILED_TO_UPDATE_USER">;
1690
- FAILED_TO_GET_SESSION: import("better-auth").RawError<"FAILED_TO_GET_SESSION">;
1691
- INVALID_PASSWORD: import("better-auth").RawError<"INVALID_PASSWORD">;
1692
- INVALID_EMAIL: import("better-auth").RawError<"INVALID_EMAIL">;
1693
- INVALID_EMAIL_OR_PASSWORD: import("better-auth").RawError<"INVALID_EMAIL_OR_PASSWORD">;
1694
- INVALID_USER: import("better-auth").RawError<"INVALID_USER">;
1695
- SOCIAL_ACCOUNT_ALREADY_LINKED: import("better-auth").RawError<"SOCIAL_ACCOUNT_ALREADY_LINKED">;
1696
- PROVIDER_NOT_FOUND: import("better-auth").RawError<"PROVIDER_NOT_FOUND">;
1697
- INVALID_TOKEN: import("better-auth").RawError<"INVALID_TOKEN">;
1698
- TOKEN_EXPIRED: import("better-auth").RawError<"TOKEN_EXPIRED">;
1699
- ID_TOKEN_NOT_SUPPORTED: import("better-auth").RawError<"ID_TOKEN_NOT_SUPPORTED">;
1700
- FAILED_TO_GET_USER_INFO: import("better-auth").RawError<"FAILED_TO_GET_USER_INFO">;
1701
- USER_EMAIL_NOT_FOUND: import("better-auth").RawError<"USER_EMAIL_NOT_FOUND">;
1702
- EMAIL_NOT_VERIFIED: import("better-auth").RawError<"EMAIL_NOT_VERIFIED">;
1703
- PASSWORD_TOO_SHORT: import("better-auth").RawError<"PASSWORD_TOO_SHORT">;
1704
- PASSWORD_TOO_LONG: import("better-auth").RawError<"PASSWORD_TOO_LONG">;
1705
- USER_ALREADY_EXISTS: import("better-auth").RawError<"USER_ALREADY_EXISTS">;
1706
- USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: import("better-auth").RawError<"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL">;
1707
- EMAIL_CAN_NOT_BE_UPDATED: import("better-auth").RawError<"EMAIL_CAN_NOT_BE_UPDATED">;
1708
- CREDENTIAL_ACCOUNT_NOT_FOUND: import("better-auth").RawError<"CREDENTIAL_ACCOUNT_NOT_FOUND">;
1709
- ACCOUNT_NOT_FOUND: import("better-auth").RawError<"ACCOUNT_NOT_FOUND">;
1710
- SESSION_EXPIRED: import("better-auth").RawError<"SESSION_EXPIRED">;
1711
- FAILED_TO_UNLINK_LAST_ACCOUNT: import("better-auth").RawError<"FAILED_TO_UNLINK_LAST_ACCOUNT">;
1712
- USER_ALREADY_HAS_PASSWORD: import("better-auth").RawError<"USER_ALREADY_HAS_PASSWORD">;
1713
- CROSS_SITE_NAVIGATION_LOGIN_BLOCKED: import("better-auth").RawError<"CROSS_SITE_NAVIGATION_LOGIN_BLOCKED">;
1714
- VERIFICATION_EMAIL_NOT_ENABLED: import("better-auth").RawError<"VERIFICATION_EMAIL_NOT_ENABLED">;
1715
- EMAIL_ALREADY_VERIFIED: import("better-auth").RawError<"EMAIL_ALREADY_VERIFIED">;
1716
- EMAIL_MISMATCH: import("better-auth").RawError<"EMAIL_MISMATCH">;
1717
- SESSION_NOT_FRESH: import("better-auth").RawError<"SESSION_NOT_FRESH">;
1718
- LINKED_ACCOUNT_ALREADY_EXISTS: import("better-auth").RawError<"LINKED_ACCOUNT_ALREADY_EXISTS">;
1719
- INVALID_ORIGIN: import("better-auth").RawError<"INVALID_ORIGIN">;
1720
- INVALID_CALLBACK_URL: import("better-auth").RawError<"INVALID_CALLBACK_URL">;
1721
- INVALID_REDIRECT_URL: import("better-auth").RawError<"INVALID_REDIRECT_URL">;
1722
- INVALID_ERROR_CALLBACK_URL: import("better-auth").RawError<"INVALID_ERROR_CALLBACK_URL">;
1723
- INVALID_NEW_USER_CALLBACK_URL: import("better-auth").RawError<"INVALID_NEW_USER_CALLBACK_URL">;
1724
- MISSING_OR_NULL_ORIGIN: import("better-auth").RawError<"MISSING_OR_NULL_ORIGIN">;
1725
- CALLBACK_URL_REQUIRED: import("better-auth").RawError<"CALLBACK_URL_REQUIRED">;
1726
- FAILED_TO_CREATE_VERIFICATION: import("better-auth").RawError<"FAILED_TO_CREATE_VERIFICATION">;
1727
- FIELD_NOT_ALLOWED: import("better-auth").RawError<"FIELD_NOT_ALLOWED">;
1728
- ASYNC_VALIDATION_NOT_SUPPORTED: import("better-auth").RawError<"ASYNC_VALIDATION_NOT_SUPPORTED">;
1729
- VALIDATION_ERROR: import("better-auth").RawError<"VALIDATION_ERROR">;
1730
- MISSING_FIELD: import("better-auth").RawError<"MISSING_FIELD">;
1731
- METHOD_NOT_ALLOWED_DEFER_SESSION_REQUIRED: import("better-auth").RawError<"METHOD_NOT_ALLOWED_DEFER_SESSION_REQUIRED">;
1732
- BODY_MUST_BE_AN_OBJECT: import("better-auth").RawError<"BODY_MUST_BE_AN_OBJECT">;
1733
- PASSWORD_ALREADY_SET: import("better-auth").RawError<"PASSWORD_ALREADY_SET">;
1734
- };
1735
- };
1736
- export type PayloadAuthClient = ReturnType<typeof createPayloadAuthClient>;
60
+ export declare function createPayloadAuthClient(options?: PayloadAuthClientOptions): PayloadAuthClient;