@payez/next-mvp 4.0.0 → 4.0.2

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