hylekit 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +402 -0
  2. package/dist/bff/index.cjs +338 -0
  3. package/dist/bff/index.cjs.map +1 -0
  4. package/dist/bff/index.d.cts +2 -0
  5. package/dist/bff/index.d.ts +2 -0
  6. package/dist/bff/index.js +316 -0
  7. package/dist/bff/index.js.map +1 -0
  8. package/dist/client/nextjs.cjs +250 -0
  9. package/dist/client/nextjs.cjs.map +1 -0
  10. package/dist/client/nextjs.d.cts +868 -0
  11. package/dist/client/nextjs.d.ts +868 -0
  12. package/dist/client/nextjs.js +230 -0
  13. package/dist/client/nextjs.js.map +1 -0
  14. package/dist/client/sveltekit.cjs +237 -0
  15. package/dist/client/sveltekit.cjs.map +1 -0
  16. package/dist/client/sveltekit.d.cts +844 -0
  17. package/dist/client/sveltekit.d.ts +844 -0
  18. package/dist/client/sveltekit.js +217 -0
  19. package/dist/client/sveltekit.js.map +1 -0
  20. package/dist/index-DYW73KK3.d.cts +58 -0
  21. package/dist/index-DYW73KK3.d.ts +58 -0
  22. package/dist/index.cjs +502 -553
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.cts +3266 -1897
  25. package/dist/index.d.ts +3266 -1897
  26. package/dist/index.js +488 -535
  27. package/dist/index.js.map +1 -1
  28. package/dist/lib/schema.cjs +118 -0
  29. package/dist/lib/schema.cjs.map +1 -0
  30. package/dist/lib/schema.d.cts +3 -0
  31. package/dist/lib/schema.d.ts +3 -0
  32. package/dist/lib/schema.js +87 -0
  33. package/dist/lib/schema.js.map +1 -0
  34. package/dist/schema-ph9L8QMm.d.cts +674 -0
  35. package/dist/schema-ph9L8QMm.d.ts +674 -0
  36. package/dist/server/express.cjs +243 -0
  37. package/dist/server/express.cjs.map +1 -0
  38. package/dist/server/express.d.cts +85 -0
  39. package/dist/server/express.d.ts +85 -0
  40. package/dist/server/express.js +219 -0
  41. package/dist/server/express.js.map +1 -0
  42. package/dist/types-BHiK1JUX.d.cts +32 -0
  43. package/dist/types-GOn9sn7-.d.ts +32 -0
  44. package/package.json +45 -10
