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