@greatapps/greatauth-ui 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,1061 @@
1
+ import { ReactNode, ComponentType } from 'react';
2
+ import * as nanostores from 'nanostores';
3
+ import * as _better_fetch_fetch from '@better-fetch/fetch';
4
+ import * as better_auth from 'better-auth';
5
+ import { NextRequest, NextResponse } from 'next/server';
6
+ import { ClassValue } from 'clsx';
7
+
8
+ interface AppShellConfig {
9
+ appName: string;
10
+ appIcon: ReactNode;
11
+ appBadge?: string;
12
+ menuGroups: MenuGroup[];
13
+ routeLabels: Record<string, string>;
14
+ defaultBreadcrumb?: string;
15
+ userDisplayFields?: {
16
+ showLastName?: boolean;
17
+ };
18
+ footerExtra?: ReactNode;
19
+ onLogout?: () => void;
20
+ }
21
+ interface MenuGroup {
22
+ label: string;
23
+ items: MenuItem[];
24
+ }
25
+ interface MenuItem {
26
+ icon: ComponentType<{
27
+ className?: string;
28
+ }>;
29
+ label: string;
30
+ href: string;
31
+ children?: MenuItem[];
32
+ onClick?: () => void;
33
+ }
34
+ interface HeaderConfig {
35
+ defaultBreadcrumb?: string;
36
+ routeLabels: Record<string, string>;
37
+ }
38
+ interface LoginFormConfig {
39
+ icon: ReactNode;
40
+ appName: string;
41
+ appBadge?: {
42
+ text: string;
43
+ variant: "destructive" | "outline";
44
+ };
45
+ description: string;
46
+ callbackUrlDefault: string;
47
+ onPostLoginSuccess?: (user: unknown, token?: string) => Promise<string | null>;
48
+ }
49
+
50
+ declare const authClient: {
51
+ signIn: {
52
+ social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
53
+ 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";
54
+ callbackURL?: string | undefined;
55
+ newUserCallbackURL?: string | undefined;
56
+ errorCallbackURL?: string | undefined;
57
+ disableRedirect?: boolean | undefined;
58
+ idToken?: {
59
+ token: string;
60
+ nonce?: string | undefined;
61
+ accessToken?: string | undefined;
62
+ refreshToken?: string | undefined;
63
+ expiresAt?: number | undefined;
64
+ } | undefined;
65
+ scopes?: string[] | undefined;
66
+ requestSignUp?: boolean | undefined;
67
+ loginHint?: string | undefined;
68
+ additionalData?: Record<string, any> | undefined;
69
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
70
+ 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";
71
+ callbackURL?: string | undefined;
72
+ newUserCallbackURL?: string | undefined;
73
+ errorCallbackURL?: string | undefined;
74
+ disableRedirect?: boolean | undefined;
75
+ idToken?: {
76
+ token: string;
77
+ nonce?: string | undefined;
78
+ accessToken?: string | undefined;
79
+ refreshToken?: string | undefined;
80
+ expiresAt?: number | undefined;
81
+ } | undefined;
82
+ scopes?: string[] | undefined;
83
+ requestSignUp?: boolean | undefined;
84
+ loginHint?: string | undefined;
85
+ additionalData?: Record<string, any> | undefined;
86
+ } & {
87
+ fetchOptions?: FetchOptions | undefined;
88
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
89
+ redirect: boolean;
90
+ url: string;
91
+ } | (Omit<{
92
+ redirect: boolean;
93
+ token: string;
94
+ url: undefined;
95
+ user: {
96
+ id: string;
97
+ createdAt: Date;
98
+ updatedAt: Date;
99
+ email: string;
100
+ emailVerified: boolean;
101
+ name: string;
102
+ image?: string | null | undefined | undefined;
103
+ };
104
+ }, "user"> & {
105
+ user: better_auth.StripEmptyObjects<{
106
+ id: string;
107
+ createdAt: Date;
108
+ updatedAt: Date;
109
+ email: string;
110
+ emailVerified: boolean;
111
+ name: string;
112
+ image?: string | null | undefined;
113
+ }>;
114
+ }), {
115
+ code?: string | undefined;
116
+ message?: string | undefined;
117
+ }, FetchOptions["throw"] extends true ? true : false>>;
118
+ };
119
+ } & {
120
+ signOut: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
121
+ query?: Record<string, any> | undefined;
122
+ fetchOptions?: FetchOptions | undefined;
123
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
124
+ success: boolean;
125
+ }, {
126
+ code?: string | undefined;
127
+ message?: string | undefined;
128
+ }, FetchOptions["throw"] extends true ? true : false>>;
129
+ } & {
130
+ signUp: {
131
+ email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
132
+ name: string;
133
+ email: string;
134
+ password: string;
135
+ image?: string | undefined;
136
+ callbackURL?: string | undefined;
137
+ rememberMe?: boolean | undefined;
138
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
139
+ email: string;
140
+ name: string;
141
+ password: string;
142
+ image?: string | undefined;
143
+ callbackURL?: string | undefined;
144
+ fetchOptions?: FetchOptions | undefined;
145
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<(Omit<{
146
+ token: null;
147
+ user: {
148
+ id: string;
149
+ createdAt: Date;
150
+ updatedAt: Date;
151
+ email: string;
152
+ emailVerified: boolean;
153
+ name: string;
154
+ image?: string | null | undefined | undefined;
155
+ };
156
+ }, "user"> & {
157
+ user: better_auth.StripEmptyObjects<{
158
+ id: string;
159
+ createdAt: Date;
160
+ updatedAt: Date;
161
+ email: string;
162
+ emailVerified: boolean;
163
+ name: string;
164
+ image?: string | null | undefined;
165
+ }>;
166
+ }) | (Omit<{
167
+ token: string;
168
+ user: {
169
+ id: string;
170
+ createdAt: Date;
171
+ updatedAt: Date;
172
+ email: string;
173
+ emailVerified: boolean;
174
+ name: string;
175
+ image?: string | null | undefined | undefined;
176
+ };
177
+ }, "user"> & {
178
+ user: better_auth.StripEmptyObjects<{
179
+ id: string;
180
+ createdAt: Date;
181
+ updatedAt: Date;
182
+ email: string;
183
+ emailVerified: boolean;
184
+ name: string;
185
+ image?: string | null | undefined;
186
+ }>;
187
+ }), {
188
+ code?: string | undefined;
189
+ message?: string | undefined;
190
+ }, FetchOptions["throw"] extends true ? true : false>>;
191
+ };
192
+ } & {
193
+ signIn: {
194
+ email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
195
+ email: string;
196
+ password: string;
197
+ callbackURL?: string | undefined;
198
+ rememberMe?: boolean | undefined;
199
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
200
+ email: string;
201
+ password: string;
202
+ callbackURL?: string | undefined;
203
+ rememberMe?: boolean | undefined;
204
+ } & {
205
+ fetchOptions?: FetchOptions | undefined;
206
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<Omit<{
207
+ redirect: boolean;
208
+ token: string;
209
+ url?: string | undefined;
210
+ user: {
211
+ id: string;
212
+ createdAt: Date;
213
+ updatedAt: Date;
214
+ email: string;
215
+ emailVerified: boolean;
216
+ name: string;
217
+ image?: string | null | undefined | undefined;
218
+ };
219
+ }, "user"> & {
220
+ user: better_auth.StripEmptyObjects<{
221
+ id: string;
222
+ createdAt: Date;
223
+ updatedAt: Date;
224
+ email: string;
225
+ emailVerified: boolean;
226
+ name: string;
227
+ image?: string | null | undefined;
228
+ }>;
229
+ }, {
230
+ code?: string | undefined;
231
+ message?: string | undefined;
232
+ }, FetchOptions["throw"] extends true ? true : false>>;
233
+ };
234
+ } & {
235
+ resetPassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
236
+ newPassword: string;
237
+ token?: string | undefined;
238
+ }> & Record<string, any>, Partial<{
239
+ token?: string | undefined;
240
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
241
+ newPassword: string;
242
+ token?: string | undefined;
243
+ } & {
244
+ fetchOptions?: FetchOptions | undefined;
245
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
246
+ status: boolean;
247
+ }, {
248
+ code?: string | undefined;
249
+ message?: string | undefined;
250
+ }, FetchOptions["throw"] extends true ? true : false>>;
251
+ } & {
252
+ verifyEmail: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
253
+ token: string;
254
+ callbackURL?: string | undefined;
255
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
256
+ query: {
257
+ token: string;
258
+ callbackURL?: string | undefined;
259
+ };
260
+ fetchOptions?: FetchOptions | undefined;
261
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<void | {
262
+ status: boolean;
263
+ }>, {
264
+ code?: string | undefined;
265
+ message?: string | undefined;
266
+ }, FetchOptions["throw"] extends true ? true : false>>;
267
+ } & {
268
+ sendVerificationEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
269
+ email: string;
270
+ callbackURL?: string | undefined;
271
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
272
+ email: string;
273
+ callbackURL?: string | undefined;
274
+ } & {
275
+ fetchOptions?: FetchOptions | undefined;
276
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
277
+ status: boolean;
278
+ }, {
279
+ code?: string | undefined;
280
+ message?: string | undefined;
281
+ }, FetchOptions["throw"] extends true ? true : false>>;
282
+ } & {
283
+ changeEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
284
+ newEmail: string;
285
+ callbackURL?: string | undefined;
286
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
287
+ newEmail: string;
288
+ callbackURL?: string | undefined;
289
+ } & {
290
+ fetchOptions?: FetchOptions | undefined;
291
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
292
+ status: boolean;
293
+ }, {
294
+ code?: string | undefined;
295
+ message?: string | undefined;
296
+ }, FetchOptions["throw"] extends true ? true : false>>;
297
+ } & {
298
+ changePassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
299
+ newPassword: string;
300
+ currentPassword: string;
301
+ revokeOtherSessions?: boolean | undefined;
302
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
303
+ newPassword: string;
304
+ currentPassword: string;
305
+ revokeOtherSessions?: boolean | undefined;
306
+ } & {
307
+ fetchOptions?: FetchOptions | undefined;
308
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<Omit<{
309
+ token: string | null;
310
+ user: {
311
+ id: string;
312
+ createdAt: Date;
313
+ updatedAt: Date;
314
+ email: string;
315
+ emailVerified: boolean;
316
+ name: string;
317
+ image?: string | null | undefined;
318
+ } & Record<string, any> & {
319
+ id: string;
320
+ createdAt: Date;
321
+ updatedAt: Date;
322
+ email: string;
323
+ emailVerified: boolean;
324
+ name: string;
325
+ image?: string | null | undefined;
326
+ };
327
+ }, "user"> & {
328
+ user: better_auth.StripEmptyObjects<{
329
+ id: string;
330
+ createdAt: Date;
331
+ updatedAt: Date;
332
+ email: string;
333
+ emailVerified: boolean;
334
+ name: string;
335
+ image?: string | null | undefined;
336
+ }>;
337
+ }, {
338
+ code?: string | undefined;
339
+ message?: string | undefined;
340
+ }, FetchOptions["throw"] extends true ? true : false>>;
341
+ } & {
342
+ 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<{}> & {
343
+ fetchOptions?: FetchOptions | undefined;
344
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
345
+ session: {
346
+ id: string;
347
+ createdAt: Date;
348
+ updatedAt: Date;
349
+ userId: string;
350
+ expiresAt: Date;
351
+ token: string;
352
+ ipAddress?: string | null | undefined;
353
+ userAgent?: string | null | undefined;
354
+ };
355
+ }, {
356
+ code?: string | undefined;
357
+ message?: string | undefined;
358
+ }, FetchOptions["throw"] extends true ? true : false>>;
359
+ } & {
360
+ updateUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<Partial<{}> & {
361
+ name?: string | undefined;
362
+ image?: string | undefined | null;
363
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
364
+ image?: (string | null) | undefined;
365
+ name?: string | undefined;
366
+ fetchOptions?: FetchOptions | undefined;
367
+ } & Partial<{}>> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
368
+ status: boolean;
369
+ }, {
370
+ code?: string | undefined;
371
+ message?: string | undefined;
372
+ }, FetchOptions["throw"] extends true ? true : false>>;
373
+ } & {
374
+ deleteUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
375
+ callbackURL?: string | undefined;
376
+ password?: string | undefined;
377
+ token?: string | undefined;
378
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
379
+ callbackURL?: string | undefined;
380
+ password?: string | undefined;
381
+ token?: string | undefined;
382
+ } & {
383
+ fetchOptions?: FetchOptions | undefined;
384
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
385
+ success: boolean;
386
+ message: string;
387
+ }, {
388
+ code?: string | undefined;
389
+ message?: string | undefined;
390
+ }, FetchOptions["throw"] extends true ? true : false>>;
391
+ } & {
392
+ requestPasswordReset: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
393
+ email: string;
394
+ redirectTo?: string | undefined;
395
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
396
+ email: string;
397
+ redirectTo?: string | undefined;
398
+ } & {
399
+ fetchOptions?: FetchOptions | undefined;
400
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
401
+ status: boolean;
402
+ message: string;
403
+ }, {
404
+ code?: string | undefined;
405
+ message?: string | undefined;
406
+ }, FetchOptions["throw"] extends true ? true : false>>;
407
+ } & {
408
+ resetPassword: {
409
+ ":token": <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
410
+ callbackURL: string;
411
+ }> & Record<string, any>, {
412
+ token: string;
413
+ }>>(data_0: better_auth.Prettify<{
414
+ query: {
415
+ callbackURL: string;
416
+ };
417
+ fetchOptions?: FetchOptions | undefined;
418
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<never, {
419
+ code?: string | undefined;
420
+ message?: string | undefined;
421
+ }, FetchOptions["throw"] extends true ? true : false>>;
422
+ };
423
+ } & {
424
+ listSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
425
+ query?: Record<string, any> | undefined;
426
+ fetchOptions?: FetchOptions | undefined;
427
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<better_auth.Prettify<{
428
+ id: string;
429
+ createdAt: Date;
430
+ updatedAt: Date;
431
+ userId: string;
432
+ expiresAt: Date;
433
+ token: string;
434
+ ipAddress?: string | null | undefined | undefined;
435
+ userAgent?: string | null | undefined | undefined;
436
+ }>[], {
437
+ code?: string | undefined;
438
+ message?: string | undefined;
439
+ }, FetchOptions["throw"] extends true ? true : false>>;
440
+ } & {
441
+ revokeSession: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
442
+ token: string;
443
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
444
+ token: string;
445
+ } & {
446
+ fetchOptions?: FetchOptions | undefined;
447
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
448
+ status: boolean;
449
+ }, {
450
+ code?: string | undefined;
451
+ message?: string | undefined;
452
+ }, FetchOptions["throw"] extends true ? true : false>>;
453
+ } & {
454
+ revokeSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
455
+ query?: Record<string, any> | undefined;
456
+ fetchOptions?: FetchOptions | undefined;
457
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
458
+ status: boolean;
459
+ }, {
460
+ code?: string | undefined;
461
+ message?: string | undefined;
462
+ }, FetchOptions["throw"] extends true ? true : false>>;
463
+ } & {
464
+ revokeOtherSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
465
+ query?: Record<string, any> | undefined;
466
+ fetchOptions?: FetchOptions | undefined;
467
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
468
+ status: boolean;
469
+ }, {
470
+ code?: string | undefined;
471
+ message?: string | undefined;
472
+ }, FetchOptions["throw"] extends true ? true : false>>;
473
+ } & {
474
+ linkSocial: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
475
+ provider: unknown;
476
+ callbackURL?: string | undefined;
477
+ idToken?: {
478
+ token: string;
479
+ nonce?: string | undefined;
480
+ accessToken?: string | undefined;
481
+ refreshToken?: string | undefined;
482
+ scopes?: string[] | undefined;
483
+ } | undefined;
484
+ requestSignUp?: boolean | undefined;
485
+ scopes?: string[] | undefined;
486
+ errorCallbackURL?: string | undefined;
487
+ disableRedirect?: boolean | undefined;
488
+ additionalData?: Record<string, any> | undefined;
489
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
490
+ provider: unknown;
491
+ callbackURL?: string | undefined;
492
+ idToken?: {
493
+ token: string;
494
+ nonce?: string | undefined;
495
+ accessToken?: string | undefined;
496
+ refreshToken?: string | undefined;
497
+ scopes?: string[] | undefined;
498
+ } | undefined;
499
+ requestSignUp?: boolean | undefined;
500
+ scopes?: string[] | undefined;
501
+ errorCallbackURL?: string | undefined;
502
+ disableRedirect?: boolean | undefined;
503
+ additionalData?: Record<string, any> | undefined;
504
+ } & {
505
+ fetchOptions?: FetchOptions | undefined;
506
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
507
+ url: string;
508
+ redirect: boolean;
509
+ }, {
510
+ code?: string | undefined;
511
+ message?: string | undefined;
512
+ }, FetchOptions["throw"] extends true ? true : false>>;
513
+ } & {
514
+ listAccounts: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
515
+ query?: Record<string, any> | undefined;
516
+ fetchOptions?: FetchOptions | undefined;
517
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
518
+ scopes: string[];
519
+ id: string;
520
+ createdAt: Date;
521
+ updatedAt: Date;
522
+ userId: string;
523
+ providerId: string;
524
+ accountId: string;
525
+ }[], {
526
+ code?: string | undefined;
527
+ message?: string | undefined;
528
+ }, FetchOptions["throw"] extends true ? true : false>>;
529
+ } & {
530
+ deleteUser: {
531
+ callback: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
532
+ token: string;
533
+ callbackURL?: string | undefined;
534
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
535
+ query: {
536
+ token: string;
537
+ callbackURL?: string | undefined;
538
+ };
539
+ fetchOptions?: FetchOptions | undefined;
540
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
541
+ success: boolean;
542
+ message: string;
543
+ }, {
544
+ code?: string | undefined;
545
+ message?: string | undefined;
546
+ }, FetchOptions["throw"] extends true ? true : false>>;
547
+ };
548
+ } & {
549
+ unlinkAccount: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
550
+ providerId: string;
551
+ accountId?: string | undefined;
552
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
553
+ providerId: string;
554
+ accountId?: string | undefined;
555
+ } & {
556
+ fetchOptions?: FetchOptions | undefined;
557
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
558
+ status: boolean;
559
+ }, {
560
+ code?: string | undefined;
561
+ message?: string | undefined;
562
+ }, FetchOptions["throw"] extends true ? true : false>>;
563
+ } & {
564
+ refreshToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
565
+ providerId: string;
566
+ accountId?: string | undefined;
567
+ userId?: string | undefined;
568
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
569
+ providerId: string;
570
+ accountId?: string | undefined;
571
+ userId?: string | undefined;
572
+ } & {
573
+ fetchOptions?: FetchOptions | undefined;
574
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
575
+ accessToken: string | undefined;
576
+ refreshToken: string;
577
+ accessTokenExpiresAt: Date | undefined;
578
+ refreshTokenExpiresAt: Date | null | undefined;
579
+ scope: string | null | undefined;
580
+ idToken: string | null | undefined;
581
+ providerId: string;
582
+ accountId: string;
583
+ }, {
584
+ code?: string | undefined;
585
+ message?: string | undefined;
586
+ }, FetchOptions["throw"] extends true ? true : false>>;
587
+ } & {
588
+ getAccessToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
589
+ providerId: string;
590
+ accountId?: string | undefined;
591
+ userId?: string | undefined;
592
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
593
+ providerId: string;
594
+ accountId?: string | undefined;
595
+ userId?: string | undefined;
596
+ } & {
597
+ fetchOptions?: FetchOptions | undefined;
598
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
599
+ accessToken: string;
600
+ accessTokenExpiresAt: Date | undefined;
601
+ scopes: string[];
602
+ idToken: string | undefined;
603
+ }, {
604
+ code?: string | undefined;
605
+ message?: string | undefined;
606
+ }, FetchOptions["throw"] extends true ? true : false>>;
607
+ } & {
608
+ accountInfo: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
609
+ accountId?: string | undefined;
610
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
611
+ query?: {
612
+ accountId?: string | undefined;
613
+ } | undefined;
614
+ fetchOptions?: FetchOptions | undefined;
615
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
616
+ user: better_auth.OAuth2UserInfo;
617
+ data: Record<string, any>;
618
+ }, {
619
+ code?: string | undefined;
620
+ message?: string | undefined;
621
+ }, FetchOptions["throw"] extends true ? true : false>>;
622
+ } & {
623
+ getSession: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
624
+ disableCookieCache?: unknown;
625
+ disableRefresh?: unknown;
626
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
627
+ query?: {
628
+ disableCookieCache?: unknown;
629
+ disableRefresh?: unknown;
630
+ } | undefined;
631
+ fetchOptions?: FetchOptions | undefined;
632
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
633
+ user: better_auth.StripEmptyObjects<{
634
+ id: string;
635
+ createdAt: Date;
636
+ updatedAt: Date;
637
+ email: string;
638
+ emailVerified: boolean;
639
+ name: string;
640
+ image?: string | null | undefined;
641
+ }>;
642
+ session: better_auth.StripEmptyObjects<{
643
+ id: string;
644
+ createdAt: Date;
645
+ updatedAt: Date;
646
+ userId: string;
647
+ expiresAt: Date;
648
+ token: string;
649
+ ipAddress?: string | null | undefined;
650
+ userAgent?: string | null | undefined;
651
+ }>;
652
+ } | null, {
653
+ code?: string | undefined;
654
+ message?: string | undefined;
655
+ }, FetchOptions["throw"] extends true ? true : false>>;
656
+ } & {
657
+ useSession: () => {
658
+ data: {
659
+ user: better_auth.StripEmptyObjects<{
660
+ id: string;
661
+ createdAt: Date;
662
+ updatedAt: Date;
663
+ email: string;
664
+ emailVerified: boolean;
665
+ name: string;
666
+ image?: string | null | undefined;
667
+ }>;
668
+ session: better_auth.StripEmptyObjects<{
669
+ id: string;
670
+ createdAt: Date;
671
+ updatedAt: Date;
672
+ userId: string;
673
+ expiresAt: Date;
674
+ token: string;
675
+ ipAddress?: string | null | undefined;
676
+ userAgent?: string | null | undefined;
677
+ }>;
678
+ } | null;
679
+ isPending: boolean;
680
+ isRefetching: boolean;
681
+ error: _better_fetch_fetch.BetterFetchError | null;
682
+ refetch: (queryParams?: {
683
+ query?: better_auth.SessionQueryParams;
684
+ } | undefined) => Promise<void>;
685
+ };
686
+ $Infer: {
687
+ Session: {
688
+ user: better_auth.StripEmptyObjects<{
689
+ id: string;
690
+ createdAt: Date;
691
+ updatedAt: Date;
692
+ email: string;
693
+ emailVerified: boolean;
694
+ name: string;
695
+ image?: string | null | undefined;
696
+ }>;
697
+ session: better_auth.StripEmptyObjects<{
698
+ id: string;
699
+ createdAt: Date;
700
+ updatedAt: Date;
701
+ userId: string;
702
+ expiresAt: Date;
703
+ token: string;
704
+ ipAddress?: string | null | undefined;
705
+ userAgent?: string | null | undefined;
706
+ }>;
707
+ };
708
+ };
709
+ $fetch: _better_fetch_fetch.BetterFetch<{
710
+ plugins: (_better_fetch_fetch.BetterFetchPlugin<Record<string, any>> | {
711
+ id: string;
712
+ name: string;
713
+ hooks: {
714
+ onSuccess(context: _better_fetch_fetch.SuccessContext<any>): void;
715
+ };
716
+ } | {
717
+ id: string;
718
+ name: string;
719
+ hooks: {
720
+ onSuccess: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
721
+ onError: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
722
+ onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
723
+ onResponse: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
724
+ };
725
+ })[];
726
+ cache?: RequestCache | undefined;
727
+ priority?: RequestPriority | undefined;
728
+ credentials?: RequestCredentials;
729
+ headers?: (HeadersInit & (HeadersInit | {
730
+ accept: "application/json" | "text/plain" | "application/octet-stream";
731
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
732
+ authorization: "Bearer" | "Basic";
733
+ })) | undefined;
734
+ integrity?: string | undefined;
735
+ keepalive?: boolean | undefined;
736
+ method: string;
737
+ mode?: RequestMode | undefined;
738
+ redirect?: RequestRedirect | undefined;
739
+ referrer?: string | undefined;
740
+ referrerPolicy?: ReferrerPolicy | undefined;
741
+ signal?: (AbortSignal | null) | undefined;
742
+ window?: null | undefined;
743
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
744
+ hookOptions?: {
745
+ cloneResponse?: boolean;
746
+ } | undefined;
747
+ timeout?: number | undefined;
748
+ customFetchImpl: _better_fetch_fetch.FetchEsque;
749
+ baseURL: string;
750
+ throw?: boolean | undefined;
751
+ auth?: ({
752
+ type: "Bearer";
753
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
754
+ } | {
755
+ type: "Basic";
756
+ username: string | (() => string | undefined) | undefined;
757
+ password: string | (() => string | undefined) | undefined;
758
+ } | {
759
+ type: "Custom";
760
+ prefix: string | (() => string | undefined) | undefined;
761
+ value: string | (() => string | undefined) | undefined;
762
+ }) | undefined;
763
+ body?: any;
764
+ query?: any;
765
+ params?: any;
766
+ duplex?: "full" | "half" | undefined;
767
+ jsonParser: (text: string) => Promise<any> | any;
768
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
769
+ retryAttempt?: number | undefined;
770
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
771
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
772
+ disableValidation?: boolean | undefined;
773
+ disableSignal?: boolean | undefined;
774
+ }, unknown, unknown, {}>;
775
+ $store: {
776
+ notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
777
+ listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
778
+ atoms: Record<string, nanostores.WritableAtom<any>>;
779
+ };
780
+ $ERROR_CODES: {
781
+ USER_NOT_FOUND: better_auth.RawError<"USER_NOT_FOUND">;
782
+ FAILED_TO_CREATE_USER: better_auth.RawError<"FAILED_TO_CREATE_USER">;
783
+ FAILED_TO_CREATE_SESSION: better_auth.RawError<"FAILED_TO_CREATE_SESSION">;
784
+ FAILED_TO_UPDATE_USER: better_auth.RawError<"FAILED_TO_UPDATE_USER">;
785
+ FAILED_TO_GET_SESSION: better_auth.RawError<"FAILED_TO_GET_SESSION">;
786
+ INVALID_PASSWORD: better_auth.RawError<"INVALID_PASSWORD">;
787
+ INVALID_EMAIL: better_auth.RawError<"INVALID_EMAIL">;
788
+ INVALID_EMAIL_OR_PASSWORD: better_auth.RawError<"INVALID_EMAIL_OR_PASSWORD">;
789
+ INVALID_USER: better_auth.RawError<"INVALID_USER">;
790
+ SOCIAL_ACCOUNT_ALREADY_LINKED: better_auth.RawError<"SOCIAL_ACCOUNT_ALREADY_LINKED">;
791
+ PROVIDER_NOT_FOUND: better_auth.RawError<"PROVIDER_NOT_FOUND">;
792
+ INVALID_TOKEN: better_auth.RawError<"INVALID_TOKEN">;
793
+ TOKEN_EXPIRED: better_auth.RawError<"TOKEN_EXPIRED">;
794
+ ID_TOKEN_NOT_SUPPORTED: better_auth.RawError<"ID_TOKEN_NOT_SUPPORTED">;
795
+ FAILED_TO_GET_USER_INFO: better_auth.RawError<"FAILED_TO_GET_USER_INFO">;
796
+ USER_EMAIL_NOT_FOUND: better_auth.RawError<"USER_EMAIL_NOT_FOUND">;
797
+ EMAIL_NOT_VERIFIED: better_auth.RawError<"EMAIL_NOT_VERIFIED">;
798
+ PASSWORD_TOO_SHORT: better_auth.RawError<"PASSWORD_TOO_SHORT">;
799
+ PASSWORD_TOO_LONG: better_auth.RawError<"PASSWORD_TOO_LONG">;
800
+ USER_ALREADY_EXISTS: better_auth.RawError<"USER_ALREADY_EXISTS">;
801
+ USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: better_auth.RawError<"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL">;
802
+ EMAIL_CAN_NOT_BE_UPDATED: better_auth.RawError<"EMAIL_CAN_NOT_BE_UPDATED">;
803
+ CREDENTIAL_ACCOUNT_NOT_FOUND: better_auth.RawError<"CREDENTIAL_ACCOUNT_NOT_FOUND">;
804
+ ACCOUNT_NOT_FOUND: better_auth.RawError<"ACCOUNT_NOT_FOUND">;
805
+ SESSION_EXPIRED: better_auth.RawError<"SESSION_EXPIRED">;
806
+ FAILED_TO_UNLINK_LAST_ACCOUNT: better_auth.RawError<"FAILED_TO_UNLINK_LAST_ACCOUNT">;
807
+ USER_ALREADY_HAS_PASSWORD: better_auth.RawError<"USER_ALREADY_HAS_PASSWORD">;
808
+ CROSS_SITE_NAVIGATION_LOGIN_BLOCKED: better_auth.RawError<"CROSS_SITE_NAVIGATION_LOGIN_BLOCKED">;
809
+ VERIFICATION_EMAIL_NOT_ENABLED: better_auth.RawError<"VERIFICATION_EMAIL_NOT_ENABLED">;
810
+ EMAIL_ALREADY_VERIFIED: better_auth.RawError<"EMAIL_ALREADY_VERIFIED">;
811
+ EMAIL_MISMATCH: better_auth.RawError<"EMAIL_MISMATCH">;
812
+ SESSION_NOT_FRESH: better_auth.RawError<"SESSION_NOT_FRESH">;
813
+ LINKED_ACCOUNT_ALREADY_EXISTS: better_auth.RawError<"LINKED_ACCOUNT_ALREADY_EXISTS">;
814
+ INVALID_ORIGIN: better_auth.RawError<"INVALID_ORIGIN">;
815
+ INVALID_CALLBACK_URL: better_auth.RawError<"INVALID_CALLBACK_URL">;
816
+ INVALID_REDIRECT_URL: better_auth.RawError<"INVALID_REDIRECT_URL">;
817
+ INVALID_ERROR_CALLBACK_URL: better_auth.RawError<"INVALID_ERROR_CALLBACK_URL">;
818
+ INVALID_NEW_USER_CALLBACK_URL: better_auth.RawError<"INVALID_NEW_USER_CALLBACK_URL">;
819
+ MISSING_OR_NULL_ORIGIN: better_auth.RawError<"MISSING_OR_NULL_ORIGIN">;
820
+ CALLBACK_URL_REQUIRED: better_auth.RawError<"CALLBACK_URL_REQUIRED">;
821
+ FAILED_TO_CREATE_VERIFICATION: better_auth.RawError<"FAILED_TO_CREATE_VERIFICATION">;
822
+ FIELD_NOT_ALLOWED: better_auth.RawError<"FIELD_NOT_ALLOWED">;
823
+ ASYNC_VALIDATION_NOT_SUPPORTED: better_auth.RawError<"ASYNC_VALIDATION_NOT_SUPPORTED">;
824
+ VALIDATION_ERROR: better_auth.RawError<"VALIDATION_ERROR">;
825
+ MISSING_FIELD: better_auth.RawError<"MISSING_FIELD">;
826
+ METHOD_NOT_ALLOWED_DEFER_SESSION_REQUIRED: better_auth.RawError<"METHOD_NOT_ALLOWED_DEFER_SESSION_REQUIRED">;
827
+ BODY_MUST_BE_AN_OBJECT: better_auth.RawError<"BODY_MUST_BE_AN_OBJECT">;
828
+ PASSWORD_ALREADY_SET: better_auth.RawError<"PASSWORD_ALREADY_SET">;
829
+ };
830
+ };
831
+ declare const useSession: () => {
832
+ data: {
833
+ user: better_auth.StripEmptyObjects<{
834
+ id: string;
835
+ createdAt: Date;
836
+ updatedAt: Date;
837
+ email: string;
838
+ emailVerified: boolean;
839
+ name: string;
840
+ image?: string | null | undefined;
841
+ }>;
842
+ session: better_auth.StripEmptyObjects<{
843
+ id: string;
844
+ createdAt: Date;
845
+ updatedAt: Date;
846
+ userId: string;
847
+ expiresAt: Date;
848
+ token: string;
849
+ ipAddress?: string | null | undefined;
850
+ userAgent?: string | null | undefined;
851
+ }>;
852
+ } | null;
853
+ isPending: boolean;
854
+ isRefetching: boolean;
855
+ error: _better_fetch_fetch.BetterFetchError | null;
856
+ refetch: (queryParams?: {
857
+ query?: better_auth.SessionQueryParams;
858
+ } | undefined) => Promise<void>;
859
+ };
860
+ declare const signIn: {
861
+ social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
862
+ 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";
863
+ callbackURL?: string | undefined;
864
+ newUserCallbackURL?: string | undefined;
865
+ errorCallbackURL?: string | undefined;
866
+ disableRedirect?: boolean | undefined;
867
+ idToken?: {
868
+ token: string;
869
+ nonce?: string | undefined;
870
+ accessToken?: string | undefined;
871
+ refreshToken?: string | undefined;
872
+ expiresAt?: number | undefined;
873
+ } | undefined;
874
+ scopes?: string[] | undefined;
875
+ requestSignUp?: boolean | undefined;
876
+ loginHint?: string | undefined;
877
+ additionalData?: Record<string, any> | undefined;
878
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
879
+ 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";
880
+ callbackURL?: string | undefined;
881
+ newUserCallbackURL?: string | undefined;
882
+ errorCallbackURL?: string | undefined;
883
+ disableRedirect?: boolean | undefined;
884
+ idToken?: {
885
+ token: string;
886
+ nonce?: string | undefined;
887
+ accessToken?: string | undefined;
888
+ refreshToken?: string | undefined;
889
+ expiresAt?: number | undefined;
890
+ } | undefined;
891
+ scopes?: string[] | undefined;
892
+ requestSignUp?: boolean | undefined;
893
+ loginHint?: string | undefined;
894
+ additionalData?: Record<string, any> | undefined;
895
+ } & {
896
+ fetchOptions?: FetchOptions | undefined;
897
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
898
+ redirect: boolean;
899
+ url: string;
900
+ } | (Omit<{
901
+ redirect: boolean;
902
+ token: string;
903
+ url: undefined;
904
+ user: {
905
+ id: string;
906
+ createdAt: Date;
907
+ updatedAt: Date;
908
+ email: string;
909
+ emailVerified: boolean;
910
+ name: string;
911
+ image?: string | null | undefined | undefined;
912
+ };
913
+ }, "user"> & {
914
+ user: better_auth.StripEmptyObjects<{
915
+ id: string;
916
+ createdAt: Date;
917
+ updatedAt: Date;
918
+ email: string;
919
+ emailVerified: boolean;
920
+ name: string;
921
+ image?: string | null | undefined;
922
+ }>;
923
+ }), {
924
+ code?: string | undefined;
925
+ message?: string | undefined;
926
+ }, FetchOptions["throw"] extends true ? true : false>>;
927
+ } & {
928
+ email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
929
+ email: string;
930
+ password: string;
931
+ callbackURL?: string | undefined;
932
+ rememberMe?: boolean | undefined;
933
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
934
+ email: string;
935
+ password: string;
936
+ callbackURL?: string | undefined;
937
+ rememberMe?: boolean | undefined;
938
+ } & {
939
+ fetchOptions?: FetchOptions | undefined;
940
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<Omit<{
941
+ redirect: boolean;
942
+ token: string;
943
+ url?: string | undefined;
944
+ user: {
945
+ id: string;
946
+ createdAt: Date;
947
+ updatedAt: Date;
948
+ email: string;
949
+ emailVerified: boolean;
950
+ name: string;
951
+ image?: string | null | undefined | undefined;
952
+ };
953
+ }, "user"> & {
954
+ user: better_auth.StripEmptyObjects<{
955
+ id: string;
956
+ createdAt: Date;
957
+ updatedAt: Date;
958
+ email: string;
959
+ emailVerified: boolean;
960
+ name: string;
961
+ image?: string | null | undefined;
962
+ }>;
963
+ }, {
964
+ code?: string | undefined;
965
+ message?: string | undefined;
966
+ }, FetchOptions["throw"] extends true ? true : false>>;
967
+ };
968
+ declare const signUp: {
969
+ email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
970
+ name: string;
971
+ email: string;
972
+ password: string;
973
+ image?: string | undefined;
974
+ callbackURL?: string | undefined;
975
+ rememberMe?: boolean | undefined;
976
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
977
+ email: string;
978
+ name: string;
979
+ password: string;
980
+ image?: string | undefined;
981
+ callbackURL?: string | undefined;
982
+ fetchOptions?: FetchOptions | undefined;
983
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<(Omit<{
984
+ token: null;
985
+ user: {
986
+ id: string;
987
+ createdAt: Date;
988
+ updatedAt: Date;
989
+ email: string;
990
+ emailVerified: boolean;
991
+ name: string;
992
+ image?: string | null | undefined | undefined;
993
+ };
994
+ }, "user"> & {
995
+ user: better_auth.StripEmptyObjects<{
996
+ id: string;
997
+ createdAt: Date;
998
+ updatedAt: Date;
999
+ email: string;
1000
+ emailVerified: boolean;
1001
+ name: string;
1002
+ image?: string | null | undefined;
1003
+ }>;
1004
+ }) | (Omit<{
1005
+ token: string;
1006
+ user: {
1007
+ id: string;
1008
+ createdAt: Date;
1009
+ updatedAt: Date;
1010
+ email: string;
1011
+ emailVerified: boolean;
1012
+ name: string;
1013
+ image?: string | null | undefined | undefined;
1014
+ };
1015
+ }, "user"> & {
1016
+ user: better_auth.StripEmptyObjects<{
1017
+ id: string;
1018
+ createdAt: Date;
1019
+ updatedAt: Date;
1020
+ email: string;
1021
+ emailVerified: boolean;
1022
+ name: string;
1023
+ image?: string | null | undefined;
1024
+ }>;
1025
+ }), {
1026
+ code?: string | undefined;
1027
+ message?: string | undefined;
1028
+ }, FetchOptions["throw"] extends true ? true : false>>;
1029
+ };
1030
+ declare const signOut: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1031
+ query?: Record<string, any> | undefined;
1032
+ fetchOptions?: FetchOptions | undefined;
1033
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1034
+ success: boolean;
1035
+ }, {
1036
+ code?: string | undefined;
1037
+ message?: string | undefined;
1038
+ }, FetchOptions["throw"] extends true ? true : false>>;
1039
+
1040
+ interface AuthMiddlewareConfig {
1041
+ publicPaths: string[];
1042
+ preserveSearchParams?: boolean;
1043
+ }
1044
+ declare function createAuthMiddleware(config: AuthMiddlewareConfig): (request: NextRequest) => NextResponse<unknown>;
1045
+ declare const authMiddlewareConfig: {
1046
+ matcher: string[];
1047
+ };
1048
+
1049
+ interface JwtClaimsConfig {
1050
+ [jwtClaimName: string]: string;
1051
+ }
1052
+ interface UseAuthConfig {
1053
+ jwtClaims?: JwtClaimsConfig;
1054
+ accountIdOverride?: (user: Record<string, unknown> | null) => string | null;
1055
+ extraUserFields?: string[];
1056
+ }
1057
+ declare function createUseAuth(config?: UseAuthConfig): () => Record<string, unknown>;
1058
+
1059
+ declare function cn(...inputs: ClassValue[]): string;
1060
+
1061
+ export { type AppShellConfig, type AuthMiddlewareConfig, type HeaderConfig, type LoginFormConfig, type MenuGroup, type MenuItem, authClient, authMiddlewareConfig, cn, createAuthMiddleware, createUseAuth, signIn, signOut, signUp, useSession };