@@ -0,0 +1,868 @@
1
+ import * as nanostores from 'nanostores';
2
+ import * as _better_fetch_fetch from '@better-fetch/fetch';
3
+ import * as better_auth from 'better-auth';
4
+ import { S as SessionResult, a as SessionData, d as db } from '../types-GOn9sn7-.js';
5
+ export { U as UserInfo } from '../types-GOn9sn7-.js';
6
+ import '@libsql/client';
7
+ import 'drizzle-orm/libsql';
8
+ import '../schema-ph9L8QMm.js';
9
+ import 'drizzle-orm';
10
+ import 'drizzle-orm/sqlite-core';
11
+
12
+ /**
13
+ * Client-side Auth instance.
14
+ * @remarks
15
+ * This export might not be usable in Next.js Client Components directly if this file
16
+ * also imports server-only modules (like next/headers).
17
+ * Consider creating a separate client-only file if separation is needed.
18
+ */
19
+ declare const client: {
20
+ /**
21
+ * Alias for signIn.
22
+ */
23
+ login: {
24
+ social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
25
+ 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" | "vercel" | (string & {});
26
+ callbackURL?: string | undefined;
27
+ newUserCallbackURL?: string | undefined;
28
+ errorCallbackURL?: string | undefined;
29
+ disableRedirect?: boolean | undefined;
30
+ idToken?: {
31
+ token: string;
32
+ nonce?: string | undefined;
33
+ accessToken?: string | undefined;
34
+ refreshToken?: string | undefined;
35
+ expiresAt?: number | undefined;
36
+ } | undefined;
37
+ scopes?: string[] | undefined;
38
+ requestSignUp?: boolean | undefined;
39
+ loginHint?: string | undefined;
40
+ additionalData?: Record<string, any> | undefined;
41
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
42
+ 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" | "vercel" | (string & {});
43
+ callbackURL?: string | undefined;
44
+ newUserCallbackURL?: string | undefined;
45
+ errorCallbackURL?: string | undefined;
46
+ disableRedirect?: boolean | undefined;
47
+ idToken?: {
48
+ token: string;
49
+ nonce?: string | undefined;
50
+ accessToken?: string | undefined;
51
+ refreshToken?: string | undefined;
52
+ expiresAt?: number | undefined;
53
+ } | undefined;
54
+ scopes?: string[] | undefined;
55
+ requestSignUp?: boolean | undefined;
56
+ loginHint?: string | undefined;
57
+ additionalData?: Record<string, any> | undefined;
58
+ } & {
59
+ fetchOptions?: FetchOptions | undefined;
60
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<{
61
+ redirect: boolean;
62
+ url: string;
63
+ } | {
64
+ redirect: boolean;
65
+ token: string;
66
+ url: undefined;
67
+ user: {
68
+ id: string;
69
+ createdAt: Date;
70
+ updatedAt: Date;
71
+ email: string;
72
+ emailVerified: boolean;
73
+ name: string;
74
+ image?: string | null | undefined | undefined;
75
+ };
76
+ }>, {
77
+ code?: string | undefined;
78
+ message?: string | undefined;
79
+ }, FetchOptions["throw"] extends true ? true : false>>;
80
+ } & {
81
+ email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
82
+ email: string;
83
+ password: string;
84
+ callbackURL?: string | undefined;
85
+ rememberMe?: boolean | undefined;
86
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
87
+ email: string;
88
+ password: string;
89
+ callbackURL?: string | undefined;
90
+ rememberMe?: boolean | undefined;
91
+ } & {
92
+ fetchOptions?: FetchOptions | undefined;
93
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
94
+ redirect: boolean;
95
+ token: string;
96
+ url?: string | undefined;
97
+ user: {
98
+ id: string;
99
+ createdAt: Date;
100
+ updatedAt: Date;
101
+ email: string;
102
+ emailVerified: boolean;
103
+ name: string;
104
+ image?: string | null | undefined | undefined;
105
+ };
106
+ }, {
107
+ code?: string | undefined;
108
+ message?: string | undefined;
109
+ }, FetchOptions["throw"] extends true ? true : false>>;
110
+ };
111
+ signIn: {
112
+ social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
113
+ 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" | "vercel" | (string & {});
114
+ callbackURL?: string | undefined;
115
+ newUserCallbackURL?: string | undefined;
116
+ errorCallbackURL?: string | undefined;
117
+ disableRedirect?: boolean | undefined;
118
+ idToken?: {
119
+ token: string;
120
+ nonce?: string | undefined;
121
+ accessToken?: string | undefined;
122
+ refreshToken?: string | undefined;
123
+ expiresAt?: number | undefined;
124
+ } | undefined;
125
+ scopes?: string[] | undefined;
126
+ requestSignUp?: boolean | undefined;
127
+ loginHint?: string | undefined;
128
+ additionalData?: Record<string, any> | undefined;
129
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
130
+ 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" | "vercel" | (string & {});
131
+ callbackURL?: string | undefined;
132
+ newUserCallbackURL?: string | undefined;
133
+ errorCallbackURL?: string | undefined;
134
+ disableRedirect?: boolean | undefined;
135
+ idToken?: {
136
+ token: string;
137
+ nonce?: string | undefined;
138
+ accessToken?: string | undefined;
139
+ refreshToken?: string | undefined;
140
+ expiresAt?: number | undefined;
141
+ } | undefined;
142
+ scopes?: string[] | undefined;
143
+ requestSignUp?: boolean | undefined;
144
+ loginHint?: string | undefined;
145
+ additionalData?: Record<string, any> | undefined;
146
+ } & {
147
+ fetchOptions?: FetchOptions | undefined;
148
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<{
149
+ redirect: boolean;
150
+ url: string;
151
+ } | {
152
+ redirect: boolean;
153
+ token: string;
154
+ url: undefined;
155
+ user: {
156
+ id: string;
157
+ createdAt: Date;
158
+ updatedAt: Date;
159
+ email: string;
160
+ emailVerified: boolean;
161
+ name: string;
162
+ image?: string | null | undefined | undefined;
163
+ };
164
+ }>, {
165
+ code?: string | undefined;
166
+ message?: string | undefined;
167
+ }, FetchOptions["throw"] extends true ? true : false>>;
168
+ } & {
169
+ email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
170
+ email: string;
171
+ password: string;
172
+ callbackURL?: string | undefined;
173
+ rememberMe?: boolean | undefined;
174
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
175
+ email: string;
176
+ password: string;
177
+ callbackURL?: string | undefined;
178
+ rememberMe?: boolean | undefined;
179
+ } & {
180
+ fetchOptions?: FetchOptions | undefined;
181
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
182
+ redirect: boolean;
183
+ token: string;
184
+ url?: string | undefined;
185
+ user: {
186
+ id: string;
187
+ createdAt: Date;
188
+ updatedAt: Date;
189
+ email: string;
190
+ emailVerified: boolean;
191
+ name: string;
192
+ image?: string | null | undefined | undefined;
193
+ };
194
+ }, {
195
+ code?: string | undefined;
196
+ message?: string | undefined;
197
+ }, FetchOptions["throw"] extends true ? true : false>>;
198
+ };
199
+ signOut: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
200
+ query?: Record<string, any> | undefined;
201
+ fetchOptions?: FetchOptions | undefined;
202
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
203
+ success: boolean;
204
+ }, {
205
+ code?: string | undefined;
206
+ message?: string | undefined;
207
+ }, FetchOptions["throw"] extends true ? true : false>>;
208
+ signUp: {
209
+ email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
210
+ name: string;
211
+ email: string;
212
+ password: string;
213
+ image?: string | undefined;
214
+ callbackURL?: string | undefined;
215
+ rememberMe?: boolean | undefined;
216
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
217
+ email: string;
218
+ name: string;
219
+ password: string;
220
+ image?: string | undefined;
221
+ callbackURL?: string | undefined;
222
+ fetchOptions?: FetchOptions | undefined;
223
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<{
224
+ token: null;
225
+ user: {
226
+ id: string;
227
+ createdAt: Date;
228
+ updatedAt: Date;
229
+ email: string;
230
+ emailVerified: boolean;
231
+ name: string;
232
+ image?: string | null | undefined | undefined;
233
+ };
234
+ } | {
235
+ token: string;
236
+ user: {
237
+ id: string;
238
+ createdAt: Date;
239
+ updatedAt: Date;
240
+ email: string;
241
+ emailVerified: boolean;
242
+ name: string;
243
+ image?: string | null | undefined | undefined;
244
+ };
245
+ }>, {
246
+ code?: string | undefined;
247
+ message?: string | undefined;
248
+ }, FetchOptions["throw"] extends true ? true : false>>;
249
+ };
250
+ resetPassword: (<FetchOptions extends better_auth.ClientFetchOption<Partial<{
251
+ newPassword: string;
252
+ token?: string | undefined;
253
+ }> & Record<string, any>, Partial<{
254
+ token?: string | undefined;
255
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
256
+ newPassword: string;
257
+ token?: string | undefined;
258
+ } & {
259
+ fetchOptions?: FetchOptions | undefined;
260
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
261
+ status: boolean;
262
+ }, {
263
+ code?: string | undefined;
264
+ message?: string | undefined;
265
+ }, FetchOptions["throw"] extends true ? true : false>>) & {
266
+ ":token": <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
267
+ callbackURL: string;
268
+ }> & Record<string, any>, {
269
+ token: string;
270
+ }>>(data_0: better_auth.Prettify<{
271
+ query: {
272
+ callbackURL: string;
273
+ };
274
+ fetchOptions?: FetchOptions | undefined;
275
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<never, {
276
+ code?: string | undefined;
277
+ message?: string | undefined;
278
+ }, FetchOptions["throw"] extends true ? true : false>>;
279
+ };
280
+ verifyEmail: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
281
+ token: string;
282
+ callbackURL?: string | undefined;
283
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
284
+ query: {
285
+ token: string;
286
+ callbackURL?: string | undefined;
287
+ };
288
+ fetchOptions?: FetchOptions | undefined;
289
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<void | {
290
+ status: boolean;
291
+ }>, {
292
+ code?: string | undefined;
293
+ message?: string | undefined;
294
+ }, FetchOptions["throw"] extends true ? true : false>>;
295
+ sendVerificationEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
296
+ email: string;
297
+ callbackURL?: string | undefined;
298
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
299
+ email: string;
300
+ callbackURL?: string | undefined;
301
+ } & {
302
+ fetchOptions?: FetchOptions | undefined;
303
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
304
+ status: boolean;
305
+ }, {
306
+ code?: string | undefined;
307
+ message?: string | undefined;
308
+ }, FetchOptions["throw"] extends true ? true : false>>;
309
+ changeEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
310
+ newEmail: string;
311
+ callbackURL?: string | undefined;
312
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
313
+ newEmail: string;
314
+ callbackURL?: string | undefined;
315
+ } & {
316
+ fetchOptions?: FetchOptions | undefined;
317
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
318
+ status: boolean;
319
+ }, {
320
+ code?: string | undefined;
321
+ message?: string | undefined;
322
+ }, FetchOptions["throw"] extends true ? true : false>>;
323
+ changePassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
324
+ newPassword: string;
325
+ currentPassword: string;
326
+ revokeOtherSessions?: boolean | undefined;
327
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
328
+ newPassword: string;
329
+ currentPassword: string;
330
+ revokeOtherSessions?: boolean | undefined;
331
+ } & {
332
+ fetchOptions?: FetchOptions | undefined;
333
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
334
+ token: string | null;
335
+ user: {
336
+ id: string;
337
+ email: string;
338
+ name: string;
339
+ image: string | null | undefined;
340
+ emailVerified: boolean;
341
+ createdAt: Date;
342
+ updatedAt: Date;
343
+ };
344
+ }, {
345
+ code?: string | undefined;
346
+ message?: string | undefined;
347
+ }, FetchOptions["throw"] extends true ? true : false>>;
348
+ updateUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<Partial<{}> & {
349
+ name?: string | undefined;
350
+ image?: string | undefined | null;
351
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
352
+ image?: (string | null) | undefined;
353
+ name?: string | undefined;
354
+ fetchOptions?: FetchOptions | undefined;
355
+ } & Partial<{}>> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
356
+ status: boolean;
357
+ }, {
358
+ code?: string | undefined;
359
+ message?: string | undefined;
360
+ }, FetchOptions["throw"] extends true ? true : false>>;
361
+ deleteUser: (<FetchOptions extends better_auth.ClientFetchOption<Partial<{
362
+ callbackURL?: string | undefined;
363
+ password?: string | undefined;
364
+ token?: string | undefined;
365
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
366
+ callbackURL?: string | undefined;
367
+ password?: string | undefined;
368
+ token?: string | undefined;
369
+ } & {
370
+ fetchOptions?: FetchOptions | undefined;
371
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
372
+ success: boolean;
373
+ message: string;
374
+ }, {
375
+ code?: string | undefined;
376
+ message?: string | undefined;
377
+ }, FetchOptions["throw"] extends true ? true : false>>) & {
378
+ callback: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
379
+ token: string;
380
+ callbackURL?: string | undefined;
381
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
382
+ query: {
383
+ token: string;
384
+ callbackURL?: string | undefined;
385
+ };
386
+ fetchOptions?: FetchOptions | undefined;
387
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
388
+ success: boolean;
389
+ message: string;
390
+ }, {
391
+ code?: string | undefined;
392
+ message?: string | undefined;
393
+ }, FetchOptions["throw"] extends true ? true : false>>;
394
+ };
395
+ requestPasswordReset: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
396
+ email: string;
397
+ redirectTo?: string | undefined;
398
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
399
+ email: string;
400
+ redirectTo?: string | undefined;
401
+ } & {
402
+ fetchOptions?: FetchOptions | undefined;
403
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
404
+ status: boolean;
405
+ message: string;
406
+ }, {
407
+ code?: string | undefined;
408
+ message?: string | undefined;
409
+ }, FetchOptions["throw"] extends true ? true : false>>;
410
+ listSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
411
+ query?: Record<string, any> | undefined;
412
+ fetchOptions?: FetchOptions | undefined;
413
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<better_auth.Prettify<{
414
+ id: string;
415
+ createdAt: Date;
416
+ updatedAt: Date;
417
+ userId: string;
418
+ expiresAt: Date;
419
+ token: string;
420
+ ipAddress?: string | null | undefined | undefined;
421
+ userAgent?: string | null | undefined | undefined;
422
+ }>[], {
423
+ code?: string | undefined;
424
+ message?: string | undefined;
425
+ }, FetchOptions["throw"] extends true ? true : false>>;
426
+ revokeSession: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
427
+ token: string;
428
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
429
+ token: string;
430
+ } & {
431
+ fetchOptions?: FetchOptions | undefined;
432
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
433
+ status: boolean;
434
+ }, {
435
+ code?: string | undefined;
436
+ message?: string | undefined;
437
+ }, FetchOptions["throw"] extends true ? true : false>>;
438
+ revokeSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
439
+ query?: Record<string, any> | undefined;
440
+ fetchOptions?: FetchOptions | undefined;
441
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
442
+ status: boolean;
443
+ }, {
444
+ code?: string | undefined;
445
+ message?: string | undefined;
446
+ }, FetchOptions["throw"] extends true ? true : false>>;
447
+ revokeOtherSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
448
+ query?: Record<string, any> | undefined;
449
+ fetchOptions?: FetchOptions | undefined;
450
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
451
+ status: boolean;
452
+ }, {
453
+ code?: string | undefined;
454
+ message?: string | undefined;
455
+ }, FetchOptions["throw"] extends true ? true : false>>;
456
+ linkSocial: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
457
+ provider: unknown;
458
+ callbackURL?: string | undefined;
459
+ idToken?: {
460
+ token: string;
461
+ nonce?: string | undefined;
462
+ accessToken?: string | undefined;
463
+ refreshToken?: string | undefined;
464
+ scopes?: string[] | undefined;
465
+ } | undefined;
466
+ requestSignUp?: boolean | undefined;
467
+ scopes?: string[] | undefined;
468
+ errorCallbackURL?: string | undefined;
469
+ disableRedirect?: boolean | undefined;
470
+ additionalData?: Record<string, any> | undefined;
471
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
472
+ provider: unknown;
473
+ callbackURL?: string | undefined;
474
+ idToken?: {
475
+ token: string;
476
+ nonce?: string | undefined;
477
+ accessToken?: string | undefined;
478
+ refreshToken?: string | undefined;
479
+ scopes?: string[] | undefined;
480
+ } | undefined;
481
+ requestSignUp?: boolean | undefined;
482
+ scopes?: string[] | undefined;
483
+ errorCallbackURL?: string | undefined;
484
+ disableRedirect?: boolean | undefined;
485
+ additionalData?: Record<string, any> | undefined;
486
+ } & {
487
+ fetchOptions?: FetchOptions | undefined;
488
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
489
+ url: string;
490
+ redirect: boolean;
491
+ }, {
492
+ code?: string | undefined;
493
+ message?: string | undefined;
494
+ }, FetchOptions["throw"] extends true ? true : false>>;
495
+ listAccounts: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
496
+ query?: Record<string, any> | undefined;
497
+ fetchOptions?: FetchOptions | undefined;
498
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
499
+ id: string;
500
+ providerId: string;
501
+ createdAt: Date;
502
+ updatedAt: Date;
503
+ accountId: string;
504
+ userId: string;
505
+ scopes: string[];
506
+ }[], {
507
+ code?: string | undefined;
508
+ message?: string | undefined;
509
+ }, FetchOptions["throw"] extends true ? true : false>>;
510
+ unlinkAccount: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
511
+ providerId: string;
512
+ accountId?: string | undefined;
513
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
514
+ providerId: string;
515
+ accountId?: string | undefined;
516
+ } & {
517
+ fetchOptions?: FetchOptions | undefined;
518
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
519
+ status: boolean;
520
+ }, {
521
+ code?: string | undefined;
522
+ message?: string | undefined;
523
+ }, FetchOptions["throw"] extends true ? true : false>>;
524
+ refreshToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
525
+ providerId: string;
526
+ accountId?: string | undefined;
527
+ userId?: string | undefined;
528
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
529
+ providerId: string;
530
+ accountId?: string | undefined;
531
+ userId?: string | undefined;
532
+ } & {
533
+ fetchOptions?: FetchOptions | undefined;
534
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
535
+ accessToken: string | undefined;
536
+ refreshToken: string | undefined;
537
+ accessTokenExpiresAt: Date | undefined;
538
+ refreshTokenExpiresAt: Date | undefined;
539
+ scope: string | null | undefined;
540
+ idToken: string | null | undefined;
541
+ providerId: string;
542
+ accountId: string;
543
+ }, {
544
+ code?: string | undefined;
545
+ message?: string | undefined;
546
+ }, FetchOptions["throw"] extends true ? true : false>>;
547
+ getAccessToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
548
+ providerId: string;
549
+ accountId?: string | undefined;
550
+ userId?: string | undefined;
551
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
552
+ providerId: string;
553
+ accountId?: string | undefined;
554
+ userId?: string | undefined;
555
+ } & {
556
+ fetchOptions?: FetchOptions | undefined;
557
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
558
+ accessToken: string;
559
+ accessTokenExpiresAt: Date | undefined;
560
+ scopes: string[];
561
+ idToken: string | undefined;
562
+ }, {
563
+ code?: string | undefined;
564
+ message?: string | undefined;
565
+ }, FetchOptions["throw"] extends true ? true : false>>;
566
+ accountInfo: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
567
+ accountId?: string | undefined;
568
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
569
+ query?: {
570
+ accountId?: string | undefined;
571
+ } | undefined;
572
+ fetchOptions?: FetchOptions | undefined;
573
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
574
+ user: better_auth.OAuth2UserInfo;
575
+ data: Record<string, any>;
576
+ }, {
577
+ code?: string | undefined;
578
+ message?: string | undefined;
579
+ }, FetchOptions["throw"] extends true ? true : false>>;
580
+ getSession: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
581
+ disableCookieCache?: unknown;
582
+ disableRefresh?: unknown;
583
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
584
+ query?: {
585
+ disableCookieCache?: unknown;
586
+ disableRefresh?: unknown;
587
+ } | undefined;
588
+ fetchOptions?: FetchOptions | undefined;
589
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
590
+ user: {
591
+ id: string;
592
+ createdAt: Date;
593
+ updatedAt: Date;
594
+ email: string;
595
+ emailVerified: boolean;
596
+ name: string;
597
+ image?: string | null | undefined;
598
+ };
599
+ session: {
600
+ id: string;
601
+ createdAt: Date;
602
+ updatedAt: Date;
603
+ userId: string;
604
+ expiresAt: Date;
605
+ token: string;
606
+ ipAddress?: string | null | undefined;
607
+ userAgent?: string | null | undefined;
608
+ };
609
+ } | null, {
610
+ code?: string | undefined;
611
+ message?: string | undefined;
612
+ }, FetchOptions["throw"] extends true ? true : false>>;
613
+ useSession: () => {
614
+ data: {
615
+ user: {
616
+ id: string;
617
+ createdAt: Date;
618
+ updatedAt: Date;
619
+ email: string;
620
+ emailVerified: boolean;
621
+ name: string;
622
+ image?: string | null | undefined;
623
+ };
624
+ session: {
625
+ id: string;
626
+ createdAt: Date;
627
+ updatedAt: Date;
628
+ userId: string;
629
+ expiresAt: Date;
630
+ token: string;
631
+ ipAddress?: string | null | undefined;
632
+ userAgent?: string | null | undefined;
633
+ };
634
+ } | null;
635
+ isPending: boolean;
636
+ isRefetching: boolean;
637
+ error: _better_fetch_fetch.BetterFetchError | null;
638
+ refetch: (queryParams?: {
639
+ query?: better_auth.SessionQueryParams;
640
+ } | undefined) => Promise<void>;
641
+ };
642
+ $Infer: {
643
+ Session: {
644
+ user: {
645
+ id: string;
646
+ createdAt: Date;
647
+ updatedAt: Date;
648
+ email: string;
649
+ emailVerified: boolean;
650
+ name: string;
651
+ image?: string | null | undefined;
652
+ };
653
+ session: {
654
+ id: string;
655
+ createdAt: Date;
656
+ updatedAt: Date;
657
+ userId: string;
658
+ expiresAt: Date;
659
+ token: string;
660
+ ipAddress?: string | null | undefined;
661
+ userAgent?: string | null | undefined;
662
+ };
663
+ };
664
+ };
665
+ $fetch: _better_fetch_fetch.BetterFetch<{
666
+ plugins: (_better_fetch_fetch.BetterFetchPlugin<Record<string, any>> | {
667
+ id: string;
668
+ name: string;
669
+ hooks: {
670
+ onSuccess(context: _better_fetch_fetch.SuccessContext<any>): void;
671
+ };
672
+ } | {
673
+ id: string;
674
+ name: string;
675
+ hooks: {
676
+ onSuccess: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
677
+ onError: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
678
+ onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
679
+ onResponse: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
680
+ };
681
+ })[];
682
+ cache?: RequestCache | undefined;
683
+ method: string;
684
+ window?: null | undefined;
685
+ headers?: (HeadersInit & (HeadersInit | {
686
+ accept: "application/json" | "text/plain" | "application/octet-stream";
687
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
688
+ authorization: "Bearer" | "Basic";
689
+ })) | undefined;
690
+ redirect?: RequestRedirect | undefined;
691
+ credentials?: RequestCredentials;
692
+ integrity?: string | undefined;
693
+ keepalive?: boolean | undefined;
694
+ mode?: RequestMode | undefined;
695
+ priority?: RequestPriority | undefined;
696
+ referrer?: string | undefined;
697
+ referrerPolicy?: ReferrerPolicy | undefined;
698
+ signal?: (AbortSignal | null) | undefined;
699
+ onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
700
+ hookOptions?: {
701
+ cloneResponse?: boolean;
702
+ } | undefined;
703
+ timeout?: number | undefined;
704
+ customFetchImpl: _better_fetch_fetch.FetchEsque;
705
+ baseURL: string;
706
+ throw?: boolean | undefined;
707
+ auth?: ({
708
+ type: "Bearer";
709
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
710
+ } | {
711
+ type: "Basic";
712
+ username: string | (() => string | undefined) | undefined;
713
+ password: string | (() => string | undefined) | undefined;
714
+ } | {
715
+ type: "Custom";
716
+ prefix: string | (() => string | undefined) | undefined;
717
+ value: string | (() => string | undefined) | undefined;
718
+ }) | undefined;
719
+ body?: any;
720
+ query?: any;
721
+ params?: any;
722
+ duplex?: "full" | "half" | undefined;
723
+ jsonParser: (text: string) => Promise<any> | any;
724
+ retry?: _better_fetch_fetch.RetryOptions | undefined;
725
+ retryAttempt?: number | undefined;
726
+ output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
727
+ errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
728
+ disableValidation?: boolean | undefined;
729
+ disableSignal?: boolean | undefined;
730
+ }, unknown, unknown, {}>;
731
+ $store: {
732
+ notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
733
+ listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
734
+ atoms: Record<string, nanostores.WritableAtom<any>>;
735
+ };
736
+ $ERROR_CODES: {
737
+ readonly USER_NOT_FOUND: "User not found";
738
+ readonly FAILED_TO_CREATE_USER: "Failed to create user";
739
+ readonly FAILED_TO_CREATE_SESSION: "Failed to create session";
740
+ readonly FAILED_TO_UPDATE_USER: "Failed to update user";
741
+ readonly FAILED_TO_GET_SESSION: "Failed to get session";
742
+ readonly INVALID_PASSWORD: "Invalid password";
743
+ readonly INVALID_EMAIL: "Invalid email";
744
+ readonly INVALID_EMAIL_OR_PASSWORD: "Invalid email or password";
745
+ readonly SOCIAL_ACCOUNT_ALREADY_LINKED: "Social account already linked";
746
+ readonly PROVIDER_NOT_FOUND: "Provider not found";
747
+ readonly INVALID_TOKEN: "Invalid token";
748
+ readonly ID_TOKEN_NOT_SUPPORTED: "id_token not supported";
749
+ readonly FAILED_TO_GET_USER_INFO: "Failed to get user info";
750
+ readonly USER_EMAIL_NOT_FOUND: "User email not found";
751
+ readonly EMAIL_NOT_VERIFIED: "Email not verified";
752
+ readonly PASSWORD_TOO_SHORT: "Password too short";
753
+ readonly PASSWORD_TOO_LONG: "Password too long";
754
+ readonly USER_ALREADY_EXISTS: "User already exists.";
755
+ readonly USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: "User already exists. Use another email.";
756
+ readonly EMAIL_CAN_NOT_BE_UPDATED: "Email can not be updated";
757
+ readonly CREDENTIAL_ACCOUNT_NOT_FOUND: "Credential account not found";
758
+ readonly SESSION_EXPIRED: "Session expired. Re-authenticate to perform this action.";
759
+ readonly FAILED_TO_UNLINK_LAST_ACCOUNT: "You can't unlink your last account";
760
+ readonly ACCOUNT_NOT_FOUND: "Account not found";
761
+ readonly USER_ALREADY_HAS_PASSWORD: "User already has a password. Provide that to delete the account.";
762
+ readonly CROSS_SITE_NAVIGATION_LOGIN_BLOCKED: "Cross-site navigation login blocked. This request appears to be a CSRF attack.";
763
+ readonly VERIFICATION_EMAIL_NOT_ENABLED: "Verification email isn't enabled";
764
+ readonly EMAIL_ALREADY_VERIFIED: "Email is already verified";
765
+ readonly EMAIL_MISMATCH: "Email mismatch";
766
+ readonly SESSION_NOT_FRESH: "Session is not fresh";
767
+ readonly LINKED_ACCOUNT_ALREADY_EXISTS: "Linked account already exists";
768
+ readonly INVALID_ORIGIN: "Invalid origin";
769
+ readonly INVALID_CALLBACK_URL: "Invalid callbackURL";
770
+ readonly INVALID_REDIRECT_URL: "Invalid redirectURL";
771
+ readonly INVALID_ERROR_CALLBACK_URL: "Invalid errorCallbackURL";
772
+ readonly INVALID_NEW_USER_CALLBACK_URL: "Invalid newUserCallbackURL";
773
+ readonly MISSING_OR_NULL_ORIGIN: "Missing or null Origin";
774
+ readonly CALLBACK_URL_REQUIRED: "callbackURL is required";
775
+ readonly FAILED_TO_CREATE_VERIFICATION: "Unable to create verification";
776
+ readonly FIELD_NOT_ALLOWED: "Field not allowed to be set";
777
+ readonly ASYNC_VALIDATION_NOT_SUPPORTED: "Async validation is not supported";
778
+ readonly VALIDATION_ERROR: "Validation Error";
779
+ readonly MISSING_FIELD: "Field is required";
780
+ };
781
+ };
782
+ /**
783
+ * Next.js Server Auth instance (App Router).
784
+ */
785
+ declare const server: {
786
+ /**
787
+ * The underlying BetterAuth instance.
788
+ */
789
+ auth: better_auth.Auth<{
790
+ database: (options: better_auth.BetterAuthOptions) => better_auth.DBAdapter<better_auth.BetterAuthOptions>;
791
+ baseURL: string | undefined;
792
+ secret: string | undefined;
793
+ trustedOrigins: string[] | undefined;
794
+ socialProviders: {
795
+ google: {
796
+ clientId: string;
797
+ clientSecret: string;
798
+ };
799
+ };
800
+ session: {
801
+ expiresIn: number;
802
+ updateAge: number;
803
+ cookieCache: {
804
+ enabled: true;
805
+ maxAge: number;
806
+ };
807
+ };
808
+ }>;
809
+ /**
810
+ * Next.js route handler for auth routes.
811
+ * Place this in `app/api/auth/[...auth]/route.ts`
812
+ */
813
+ handler: {
814
+ GET: {
815
+ GET: (request: Request) => Promise<Response>;
816
+ POST: (request: Request) => Promise<Response>;
817
+ PATCH: (request: Request) => Promise<Response>;
818
+ PUT: (request: Request) => Promise<Response>;
819
+ DELETE: (request: Request) => Promise<Response>;
820
+ };
821
+ POST: {
822
+ GET: (request: Request) => Promise<Response>;
823
+ POST: (request: Request) => Promise<Response>;
824
+ PATCH: (request: Request) => Promise<Response>;
825
+ PUT: (request: Request) => Promise<Response>;
826
+ DELETE: (request: Request) => Promise<Response>;
827
+ };
828
+ };
829
+ /**
830
+ * Get session from current request headers.
831
+ * Use in Server Components or Route Handlers.
832
+ */
833
+ getSession: () => Promise<SessionResult>;
834
+ /**
835
+ * Get session from specific headers.
836
+ * Use when you have direct access to headers.
837
+ */
838
+ getSessionFromHeaders: (requestHeaders: Headers) => Promise<SessionResult>;
839
+ /**
840
+ * Check if user is authenticated.
841
+ * Use in Server Components.
842
+ */
843
+ isAuthenticated: () => Promise<boolean>;
844
+ /**
845
+ * Get the current user or null.
846
+ * Convenience method for Server Components.
847
+ */
848
+ getUser: () => Promise<{
849
+ id: string;
850
+ createdAt: Date;
851
+ updatedAt: Date;
852
+ email: string;
853
+ emailVerified: boolean;
854
+ name: string;
855
+ image?: string | null | undefined | undefined;
856
+ } | null>;
857
+ /**
858
+ * Wraps a function to ensure the user is authenticated before execution.
859
+ * Injects the user, session, and db into the first argument.
860
+ */
861
+ makeAuthenticatedCall: <TArgs extends any[], TReturn>(fn: (ctx: {
862
+ user: SessionData["user"];
863
+ session: SessionData["session"];
864
+ db: typeof db;
865
+ }, ...args: TArgs) => Promise<TReturn>) => (...args: TArgs) => Promise<TReturn>;
866
+ };
867
+
868
+ export { SessionData, SessionResult, client, server };