hylekit 1.0.2 → 1.0.4

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 (54) hide show
  1. package/README.md +126 -59
  2. package/dist/bff/index.cjs +5 -139
  3. package/dist/bff/index.cjs.map +1 -1
  4. package/dist/bff/index.d.cts +2 -1
  5. package/dist/bff/index.d.ts +2 -1
  6. package/dist/bff/index.js +5 -145
  7. package/dist/bff/index.js.map +1 -1
  8. package/dist/client/index.cjs +58 -0
  9. package/dist/client/index.cjs.map +1 -0
  10. package/dist/client/index.d.cts +1530 -0
  11. package/dist/client/index.d.ts +1530 -0
  12. package/dist/client/index.js +31 -0
  13. package/dist/client/index.js.map +1 -0
  14. package/dist/client/nextjs.cjs +3 -214
  15. package/dist/client/nextjs.cjs.map +1 -1
  16. package/dist/client/nextjs.d.cts +4 -97
  17. package/dist/client/nextjs.d.ts +4 -97
  18. package/dist/client/nextjs.js +2 -218
  19. package/dist/client/nextjs.js.map +1 -1
  20. package/dist/client/sveltekit.cjs +3 -201
  21. package/dist/client/sveltekit.cjs.map +1 -1
  22. package/dist/client/sveltekit.d.cts +3 -72
  23. package/dist/client/sveltekit.d.ts +3 -72
  24. package/dist/client/sveltekit.js +2 -205
  25. package/dist/client/sveltekit.js.map +1 -1
  26. package/dist/{index-DYW73KK3.d.cts → index-B-5TEr94.d.cts} +28 -2
  27. package/dist/{index-DYW73KK3.d.ts → index-B-5TEr94.d.ts} +28 -2
  28. package/dist/index.cjs +276 -262
  29. package/dist/index.cjs.map +1 -1
  30. package/dist/index.d.cts +110 -3272
  31. package/dist/index.d.ts +110 -3272
  32. package/dist/index.js +270 -258
  33. package/dist/index.js.map +1 -1
  34. package/dist/server/express.cjs +71 -80
  35. package/dist/server/express.cjs.map +1 -1
  36. package/dist/server/express.d.cts +18 -6
  37. package/dist/server/express.d.ts +18 -6
  38. package/dist/server/express.js +70 -86
  39. package/dist/server/express.js.map +1 -1
  40. package/dist/server/nextjs.cjs +107 -0
  41. package/dist/server/nextjs.cjs.map +1 -0
  42. package/dist/server/nextjs.d.cts +90 -0
  43. package/dist/server/nextjs.d.ts +90 -0
  44. package/dist/server/nextjs.js +82 -0
  45. package/dist/server/nextjs.js.map +1 -0
  46. package/dist/server/sveltekit.cjs +94 -0
  47. package/dist/server/sveltekit.cjs.map +1 -0
  48. package/dist/server/sveltekit.d.cts +68 -0
  49. package/dist/server/sveltekit.d.ts +68 -0
  50. package/dist/server/sveltekit.js +69 -0
  51. package/dist/server/sveltekit.js.map +1 -0
  52. package/dist/{types-GOn9sn7-.d.ts → types-Wucl0qmN.d.cts} +1 -8
  53. package/dist/{types-BHiK1JUX.d.cts → types-Wucl0qmN.d.ts} +1 -8
  54. package/package.json +24 -7
package/dist/index.d.cts CHANGED
@@ -1,3319 +1,157 @@
1
- import * as _sveltejs_kit from '@sveltejs/kit';
2
1
  import * as express from 'express';
3
- import * as nanostores from 'nanostores';
4
- import * as _better_fetch_fetch from '@better-fetch/fetch';
5
2
  import * as _libsql_client from '@libsql/client';
6
3
  import * as drizzle_orm_libsql from 'drizzle-orm/libsql';
4
+ import { B as BffClientConfig, N as NextJsBffClient, S as SvelteKitBffClient } from './index-B-5TEr94.cjs';
5
+ export { R as RequestOptions, c as createNextJsBff, a as createSvelteKitBff } from './index-B-5TEr94.cjs';
7
6
  import * as better_auth from 'better-auth';
8
7
  export { Session, User } from 'better-auth';
9
- import { B as BffClientConfig, N as NextJsBffClient, S as SvelteKitBffClient } from './index-DYW73KK3.cjs';
10
- export { R as RequestOptions, c as createNextJsBff, a as createSvelteKitBff } from './index-DYW73KK3.cjs';
11
- import { S as SessionResult, a as SessionData, d as db } from './types-BHiK1JUX.cjs';
12
- export { U as UserInfo } from './types-BHiK1JUX.cjs';
13
8
  import { s as schema } from './schema-ph9L8QMm.cjs';
14
9
  export { b as account, a as session, u as user, v as verification } from './schema-ph9L8QMm.cjs';
10
+ import { createSvelteKitServer } from './server/sveltekit.cjs';
11
+ import { createNextJsServer } from './server/nextjs.cjs';
15
12
  import { MiddlewareOptions, isAuthenticated, getAuthContext } from './server/express.cjs';
16
- export { AuthenticatedRequest, default as express, middleware as expressMiddleware } from './server/express.cjs';
13
+ export { AuthenticatedRequest, createExpressMiddleware, default as express, middleware as expressMiddleware } from './server/express.cjs';
14
+ export { a as SessionData, S as SessionResult, U as UserInfo } from './types-Wucl0qmN.cjs';
15
+ import '@sveltejs/kit';
17
16
  import 'drizzle-orm';
18
17
  import 'drizzle-orm/sqlite-core';
19
18
 
20
- declare const auth: better_auth.Auth<{
19
+ /**
20
+ * Configuration for Hyle authentication.
21
+ */
22
+ interface HyleAuthConfig {
23
+ /** Base URL for the auth server (e.g., "https://myapp.com") */
24
+ baseURL: string;
25
+ /** Secret key for signing sessions and tokens */
26
+ secret: string;
27
+ /** List of trusted origins for CORS (optional) */
28
+ trustedOrigins?: string[];
29
+ /** Google OAuth configuration (optional) */
30
+ google?: {
31
+ clientId: string;
32
+ clientSecret: string;
33
+ };
34
+ /** Session configuration (optional, uses sensible defaults) */
35
+ session?: {
36
+ /** Session expiry in seconds (default: 7 days) */
37
+ expiresIn?: number;
38
+ /** Session update interval in seconds (default: 24 hours) */
39
+ updateAge?: number;
40
+ /** Cookie cache settings */
41
+ cookieCache?: {
42
+ enabled?: boolean;
43
+ maxAge?: number;
44
+ };
45
+ };
46
+ }
47
+ type HyleDb = ReturnType<typeof drizzle_orm_libsql.drizzle<typeof schema>>;
48
+ /**
49
+ * Creates a BetterAuth instance with the provided configuration.
50
+ *
51
+ * @param db - Database instance created by createDb()
52
+ * @param config - Authentication configuration
53
+ * @returns A BetterAuth instance
54
+ *
55
+ * @example
56
+ * ```typescript
57
+ * // In your server-side code (e.g., lib/auth.ts)
58
+ * import { createDb, createAuth } from "hylekit";
59
+ *
60
+ * const db = createDb({
61
+ * url: process.env.HYLE_DATABASE_URL!,
62
+ * authToken: process.env.HYLE_DATABASE_AUTH_TOKEN,
63
+ * });
64
+ *
65
+ * export const auth = createAuth(db, {
66
+ * baseURL: process.env.BETTER_AUTH_URL!,
67
+ * secret: process.env.BETTER_AUTH_SECRET!,
68
+ * google: {
69
+ * clientId: process.env.GOOGLE_CLIENT_ID!,
70
+ * clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
71
+ * },
72
+ * });
73
+ * ```
74
+ *
75
+ * @throws Error if called on the client side
76
+ */
77
+ declare function createAuth(db: HyleDb, config: HyleAuthConfig): better_auth.Auth<{
21
78
  database: (options: better_auth.BetterAuthOptions) => better_auth.DBAdapter<better_auth.BetterAuthOptions>;
22
- baseURL: string | undefined;
23
- secret: string | undefined;
79
+ baseURL: string;
80
+ secret: string;
24
81
  trustedOrigins: string[] | undefined;
25
82
  socialProviders: {
26
83
  google: {
27
84
  clientId: string;
28
85
  clientSecret: string;
29
86
  };
30
- };
87
+ } | undefined;
31
88
  session: {
32
89
  expiresIn: number;
33
90
  updateAge: number;
34
91
  cookieCache: {
35
- enabled: true;
92
+ enabled: boolean;
36
93
  maxAge: number;
37
94
  };
38
95
  };
39
96
  }>;
40
97
 
41
- declare const client: {
42
- sveltekit: {
43
- login: {
44
- social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
45
- 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 & {});
46
- callbackURL?: string | undefined;
47
- newUserCallbackURL?: string | undefined;
48
- errorCallbackURL?: string | undefined;
49
- disableRedirect?: boolean | undefined;
50
- idToken?: {
51
- token: string;
52
- nonce?: string | undefined;
53
- accessToken?: string | undefined;
54
- refreshToken?: string | undefined;
55
- expiresAt?: number | undefined;
56
- } | undefined;
57
- scopes?: string[] | undefined;
58
- requestSignUp?: boolean | undefined;
59
- loginHint?: string | undefined;
60
- additionalData?: Record<string, any> | undefined;
61
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
62
- 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 & {});
63
- callbackURL?: string | undefined;
64
- newUserCallbackURL?: string | undefined;
65
- errorCallbackURL?: string | undefined;
66
- disableRedirect?: boolean | undefined;
67
- idToken?: {
68
- token: string;
69
- nonce?: string | undefined;
70
- accessToken?: string | undefined;
71
- refreshToken?: string | undefined;
72
- expiresAt?: number | undefined;
73
- } | undefined;
74
- scopes?: string[] | undefined;
75
- requestSignUp?: boolean | undefined;
76
- loginHint?: string | undefined;
77
- additionalData?: Record<string, any> | undefined;
78
- } & {
79
- fetchOptions?: FetchOptions | undefined;
80
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<{
81
- redirect: boolean;
82
- url: string;
83
- } | {
84
- redirect: boolean;
85
- token: string;
86
- url: undefined;
87
- user: {
88
- id: string;
89
- createdAt: Date;
90
- updatedAt: Date;
91
- email: string;
92
- emailVerified: boolean;
93
- name: string;
94
- image?: string | null | undefined | undefined;
95
- };
96
- }>, {
97
- code?: string | undefined;
98
- message?: string | undefined;
99
- }, FetchOptions["throw"] extends true ? true : false>>;
100
- } & {
101
- email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
102
- email: string;
103
- password: string;
104
- callbackURL?: string | undefined;
105
- rememberMe?: boolean | undefined;
106
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
107
- email: string;
108
- password: string;
109
- callbackURL?: string | undefined;
110
- rememberMe?: boolean | undefined;
111
- } & {
112
- fetchOptions?: FetchOptions | undefined;
113
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
114
- redirect: boolean;
115
- token: string;
116
- url?: string | undefined;
117
- user: {
118
- id: string;
119
- createdAt: Date;
120
- updatedAt: Date;
121
- email: string;
122
- emailVerified: boolean;
123
- name: string;
124
- image?: string | null | undefined | undefined;
125
- };
126
- }, {
127
- code?: string | undefined;
128
- message?: string | undefined;
129
- }, FetchOptions["throw"] extends true ? true : false>>;
130
- };
131
- signIn: {
132
- social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
133
- 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 & {});
134
- callbackURL?: string | undefined;
135
- newUserCallbackURL?: string | undefined;
136
- errorCallbackURL?: string | undefined;
137
- disableRedirect?: boolean | undefined;
138
- idToken?: {
139
- token: string;
140
- nonce?: string | undefined;
141
- accessToken?: string | undefined;
142
- refreshToken?: string | undefined;
143
- expiresAt?: number | undefined;
144
- } | undefined;
145
- scopes?: string[] | undefined;
146
- requestSignUp?: boolean | undefined;
147
- loginHint?: string | undefined;
148
- additionalData?: Record<string, any> | undefined;
149
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
150
- 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 & {});
151
- callbackURL?: string | undefined;
152
- newUserCallbackURL?: string | undefined;
153
- errorCallbackURL?: string | undefined;
154
- disableRedirect?: boolean | undefined;
155
- idToken?: {
156
- token: string;
157
- nonce?: string | undefined;
158
- accessToken?: string | undefined;
159
- refreshToken?: string | undefined;
160
- expiresAt?: number | undefined;
161
- } | undefined;
162
- scopes?: string[] | undefined;
163
- requestSignUp?: boolean | undefined;
164
- loginHint?: string | undefined;
165
- additionalData?: Record<string, any> | undefined;
166
- } & {
167
- fetchOptions?: FetchOptions | undefined;
168
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<{
169
- redirect: boolean;
170
- url: string;
171
- } | {
172
- redirect: boolean;
173
- token: string;
174
- url: undefined;
175
- user: {
176
- id: string;
177
- createdAt: Date;
178
- updatedAt: Date;
179
- email: string;
180
- emailVerified: boolean;
181
- name: string;
182
- image?: string | null | undefined | undefined;
183
- };
184
- }>, {
185
- code?: string | undefined;
186
- message?: string | undefined;
187
- }, FetchOptions["throw"] extends true ? true : false>>;
188
- } & {
189
- email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
190
- email: string;
191
- password: string;
192
- callbackURL?: string | undefined;
193
- rememberMe?: boolean | undefined;
194
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
195
- email: string;
196
- password: string;
197
- callbackURL?: string | undefined;
198
- rememberMe?: boolean | undefined;
199
- } & {
200
- fetchOptions?: FetchOptions | undefined;
201
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
202
- redirect: boolean;
203
- token: string;
204
- url?: string | undefined;
205
- user: {
206
- id: string;
207
- createdAt: Date;
208
- updatedAt: Date;
209
- email: string;
210
- emailVerified: boolean;
211
- name: string;
212
- image?: string | null | undefined | undefined;
213
- };
214
- }, {
215
- code?: string | undefined;
216
- message?: string | undefined;
217
- }, FetchOptions["throw"] extends true ? true : false>>;
218
- };
219
- signOut: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
220
- query?: Record<string, any> | undefined;
221
- fetchOptions?: FetchOptions | undefined;
222
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
223
- success: boolean;
224
- }, {
225
- code?: string | undefined;
226
- message?: string | undefined;
227
- }, FetchOptions["throw"] extends true ? true : false>>;
228
- signUp: {
229
- email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
230
- name: string;
231
- email: string;
232
- password: string;
233
- image?: string | undefined;
234
- callbackURL?: string | undefined;
235
- rememberMe?: boolean | undefined;
236
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
237
- email: string;
238
- name: string;
239
- password: string;
240
- image?: string | undefined;
241
- callbackURL?: string | undefined;
242
- fetchOptions?: FetchOptions | undefined;
243
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<{
244
- token: null;
245
- user: {
246
- id: string;
247
- createdAt: Date;
248
- updatedAt: Date;
249
- email: string;
250
- emailVerified: boolean;
251
- name: string;
252
- image?: string | null | undefined | undefined;
253
- };
254
- } | {
255
- token: string;
256
- user: {
257
- id: string;
258
- createdAt: Date;
259
- updatedAt: Date;
260
- email: string;
261
- emailVerified: boolean;
262
- name: string;
263
- image?: string | null | undefined | undefined;
264
- };
265
- }>, {
266
- code?: string | undefined;
267
- message?: string | undefined;
268
- }, FetchOptions["throw"] extends true ? true : false>>;
269
- };
270
- resetPassword: (<FetchOptions extends better_auth.ClientFetchOption<Partial<{
271
- newPassword: string;
272
- token?: string | undefined;
273
- }> & Record<string, any>, Partial<{
274
- token?: string | undefined;
275
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
276
- newPassword: string;
277
- token?: string | undefined;
278
- } & {
279
- fetchOptions?: FetchOptions | undefined;
280
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
281
- status: boolean;
282
- }, {
283
- code?: string | undefined;
284
- message?: string | undefined;
285
- }, FetchOptions["throw"] extends true ? true : false>>) & {
286
- ":token": <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
287
- callbackURL: string;
288
- }> & Record<string, any>, {
289
- token: string;
290
- }>>(data_0: better_auth.Prettify<{
291
- query: {
292
- callbackURL: string;
293
- };
294
- fetchOptions?: FetchOptions | undefined;
295
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<never, {
296
- code?: string | undefined;
297
- message?: string | undefined;
298
- }, FetchOptions["throw"] extends true ? true : false>>;
299
- };
300
- verifyEmail: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
301
- token: string;
302
- callbackURL?: string | undefined;
303
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
304
- query: {
305
- token: string;
306
- callbackURL?: string | undefined;
307
- };
308
- fetchOptions?: FetchOptions | undefined;
309
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<void | {
310
- status: boolean;
311
- }>, {
312
- code?: string | undefined;
313
- message?: string | undefined;
314
- }, FetchOptions["throw"] extends true ? true : false>>;
315
- sendVerificationEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
316
- email: string;
317
- callbackURL?: string | undefined;
318
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
319
- email: string;
320
- callbackURL?: string | undefined;
321
- } & {
322
- fetchOptions?: FetchOptions | undefined;
323
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
324
- status: boolean;
325
- }, {
326
- code?: string | undefined;
327
- message?: string | undefined;
328
- }, FetchOptions["throw"] extends true ? true : false>>;
329
- changeEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
330
- newEmail: string;
331
- callbackURL?: string | undefined;
332
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
333
- newEmail: string;
334
- callbackURL?: string | undefined;
335
- } & {
336
- fetchOptions?: FetchOptions | undefined;
337
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
338
- status: boolean;
339
- }, {
340
- code?: string | undefined;
341
- message?: string | undefined;
342
- }, FetchOptions["throw"] extends true ? true : false>>;
343
- changePassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
344
- newPassword: string;
345
- currentPassword: string;
346
- revokeOtherSessions?: boolean | undefined;
347
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
348
- newPassword: string;
349
- currentPassword: string;
350
- revokeOtherSessions?: boolean | undefined;
351
- } & {
352
- fetchOptions?: FetchOptions | undefined;
353
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
354
- token: string | null;
355
- user: {
356
- id: string;
357
- email: string;
358
- name: string;
359
- image: string | null | undefined;
360
- emailVerified: boolean;
361
- createdAt: Date;
362
- updatedAt: Date;
363
- };
364
- }, {
365
- code?: string | undefined;
366
- message?: string | undefined;
367
- }, FetchOptions["throw"] extends true ? true : false>>;
368
- updateUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<Partial<{}> & {
369
- name?: string | undefined;
370
- image?: string | undefined | null;
371
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
372
- image?: (string | null) | undefined;
373
- name?: string | undefined;
374
- fetchOptions?: FetchOptions | undefined;
375
- } & Partial<{}>> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
376
- status: boolean;
377
- }, {
378
- code?: string | undefined;
379
- message?: string | undefined;
380
- }, FetchOptions["throw"] extends true ? true : false>>;
381
- deleteUser: (<FetchOptions extends better_auth.ClientFetchOption<Partial<{
382
- callbackURL?: string | undefined;
383
- password?: string | undefined;
384
- token?: string | undefined;
385
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
386
- callbackURL?: string | undefined;
387
- password?: string | undefined;
388
- token?: string | undefined;
389
- } & {
390
- fetchOptions?: FetchOptions | undefined;
391
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
392
- success: boolean;
393
- message: string;
394
- }, {
395
- code?: string | undefined;
396
- message?: string | undefined;
397
- }, FetchOptions["throw"] extends true ? true : false>>) & {
398
- callback: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
399
- token: string;
400
- callbackURL?: string | undefined;
401
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
402
- query: {
403
- token: string;
404
- callbackURL?: string | undefined;
405
- };
406
- fetchOptions?: FetchOptions | undefined;
407
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
408
- success: boolean;
409
- message: string;
410
- }, {
411
- code?: string | undefined;
412
- message?: string | undefined;
413
- }, FetchOptions["throw"] extends true ? true : false>>;
414
- };
415
- requestPasswordReset: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
416
- email: string;
417
- redirectTo?: string | undefined;
418
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
419
- email: string;
420
- redirectTo?: string | undefined;
421
- } & {
422
- fetchOptions?: FetchOptions | undefined;
423
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
424
- status: boolean;
425
- message: string;
426
- }, {
427
- code?: string | undefined;
428
- message?: string | undefined;
429
- }, FetchOptions["throw"] extends true ? true : false>>;
430
- listSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
431
- query?: Record<string, any> | undefined;
432
- fetchOptions?: FetchOptions | undefined;
433
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<better_auth.Prettify<{
434
- id: string;
435
- createdAt: Date;
436
- updatedAt: Date;
437
- userId: string;
438
- expiresAt: Date;
439
- token: string;
440
- ipAddress?: string | null | undefined | undefined;
441
- userAgent?: string | null | undefined | undefined;
442
- }>[], {
443
- code?: string | undefined;
444
- message?: string | undefined;
445
- }, FetchOptions["throw"] extends true ? true : false>>;
446
- revokeSession: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
447
- token: string;
448
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
449
- token: string;
450
- } & {
451
- fetchOptions?: FetchOptions | undefined;
452
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
453
- status: boolean;
454
- }, {
455
- code?: string | undefined;
456
- message?: string | undefined;
457
- }, FetchOptions["throw"] extends true ? true : false>>;
458
- revokeSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
459
- query?: Record<string, any> | undefined;
460
- fetchOptions?: FetchOptions | undefined;
461
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
462
- status: boolean;
463
- }, {
464
- code?: string | undefined;
465
- message?: string | undefined;
466
- }, FetchOptions["throw"] extends true ? true : false>>;
467
- revokeOtherSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
468
- query?: Record<string, any> | undefined;
469
- fetchOptions?: FetchOptions | undefined;
470
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
471
- status: boolean;
472
- }, {
473
- code?: string | undefined;
474
- message?: string | undefined;
475
- }, FetchOptions["throw"] extends true ? true : false>>;
476
- linkSocial: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
477
- provider: unknown;
478
- callbackURL?: string | undefined;
479
- idToken?: {
480
- token: string;
481
- nonce?: string | undefined;
482
- accessToken?: string | undefined;
483
- refreshToken?: string | undefined;
484
- scopes?: string[] | undefined;
485
- } | undefined;
486
- requestSignUp?: boolean | undefined;
487
- scopes?: string[] | undefined;
488
- errorCallbackURL?: string | undefined;
489
- disableRedirect?: boolean | undefined;
490
- additionalData?: Record<string, any> | undefined;
491
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
492
- provider: unknown;
493
- callbackURL?: string | undefined;
494
- idToken?: {
495
- token: string;
496
- nonce?: string | undefined;
497
- accessToken?: string | undefined;
498
- refreshToken?: string | undefined;
499
- scopes?: string[] | undefined;
500
- } | undefined;
501
- requestSignUp?: boolean | undefined;
502
- scopes?: string[] | undefined;
503
- errorCallbackURL?: string | undefined;
504
- disableRedirect?: boolean | undefined;
505
- additionalData?: Record<string, any> | undefined;
506
- } & {
507
- fetchOptions?: FetchOptions | undefined;
508
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
509
- url: string;
510
- redirect: boolean;
511
- }, {
512
- code?: string | undefined;
513
- message?: string | undefined;
514
- }, FetchOptions["throw"] extends true ? true : false>>;
515
- listAccounts: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
516
- query?: Record<string, any> | undefined;
517
- fetchOptions?: FetchOptions | undefined;
518
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
519
- id: string;
520
- providerId: string;
521
- createdAt: Date;
522
- updatedAt: Date;
523
- accountId: string;
524
- userId: string;
525
- scopes: string[];
526
- }[], {
527
- code?: string | undefined;
528
- message?: string | undefined;
529
- }, FetchOptions["throw"] extends true ? true : false>>;
530
- unlinkAccount: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
531
- providerId: string;
532
- accountId?: string | undefined;
533
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
534
- providerId: string;
535
- accountId?: string | undefined;
536
- } & {
537
- fetchOptions?: FetchOptions | undefined;
538
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
539
- status: boolean;
540
- }, {
541
- code?: string | undefined;
542
- message?: string | undefined;
543
- }, FetchOptions["throw"] extends true ? true : false>>;
544
- refreshToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
545
- providerId: string;
546
- accountId?: string | undefined;
547
- userId?: string | undefined;
548
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
549
- providerId: string;
550
- accountId?: string | undefined;
551
- userId?: string | undefined;
552
- } & {
553
- fetchOptions?: FetchOptions | undefined;
554
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
555
- accessToken: string | undefined;
556
- refreshToken: string | undefined;
557
- accessTokenExpiresAt: Date | undefined;
558
- refreshTokenExpiresAt: Date | undefined;
559
- scope: string | null | undefined;
560
- idToken: string | null | undefined;
561
- providerId: string;
562
- accountId: string;
563
- }, {
564
- code?: string | undefined;
565
- message?: string | undefined;
566
- }, FetchOptions["throw"] extends true ? true : false>>;
567
- getAccessToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
568
- providerId: string;
569
- accountId?: string | undefined;
570
- userId?: string | undefined;
571
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
572
- providerId: string;
573
- accountId?: string | undefined;
574
- userId?: string | undefined;
575
- } & {
576
- fetchOptions?: FetchOptions | undefined;
577
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
578
- accessToken: string;
579
- accessTokenExpiresAt: Date | undefined;
580
- scopes: string[];
581
- idToken: string | undefined;
582
- }, {
583
- code?: string | undefined;
584
- message?: string | undefined;
585
- }, FetchOptions["throw"] extends true ? true : false>>;
586
- accountInfo: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
587
- accountId?: string | undefined;
588
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
589
- query?: {
590
- accountId?: string | undefined;
591
- } | undefined;
592
- fetchOptions?: FetchOptions | undefined;
593
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
594
- user: better_auth.OAuth2UserInfo;
595
- data: Record<string, any>;
596
- }, {
597
- code?: string | undefined;
598
- message?: string | undefined;
599
- }, FetchOptions["throw"] extends true ? true : false>>;
600
- getSession: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
601
- disableCookieCache?: unknown;
602
- disableRefresh?: unknown;
603
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
604
- query?: {
605
- disableCookieCache?: unknown;
606
- disableRefresh?: unknown;
607
- } | undefined;
608
- fetchOptions?: FetchOptions | undefined;
609
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
610
- user: {
611
- id: string;
612
- createdAt: Date;
613
- updatedAt: Date;
614
- email: string;
615
- emailVerified: boolean;
616
- name: string;
617
- image?: string | null | undefined;
618
- };
619
- session: {
620
- id: string;
621
- createdAt: Date;
622
- updatedAt: Date;
623
- userId: string;
624
- expiresAt: Date;
625
- token: string;
626
- ipAddress?: string | null | undefined;
627
- userAgent?: string | null | undefined;
628
- };
629
- } | null, {
630
- code?: string | undefined;
631
- message?: string | undefined;
632
- }, FetchOptions["throw"] extends true ? true : false>>;
633
- useSession: () => nanostores.Atom<{
634
- data: {
635
- user: {
636
- id: string;
637
- createdAt: Date;
638
- updatedAt: Date;
639
- email: string;
640
- emailVerified: boolean;
641
- name: string;
642
- image?: string | null | undefined;
643
- };
644
- session: {
645
- id: string;
646
- createdAt: Date;
647
- updatedAt: Date;
648
- userId: string;
649
- expiresAt: Date;
650
- token: string;
651
- ipAddress?: string | null | undefined;
652
- userAgent?: string | null | undefined;
653
- };
654
- } | null;
655
- error: _better_fetch_fetch.BetterFetchError | null;
656
- isPending: boolean;
657
- isRefetching: boolean;
658
- refetch: (queryParams?: {
659
- query?: better_auth.SessionQueryParams;
660
- } | undefined) => Promise<void>;
661
- }>;
662
- $fetch: _better_fetch_fetch.BetterFetch<{
663
- plugins: (_better_fetch_fetch.BetterFetchPlugin<Record<string, any>> | {
664
- id: string;
665
- name: string;
666
- hooks: {
667
- onSuccess(context: _better_fetch_fetch.SuccessContext<any>): void;
668
- };
669
- } | {
670
- id: string;
671
- name: string;
672
- hooks: {
673
- onSuccess: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
674
- onError: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
675
- onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
676
- onResponse: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
677
- };
678
- })[];
679
- cache?: RequestCache | undefined;
680
- method: string;
681
- window?: null | undefined;
682
- headers?: (HeadersInit & (HeadersInit | {
683
- accept: "application/json" | "text/plain" | "application/octet-stream";
684
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
685
- authorization: "Bearer" | "Basic";
686
- })) | undefined;
687
- redirect?: RequestRedirect | undefined;
688
- credentials?: RequestCredentials;
689
- integrity?: string | undefined;
690
- keepalive?: boolean | undefined;
691
- mode?: RequestMode | undefined;
692
- priority?: RequestPriority | undefined;
693
- referrer?: string | undefined;
694
- referrerPolicy?: ReferrerPolicy | undefined;
695
- signal?: (AbortSignal | null) | undefined;
696
- onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
697
- hookOptions?: {
698
- cloneResponse?: boolean;
699
- } | undefined;
700
- timeout?: number | undefined;
701
- customFetchImpl: _better_fetch_fetch.FetchEsque;
702
- baseURL: string;
703
- throw?: boolean | undefined;
704
- auth?: ({
705
- type: "Bearer";
706
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
707
- } | {
708
- type: "Basic";
709
- username: string | (() => string | undefined) | undefined;
710
- password: string | (() => string | undefined) | undefined;
711
- } | {
712
- type: "Custom";
713
- prefix: string | (() => string | undefined) | undefined;
714
- value: string | (() => string | undefined) | undefined;
715
- }) | undefined;
716
- body?: any;
717
- query?: any;
718
- params?: any;
719
- duplex?: "full" | "half" | undefined;
720
- jsonParser: (text: string) => Promise<any> | any;
721
- retry?: _better_fetch_fetch.RetryOptions | undefined;
722
- retryAttempt?: number | undefined;
723
- output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
724
- errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
725
- disableValidation?: boolean | undefined;
726
- disableSignal?: boolean | undefined;
727
- }, unknown, unknown, {}>;
728
- $store: {
729
- notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
730
- listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
731
- atoms: Record<string, nanostores.WritableAtom<any>>;
732
- };
733
- $Infer: {
734
- Session: {
735
- user: {
736
- id: string;
737
- createdAt: Date;
738
- updatedAt: Date;
739
- email: string;
740
- emailVerified: boolean;
741
- name: string;
742
- image?: string | null | undefined;
743
- };
744
- session: {
745
- id: string;
746
- createdAt: Date;
747
- updatedAt: Date;
748
- userId: string;
749
- expiresAt: Date;
750
- token: string;
751
- ipAddress?: string | null | undefined;
752
- userAgent?: string | null | undefined;
753
- };
754
- };
755
- };
756
- $ERROR_CODES: {
757
- readonly USER_NOT_FOUND: "User not found";
758
- readonly FAILED_TO_CREATE_USER: "Failed to create user";
759
- readonly FAILED_TO_CREATE_SESSION: "Failed to create session";
760
- readonly FAILED_TO_UPDATE_USER: "Failed to update user";
761
- readonly FAILED_TO_GET_SESSION: "Failed to get session";
762
- readonly INVALID_PASSWORD: "Invalid password";
763
- readonly INVALID_EMAIL: "Invalid email";
764
- readonly INVALID_EMAIL_OR_PASSWORD: "Invalid email or password";
765
- readonly SOCIAL_ACCOUNT_ALREADY_LINKED: "Social account already linked";
766
- readonly PROVIDER_NOT_FOUND: "Provider not found";
767
- readonly INVALID_TOKEN: "Invalid token";
768
- readonly ID_TOKEN_NOT_SUPPORTED: "id_token not supported";
769
- readonly FAILED_TO_GET_USER_INFO: "Failed to get user info";
770
- readonly USER_EMAIL_NOT_FOUND: "User email not found";
771
- readonly EMAIL_NOT_VERIFIED: "Email not verified";
772
- readonly PASSWORD_TOO_SHORT: "Password too short";
773
- readonly PASSWORD_TOO_LONG: "Password too long";
774
- readonly USER_ALREADY_EXISTS: "User already exists.";
775
- readonly USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: "User already exists. Use another email.";
776
- readonly EMAIL_CAN_NOT_BE_UPDATED: "Email can not be updated";
777
- readonly CREDENTIAL_ACCOUNT_NOT_FOUND: "Credential account not found";
778
- readonly SESSION_EXPIRED: "Session expired. Re-authenticate to perform this action.";
779
- readonly FAILED_TO_UNLINK_LAST_ACCOUNT: "You can't unlink your last account";
780
- readonly ACCOUNT_NOT_FOUND: "Account not found";
781
- readonly USER_ALREADY_HAS_PASSWORD: "User already has a password. Provide that to delete the account.";
782
- readonly CROSS_SITE_NAVIGATION_LOGIN_BLOCKED: "Cross-site navigation login blocked. This request appears to be a CSRF attack.";
783
- readonly VERIFICATION_EMAIL_NOT_ENABLED: "Verification email isn't enabled";
784
- readonly EMAIL_ALREADY_VERIFIED: "Email is already verified";
785
- readonly EMAIL_MISMATCH: "Email mismatch";
786
- readonly SESSION_NOT_FRESH: "Session is not fresh";
787
- readonly LINKED_ACCOUNT_ALREADY_EXISTS: "Linked account already exists";
788
- readonly INVALID_ORIGIN: "Invalid origin";
789
- readonly INVALID_CALLBACK_URL: "Invalid callbackURL";
790
- readonly INVALID_REDIRECT_URL: "Invalid redirectURL";
791
- readonly INVALID_ERROR_CALLBACK_URL: "Invalid errorCallbackURL";
792
- readonly INVALID_NEW_USER_CALLBACK_URL: "Invalid newUserCallbackURL";
793
- readonly MISSING_OR_NULL_ORIGIN: "Missing or null Origin";
794
- readonly CALLBACK_URL_REQUIRED: "callbackURL is required";
795
- readonly FAILED_TO_CREATE_VERIFICATION: "Unable to create verification";
796
- readonly FIELD_NOT_ALLOWED: "Field not allowed to be set";
797
- readonly ASYNC_VALIDATION_NOT_SUPPORTED: "Async validation is not supported";
798
- readonly VALIDATION_ERROR: "Validation Error";
799
- readonly MISSING_FIELD: "Field is required";
800
- };
801
- };
802
- nextjs: {
803
- login: {
804
- social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
805
- 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 & {});
806
- callbackURL?: string | undefined;
807
- newUserCallbackURL?: string | undefined;
808
- errorCallbackURL?: string | undefined;
809
- disableRedirect?: boolean | undefined;
810
- idToken?: {
811
- token: string;
812
- nonce?: string | undefined;
813
- accessToken?: string | undefined;
814
- refreshToken?: string | undefined;
815
- expiresAt?: number | undefined;
816
- } | undefined;
817
- scopes?: string[] | undefined;
818
- requestSignUp?: boolean | undefined;
819
- loginHint?: string | undefined;
820
- additionalData?: Record<string, any> | undefined;
821
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
822
- 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 & {});
823
- callbackURL?: string | undefined;
824
- newUserCallbackURL?: string | undefined;
825
- errorCallbackURL?: string | undefined;
826
- disableRedirect?: boolean | undefined;
827
- idToken?: {
828
- token: string;
829
- nonce?: string | undefined;
830
- accessToken?: string | undefined;
831
- refreshToken?: string | undefined;
832
- expiresAt?: number | undefined;
833
- } | undefined;
834
- scopes?: string[] | undefined;
835
- requestSignUp?: boolean | undefined;
836
- loginHint?: string | undefined;
837
- additionalData?: Record<string, any> | undefined;
838
- } & {
839
- fetchOptions?: FetchOptions | undefined;
840
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<{
841
- redirect: boolean;
842
- url: string;
843
- } | {
844
- redirect: boolean;
845
- token: string;
846
- url: undefined;
847
- user: {
848
- id: string;
849
- createdAt: Date;
850
- updatedAt: Date;
851
- email: string;
852
- emailVerified: boolean;
853
- name: string;
854
- image?: string | null | undefined | undefined;
855
- };
856
- }>, {
857
- code?: string | undefined;
858
- message?: string | undefined;
859
- }, FetchOptions["throw"] extends true ? true : false>>;
860
- } & {
861
- email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
862
- email: string;
863
- password: string;
864
- callbackURL?: string | undefined;
865
- rememberMe?: boolean | undefined;
866
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
867
- email: string;
868
- password: string;
869
- callbackURL?: string | undefined;
870
- rememberMe?: boolean | undefined;
871
- } & {
872
- fetchOptions?: FetchOptions | undefined;
873
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
874
- redirect: boolean;
875
- token: string;
876
- url?: string | undefined;
877
- user: {
878
- id: string;
879
- createdAt: Date;
880
- updatedAt: Date;
881
- email: string;
882
- emailVerified: boolean;
883
- name: string;
884
- image?: string | null | undefined | undefined;
885
- };
886
- }, {
887
- code?: string | undefined;
888
- message?: string | undefined;
889
- }, FetchOptions["throw"] extends true ? true : false>>;
890
- };
891
- signIn: {
892
- social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
893
- 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 & {});
894
- callbackURL?: string | undefined;
895
- newUserCallbackURL?: string | undefined;
896
- errorCallbackURL?: string | undefined;
897
- disableRedirect?: boolean | undefined;
898
- idToken?: {
899
- token: string;
900
- nonce?: string | undefined;
901
- accessToken?: string | undefined;
902
- refreshToken?: string | undefined;
903
- expiresAt?: number | undefined;
904
- } | undefined;
905
- scopes?: string[] | undefined;
906
- requestSignUp?: boolean | undefined;
907
- loginHint?: string | undefined;
908
- additionalData?: Record<string, any> | undefined;
909
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
910
- 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 & {});
911
- callbackURL?: string | undefined;
912
- newUserCallbackURL?: string | undefined;
913
- errorCallbackURL?: string | undefined;
914
- disableRedirect?: boolean | undefined;
915
- idToken?: {
916
- token: string;
917
- nonce?: string | undefined;
918
- accessToken?: string | undefined;
919
- refreshToken?: string | undefined;
920
- expiresAt?: number | undefined;
921
- } | undefined;
922
- scopes?: string[] | undefined;
923
- requestSignUp?: boolean | undefined;
924
- loginHint?: string | undefined;
925
- additionalData?: Record<string, any> | undefined;
926
- } & {
927
- fetchOptions?: FetchOptions | undefined;
928
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<{
929
- redirect: boolean;
930
- url: string;
931
- } | {
932
- redirect: boolean;
933
- token: string;
934
- url: undefined;
935
- user: {
936
- id: string;
937
- createdAt: Date;
938
- updatedAt: Date;
939
- email: string;
940
- emailVerified: boolean;
941
- name: string;
942
- image?: string | null | undefined | undefined;
943
- };
944
- }>, {
945
- code?: string | undefined;
946
- message?: string | undefined;
947
- }, FetchOptions["throw"] extends true ? true : false>>;
948
- } & {
949
- email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
950
- email: string;
951
- password: string;
952
- callbackURL?: string | undefined;
953
- rememberMe?: boolean | undefined;
954
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
955
- email: string;
956
- password: string;
957
- callbackURL?: string | undefined;
958
- rememberMe?: boolean | undefined;
959
- } & {
960
- fetchOptions?: FetchOptions | undefined;
961
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
962
- redirect: boolean;
963
- token: string;
964
- url?: string | undefined;
965
- user: {
966
- id: string;
967
- createdAt: Date;
968
- updatedAt: Date;
969
- email: string;
970
- emailVerified: boolean;
971
- name: string;
972
- image?: string | null | undefined | undefined;
973
- };
974
- }, {
975
- code?: string | undefined;
976
- message?: string | undefined;
977
- }, FetchOptions["throw"] extends true ? true : false>>;
978
- };
979
- signOut: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
980
- query?: Record<string, any> | undefined;
981
- fetchOptions?: FetchOptions | undefined;
982
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
983
- success: boolean;
984
- }, {
985
- code?: string | undefined;
986
- message?: string | undefined;
987
- }, FetchOptions["throw"] extends true ? true : false>>;
988
- signUp: {
989
- email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
990
- name: string;
991
- email: string;
992
- password: string;
993
- image?: string | undefined;
994
- callbackURL?: string | undefined;
995
- rememberMe?: boolean | undefined;
996
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
997
- email: string;
998
- name: string;
999
- password: string;
1000
- image?: string | undefined;
1001
- callbackURL?: string | undefined;
1002
- fetchOptions?: FetchOptions | undefined;
1003
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<{
1004
- token: null;
1005
- user: {
1006
- id: string;
1007
- createdAt: Date;
1008
- updatedAt: Date;
1009
- email: string;
1010
- emailVerified: boolean;
1011
- name: string;
1012
- image?: string | null | undefined | undefined;
1013
- };
1014
- } | {
1015
- token: string;
1016
- user: {
1017
- id: string;
1018
- createdAt: Date;
1019
- updatedAt: Date;
1020
- email: string;
1021
- emailVerified: boolean;
1022
- name: string;
1023
- image?: string | null | undefined | undefined;
1024
- };
1025
- }>, {
1026
- code?: string | undefined;
1027
- message?: string | undefined;
1028
- }, FetchOptions["throw"] extends true ? true : false>>;
1029
- };
1030
- resetPassword: (<FetchOptions extends better_auth.ClientFetchOption<Partial<{
1031
- newPassword: string;
1032
- token?: string | undefined;
1033
- }> & Record<string, any>, Partial<{
1034
- token?: string | undefined;
1035
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1036
- newPassword: string;
1037
- token?: string | undefined;
1038
- } & {
1039
- fetchOptions?: FetchOptions | undefined;
1040
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1041
- status: boolean;
1042
- }, {
1043
- code?: string | undefined;
1044
- message?: string | undefined;
1045
- }, FetchOptions["throw"] extends true ? true : false>>) & {
1046
- ":token": <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1047
- callbackURL: string;
1048
- }> & Record<string, any>, {
1049
- token: string;
1050
- }>>(data_0: better_auth.Prettify<{
1051
- query: {
1052
- callbackURL: string;
1053
- };
1054
- fetchOptions?: FetchOptions | undefined;
1055
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<never, {
1056
- code?: string | undefined;
1057
- message?: string | undefined;
1058
- }, FetchOptions["throw"] extends true ? true : false>>;
1059
- };
1060
- verifyEmail: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1061
- token: string;
1062
- callbackURL?: string | undefined;
1063
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1064
- query: {
1065
- token: string;
1066
- callbackURL?: string | undefined;
1067
- };
1068
- fetchOptions?: FetchOptions | undefined;
1069
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<void | {
1070
- status: boolean;
1071
- }>, {
1072
- code?: string | undefined;
1073
- message?: string | undefined;
1074
- }, FetchOptions["throw"] extends true ? true : false>>;
1075
- sendVerificationEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1076
- email: string;
1077
- callbackURL?: string | undefined;
1078
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1079
- email: string;
1080
- callbackURL?: string | undefined;
1081
- } & {
1082
- fetchOptions?: FetchOptions | undefined;
1083
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1084
- status: boolean;
1085
- }, {
1086
- code?: string | undefined;
1087
- message?: string | undefined;
1088
- }, FetchOptions["throw"] extends true ? true : false>>;
1089
- changeEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1090
- newEmail: string;
1091
- callbackURL?: string | undefined;
1092
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1093
- newEmail: string;
1094
- callbackURL?: string | undefined;
1095
- } & {
1096
- fetchOptions?: FetchOptions | undefined;
1097
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1098
- status: boolean;
1099
- }, {
1100
- code?: string | undefined;
1101
- message?: string | undefined;
1102
- }, FetchOptions["throw"] extends true ? true : false>>;
1103
- changePassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1104
- newPassword: string;
1105
- currentPassword: string;
1106
- revokeOtherSessions?: boolean | undefined;
1107
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1108
- newPassword: string;
1109
- currentPassword: string;
1110
- revokeOtherSessions?: boolean | undefined;
1111
- } & {
1112
- fetchOptions?: FetchOptions | undefined;
1113
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1114
- token: string | null;
1115
- user: {
1116
- id: string;
1117
- email: string;
1118
- name: string;
1119
- image: string | null | undefined;
1120
- emailVerified: boolean;
1121
- createdAt: Date;
1122
- updatedAt: Date;
1123
- };
1124
- }, {
1125
- code?: string | undefined;
1126
- message?: string | undefined;
1127
- }, FetchOptions["throw"] extends true ? true : false>>;
1128
- updateUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<Partial<{}> & {
1129
- name?: string | undefined;
1130
- image?: string | undefined | null;
1131
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1132
- image?: (string | null) | undefined;
1133
- name?: string | undefined;
1134
- fetchOptions?: FetchOptions | undefined;
1135
- } & Partial<{}>> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1136
- status: boolean;
1137
- }, {
1138
- code?: string | undefined;
1139
- message?: string | undefined;
1140
- }, FetchOptions["throw"] extends true ? true : false>>;
1141
- deleteUser: (<FetchOptions extends better_auth.ClientFetchOption<Partial<{
1142
- callbackURL?: string | undefined;
1143
- password?: string | undefined;
1144
- token?: string | undefined;
1145
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1146
- callbackURL?: string | undefined;
1147
- password?: string | undefined;
1148
- token?: string | undefined;
1149
- } & {
1150
- fetchOptions?: FetchOptions | undefined;
1151
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1152
- success: boolean;
1153
- message: string;
1154
- }, {
1155
- code?: string | undefined;
1156
- message?: string | undefined;
1157
- }, FetchOptions["throw"] extends true ? true : false>>) & {
1158
- callback: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1159
- token: string;
1160
- callbackURL?: string | undefined;
1161
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1162
- query: {
1163
- token: string;
1164
- callbackURL?: string | undefined;
1165
- };
1166
- fetchOptions?: FetchOptions | undefined;
1167
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1168
- success: boolean;
1169
- message: string;
1170
- }, {
1171
- code?: string | undefined;
1172
- message?: string | undefined;
1173
- }, FetchOptions["throw"] extends true ? true : false>>;
1174
- };
1175
- requestPasswordReset: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1176
- email: string;
1177
- redirectTo?: string | undefined;
1178
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1179
- email: string;
1180
- redirectTo?: string | undefined;
1181
- } & {
1182
- fetchOptions?: FetchOptions | undefined;
1183
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1184
- status: boolean;
1185
- message: string;
1186
- }, {
1187
- code?: string | undefined;
1188
- message?: string | undefined;
1189
- }, FetchOptions["throw"] extends true ? true : false>>;
1190
- listSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1191
- query?: Record<string, any> | undefined;
1192
- fetchOptions?: FetchOptions | undefined;
1193
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<better_auth.Prettify<{
1194
- id: string;
1195
- createdAt: Date;
1196
- updatedAt: Date;
1197
- userId: string;
1198
- expiresAt: Date;
1199
- token: string;
1200
- ipAddress?: string | null | undefined | undefined;
1201
- userAgent?: string | null | undefined | undefined;
1202
- }>[], {
1203
- code?: string | undefined;
1204
- message?: string | undefined;
1205
- }, FetchOptions["throw"] extends true ? true : false>>;
1206
- revokeSession: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1207
- token: string;
1208
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1209
- token: string;
1210
- } & {
1211
- fetchOptions?: FetchOptions | undefined;
1212
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1213
- status: boolean;
1214
- }, {
1215
- code?: string | undefined;
1216
- message?: string | undefined;
1217
- }, FetchOptions["throw"] extends true ? true : false>>;
1218
- revokeSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1219
- query?: Record<string, any> | undefined;
1220
- fetchOptions?: FetchOptions | undefined;
1221
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1222
- status: boolean;
1223
- }, {
1224
- code?: string | undefined;
1225
- message?: string | undefined;
1226
- }, FetchOptions["throw"] extends true ? true : false>>;
1227
- revokeOtherSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1228
- query?: Record<string, any> | undefined;
1229
- fetchOptions?: FetchOptions | undefined;
1230
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1231
- status: boolean;
1232
- }, {
1233
- code?: string | undefined;
1234
- message?: string | undefined;
1235
- }, FetchOptions["throw"] extends true ? true : false>>;
1236
- linkSocial: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1237
- provider: unknown;
1238
- callbackURL?: string | undefined;
1239
- idToken?: {
1240
- token: string;
1241
- nonce?: string | undefined;
1242
- accessToken?: string | undefined;
1243
- refreshToken?: string | undefined;
1244
- scopes?: string[] | undefined;
1245
- } | undefined;
1246
- requestSignUp?: boolean | undefined;
1247
- scopes?: string[] | undefined;
1248
- errorCallbackURL?: string | undefined;
1249
- disableRedirect?: boolean | undefined;
1250
- additionalData?: Record<string, any> | undefined;
1251
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1252
- provider: unknown;
1253
- callbackURL?: string | undefined;
1254
- idToken?: {
1255
- token: string;
1256
- nonce?: string | undefined;
1257
- accessToken?: string | undefined;
1258
- refreshToken?: string | undefined;
1259
- scopes?: string[] | undefined;
1260
- } | undefined;
1261
- requestSignUp?: boolean | undefined;
1262
- scopes?: string[] | undefined;
1263
- errorCallbackURL?: string | undefined;
1264
- disableRedirect?: boolean | undefined;
1265
- additionalData?: Record<string, any> | undefined;
1266
- } & {
1267
- fetchOptions?: FetchOptions | undefined;
1268
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1269
- url: string;
1270
- redirect: boolean;
1271
- }, {
1272
- code?: string | undefined;
1273
- message?: string | undefined;
1274
- }, FetchOptions["throw"] extends true ? true : false>>;
1275
- listAccounts: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1276
- query?: Record<string, any> | undefined;
1277
- fetchOptions?: FetchOptions | undefined;
1278
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1279
- id: string;
1280
- providerId: string;
1281
- createdAt: Date;
1282
- updatedAt: Date;
1283
- accountId: string;
1284
- userId: string;
1285
- scopes: string[];
1286
- }[], {
1287
- code?: string | undefined;
1288
- message?: string | undefined;
1289
- }, FetchOptions["throw"] extends true ? true : false>>;
1290
- unlinkAccount: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1291
- providerId: string;
1292
- accountId?: string | undefined;
1293
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1294
- providerId: string;
1295
- accountId?: string | undefined;
1296
- } & {
1297
- fetchOptions?: FetchOptions | undefined;
1298
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1299
- status: boolean;
1300
- }, {
1301
- code?: string | undefined;
1302
- message?: string | undefined;
1303
- }, FetchOptions["throw"] extends true ? true : false>>;
1304
- refreshToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1305
- providerId: string;
1306
- accountId?: string | undefined;
1307
- userId?: string | undefined;
1308
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1309
- providerId: string;
1310
- accountId?: string | undefined;
1311
- userId?: string | undefined;
1312
- } & {
1313
- fetchOptions?: FetchOptions | undefined;
1314
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1315
- accessToken: string | undefined;
1316
- refreshToken: string | undefined;
1317
- accessTokenExpiresAt: Date | undefined;
1318
- refreshTokenExpiresAt: Date | undefined;
1319
- scope: string | null | undefined;
1320
- idToken: string | null | undefined;
1321
- providerId: string;
1322
- accountId: string;
1323
- }, {
1324
- code?: string | undefined;
1325
- message?: string | undefined;
1326
- }, FetchOptions["throw"] extends true ? true : false>>;
1327
- getAccessToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1328
- providerId: string;
1329
- accountId?: string | undefined;
1330
- userId?: string | undefined;
1331
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1332
- providerId: string;
1333
- accountId?: string | undefined;
1334
- userId?: string | undefined;
1335
- } & {
1336
- fetchOptions?: FetchOptions | undefined;
1337
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1338
- accessToken: string;
1339
- accessTokenExpiresAt: Date | undefined;
1340
- scopes: string[];
1341
- idToken: string | undefined;
1342
- }, {
1343
- code?: string | undefined;
1344
- message?: string | undefined;
1345
- }, FetchOptions["throw"] extends true ? true : false>>;
1346
- accountInfo: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1347
- accountId?: string | undefined;
1348
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1349
- query?: {
1350
- accountId?: string | undefined;
1351
- } | undefined;
1352
- fetchOptions?: FetchOptions | undefined;
1353
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1354
- user: better_auth.OAuth2UserInfo;
1355
- data: Record<string, any>;
1356
- }, {
1357
- code?: string | undefined;
1358
- message?: string | undefined;
1359
- }, FetchOptions["throw"] extends true ? true : false>>;
1360
- getSession: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1361
- disableCookieCache?: unknown;
1362
- disableRefresh?: unknown;
1363
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1364
- query?: {
1365
- disableCookieCache?: unknown;
1366
- disableRefresh?: unknown;
1367
- } | undefined;
1368
- fetchOptions?: FetchOptions | undefined;
1369
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1370
- user: {
1371
- id: string;
1372
- createdAt: Date;
1373
- updatedAt: Date;
1374
- email: string;
1375
- emailVerified: boolean;
1376
- name: string;
1377
- image?: string | null | undefined;
1378
- };
1379
- session: {
1380
- id: string;
1381
- createdAt: Date;
1382
- updatedAt: Date;
1383
- userId: string;
1384
- expiresAt: Date;
1385
- token: string;
1386
- ipAddress?: string | null | undefined;
1387
- userAgent?: string | null | undefined;
1388
- };
1389
- } | null, {
1390
- code?: string | undefined;
1391
- message?: string | undefined;
1392
- }, FetchOptions["throw"] extends true ? true : false>>;
1393
- useSession: () => {
1394
- data: {
1395
- user: {
1396
- id: string;
1397
- createdAt: Date;
1398
- updatedAt: Date;
1399
- email: string;
1400
- emailVerified: boolean;
1401
- name: string;
1402
- image?: string | null | undefined;
1403
- };
1404
- session: {
1405
- id: string;
1406
- createdAt: Date;
1407
- updatedAt: Date;
1408
- userId: string;
1409
- expiresAt: Date;
1410
- token: string;
1411
- ipAddress?: string | null | undefined;
1412
- userAgent?: string | null | undefined;
1413
- };
1414
- } | null;
1415
- isPending: boolean;
1416
- isRefetching: boolean;
1417
- error: _better_fetch_fetch.BetterFetchError | null;
1418
- refetch: (queryParams?: {
1419
- query?: better_auth.SessionQueryParams;
1420
- } | undefined) => Promise<void>;
1421
- };
1422
- $Infer: {
1423
- Session: {
1424
- user: {
1425
- id: string;
1426
- createdAt: Date;
1427
- updatedAt: Date;
1428
- email: string;
1429
- emailVerified: boolean;
1430
- name: string;
1431
- image?: string | null | undefined;
1432
- };
1433
- session: {
1434
- id: string;
1435
- createdAt: Date;
1436
- updatedAt: Date;
1437
- userId: string;
1438
- expiresAt: Date;
1439
- token: string;
1440
- ipAddress?: string | null | undefined;
1441
- userAgent?: string | null | undefined;
1442
- };
1443
- };
1444
- };
1445
- $fetch: _better_fetch_fetch.BetterFetch<{
1446
- plugins: (_better_fetch_fetch.BetterFetchPlugin<Record<string, any>> | {
1447
- id: string;
1448
- name: string;
1449
- hooks: {
1450
- onSuccess(context: _better_fetch_fetch.SuccessContext<any>): void;
1451
- };
1452
- } | {
1453
- id: string;
1454
- name: string;
1455
- hooks: {
1456
- onSuccess: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
1457
- onError: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
1458
- onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
1459
- onResponse: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
1460
- };
1461
- })[];
1462
- cache?: RequestCache | undefined;
1463
- method: string;
1464
- window?: null | undefined;
1465
- headers?: (HeadersInit & (HeadersInit | {
1466
- accept: "application/json" | "text/plain" | "application/octet-stream";
1467
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1468
- authorization: "Bearer" | "Basic";
1469
- })) | undefined;
1470
- redirect?: RequestRedirect | undefined;
1471
- credentials?: RequestCredentials;
1472
- integrity?: string | undefined;
1473
- keepalive?: boolean | undefined;
1474
- mode?: RequestMode | undefined;
1475
- priority?: RequestPriority | undefined;
1476
- referrer?: string | undefined;
1477
- referrerPolicy?: ReferrerPolicy | undefined;
1478
- signal?: (AbortSignal | null) | undefined;
1479
- onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
1480
- hookOptions?: {
1481
- cloneResponse?: boolean;
1482
- } | undefined;
1483
- timeout?: number | undefined;
1484
- customFetchImpl: _better_fetch_fetch.FetchEsque;
1485
- baseURL: string;
1486
- throw?: boolean | undefined;
1487
- auth?: ({
1488
- type: "Bearer";
1489
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1490
- } | {
1491
- type: "Basic";
1492
- username: string | (() => string | undefined) | undefined;
1493
- password: string | (() => string | undefined) | undefined;
1494
- } | {
1495
- type: "Custom";
1496
- prefix: string | (() => string | undefined) | undefined;
1497
- value: string | (() => string | undefined) | undefined;
1498
- }) | undefined;
1499
- body?: any;
1500
- query?: any;
1501
- params?: any;
1502
- duplex?: "full" | "half" | undefined;
1503
- jsonParser: (text: string) => Promise<any> | any;
1504
- retry?: _better_fetch_fetch.RetryOptions | undefined;
1505
- retryAttempt?: number | undefined;
1506
- output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1507
- errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
1508
- disableValidation?: boolean | undefined;
1509
- disableSignal?: boolean | undefined;
1510
- }, unknown, unknown, {}>;
1511
- $store: {
1512
- notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
1513
- listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
1514
- atoms: Record<string, nanostores.WritableAtom<any>>;
1515
- };
1516
- $ERROR_CODES: {
1517
- readonly USER_NOT_FOUND: "User not found";
1518
- readonly FAILED_TO_CREATE_USER: "Failed to create user";
1519
- readonly FAILED_TO_CREATE_SESSION: "Failed to create session";
1520
- readonly FAILED_TO_UPDATE_USER: "Failed to update user";
1521
- readonly FAILED_TO_GET_SESSION: "Failed to get session";
1522
- readonly INVALID_PASSWORD: "Invalid password";
1523
- readonly INVALID_EMAIL: "Invalid email";
1524
- readonly INVALID_EMAIL_OR_PASSWORD: "Invalid email or password";
1525
- readonly SOCIAL_ACCOUNT_ALREADY_LINKED: "Social account already linked";
1526
- readonly PROVIDER_NOT_FOUND: "Provider not found";
1527
- readonly INVALID_TOKEN: "Invalid token";
1528
- readonly ID_TOKEN_NOT_SUPPORTED: "id_token not supported";
1529
- readonly FAILED_TO_GET_USER_INFO: "Failed to get user info";
1530
- readonly USER_EMAIL_NOT_FOUND: "User email not found";
1531
- readonly EMAIL_NOT_VERIFIED: "Email not verified";
1532
- readonly PASSWORD_TOO_SHORT: "Password too short";
1533
- readonly PASSWORD_TOO_LONG: "Password too long";
1534
- readonly USER_ALREADY_EXISTS: "User already exists.";
1535
- readonly USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: "User already exists. Use another email.";
1536
- readonly EMAIL_CAN_NOT_BE_UPDATED: "Email can not be updated";
1537
- readonly CREDENTIAL_ACCOUNT_NOT_FOUND: "Credential account not found";
1538
- readonly SESSION_EXPIRED: "Session expired. Re-authenticate to perform this action.";
1539
- readonly FAILED_TO_UNLINK_LAST_ACCOUNT: "You can't unlink your last account";
1540
- readonly ACCOUNT_NOT_FOUND: "Account not found";
1541
- readonly USER_ALREADY_HAS_PASSWORD: "User already has a password. Provide that to delete the account.";
1542
- readonly CROSS_SITE_NAVIGATION_LOGIN_BLOCKED: "Cross-site navigation login blocked. This request appears to be a CSRF attack.";
1543
- readonly VERIFICATION_EMAIL_NOT_ENABLED: "Verification email isn't enabled";
1544
- readonly EMAIL_ALREADY_VERIFIED: "Email is already verified";
1545
- readonly EMAIL_MISMATCH: "Email mismatch";
1546
- readonly SESSION_NOT_FRESH: "Session is not fresh";
1547
- readonly LINKED_ACCOUNT_ALREADY_EXISTS: "Linked account already exists";
1548
- readonly INVALID_ORIGIN: "Invalid origin";
1549
- readonly INVALID_CALLBACK_URL: "Invalid callbackURL";
1550
- readonly INVALID_REDIRECT_URL: "Invalid redirectURL";
1551
- readonly INVALID_ERROR_CALLBACK_URL: "Invalid errorCallbackURL";
1552
- readonly INVALID_NEW_USER_CALLBACK_URL: "Invalid newUserCallbackURL";
1553
- readonly MISSING_OR_NULL_ORIGIN: "Missing or null Origin";
1554
- readonly CALLBACK_URL_REQUIRED: "callbackURL is required";
1555
- readonly FAILED_TO_CREATE_VERIFICATION: "Unable to create verification";
1556
- readonly FIELD_NOT_ALLOWED: "Field not allowed to be set";
1557
- readonly ASYNC_VALIDATION_NOT_SUPPORTED: "Async validation is not supported";
1558
- readonly VALIDATION_ERROR: "Validation Error";
1559
- readonly MISSING_FIELD: "Field is required";
1560
- };
1561
- };
1562
- };
1563
- declare const server: {
1564
- sveltekit: {
1565
- auth: better_auth.Auth<{
1566
- database: (options: better_auth.BetterAuthOptions) => better_auth.DBAdapter<better_auth.BetterAuthOptions>;
1567
- baseURL: string | undefined;
1568
- secret: string | undefined;
1569
- trustedOrigins: string[] | undefined;
1570
- socialProviders: {
1571
- google: {
1572
- clientId: string;
1573
- clientSecret: string;
1574
- };
1575
- };
1576
- session: {
1577
- expiresIn: number;
1578
- updateAge: number;
1579
- cookieCache: {
1580
- enabled: true;
1581
- maxAge: number;
1582
- };
1583
- };
1584
- }>;
1585
- handler: {
1586
- GET: (event: {
1587
- request: Request;
1588
- }) => Response | Promise<Response>;
1589
- POST: (event: {
1590
- request: Request;
1591
- }) => Response | Promise<Response>;
1592
- };
1593
- createHandle: () => _sveltejs_kit.Handle;
1594
- getSession: (event: _sveltejs_kit.RequestEvent) => Promise<SessionResult>;
1595
- isAuthenticated: (event: _sveltejs_kit.RequestEvent) => Promise<boolean>;
1596
- makeAuthenticatedCall: <TArgs extends any[], TReturn>(fn: (ctx: {
1597
- user: SessionData["user"];
1598
- session: SessionData["session"];
1599
- db: typeof db;
1600
- event: _sveltejs_kit.RequestEvent;
1601
- }, ...args: TArgs) => Promise<TReturn>) => (event: _sveltejs_kit.RequestEvent, ...args: TArgs) => Promise<TReturn>;
1602
- };
1603
- nextjs: {
1604
- auth: better_auth.Auth<{
1605
- database: (options: better_auth.BetterAuthOptions) => better_auth.DBAdapter<better_auth.BetterAuthOptions>;
1606
- baseURL: string | undefined;
1607
- secret: string | undefined;
1608
- trustedOrigins: string[] | undefined;
1609
- socialProviders: {
1610
- google: {
1611
- clientId: string;
1612
- clientSecret: string;
1613
- };
1614
- };
1615
- session: {
1616
- expiresIn: number;
1617
- updateAge: number;
1618
- cookieCache: {
1619
- enabled: true;
1620
- maxAge: number;
1621
- };
1622
- };
1623
- }>;
1624
- handler: {
1625
- GET: {
1626
- GET: (request: Request) => Promise<Response>;
1627
- POST: (request: Request) => Promise<Response>;
1628
- PATCH: (request: Request) => Promise<Response>;
1629
- PUT: (request: Request) => Promise<Response>;
1630
- DELETE: (request: Request) => Promise<Response>;
1631
- };
1632
- POST: {
1633
- GET: (request: Request) => Promise<Response>;
1634
- POST: (request: Request) => Promise<Response>;
1635
- PATCH: (request: Request) => Promise<Response>;
1636
- PUT: (request: Request) => Promise<Response>;
1637
- DELETE: (request: Request) => Promise<Response>;
1638
- };
1639
- };
1640
- getSession: () => Promise<SessionResult>;
1641
- getSessionFromHeaders: (requestHeaders: Headers) => Promise<SessionResult>;
1642
- isAuthenticated: () => Promise<boolean>;
1643
- getUser: () => Promise<{
1644
- id: string;
1645
- createdAt: Date;
1646
- updatedAt: Date;
1647
- email: string;
1648
- emailVerified: boolean;
1649
- name: string;
1650
- image?: string | null | undefined | undefined;
1651
- } | null>;
1652
- makeAuthenticatedCall: <TArgs extends any[], TReturn>(fn: (ctx: {
1653
- user: SessionData["user"];
1654
- session: SessionData["session"];
1655
- db: typeof db;
1656
- }, ...args: TArgs) => Promise<TReturn>) => (...args: TArgs) => Promise<TReturn>;
1657
- };
98
+ /**
99
+ * Configuration for the Hyle database connection.
100
+ */
101
+ interface HyleDbConfig {
102
+ /** Turso/LibSQL database URL */
103
+ url: string;
104
+ /** Authentication token for the database (required for remote Turso databases) */
105
+ authToken?: string;
106
+ }
107
+ /**
108
+ * Creates a database connection with the provided configuration.
109
+ *
110
+ * @param config - Database configuration
111
+ * @returns A Drizzle database instance
112
+ *
113
+ * @example
114
+ * ```typescript
115
+ * // In your server-side code (e.g., lib/db.ts)
116
+ * import { createDb } from "hylekit";
117
+ *
118
+ * export const db = createDb({
119
+ * url: process.env.HYLE_DATABASE_URL!,
120
+ * authToken: process.env.HYLE_DATABASE_AUTH_TOKEN,
121
+ * });
122
+ * ```
123
+ *
124
+ * @throws Error if called on the client side
125
+ */
126
+ declare function createDb(config: HyleDbConfig): drizzle_orm_libsql.LibSQLDatabase<typeof schema> & {
127
+ $client: _libsql_client.Client;
1658
128
  };
1659
129
 
1660
130
  declare const bff: {
1661
- createNextJsBff: (baseUrlOrConfig: string | BffClientConfig) => NextJsBffClient;
131
+ createNextJsBff: (auth: better_auth.Auth<better_auth.BetterAuthOptions>, baseUrlOrConfig: string | BffClientConfig) => NextJsBffClient;
1662
132
  createSvelteKitBff: (baseUrlOrConfig: string | BffClientConfig) => SvelteKitBffClient;
1663
133
  };
1664
134
 
1665
135
  declare const hyle: {
1666
- auth: better_auth.Auth<{
1667
- database: (options: better_auth.BetterAuthOptions) => better_auth.DBAdapter<better_auth.BetterAuthOptions>;
1668
- baseURL: string | undefined;
1669
- secret: string | undefined;
1670
- trustedOrigins: string[] | undefined;
1671
- socialProviders: {
1672
- google: {
1673
- clientId: string;
1674
- clientSecret: string;
1675
- };
1676
- };
1677
- session: {
1678
- expiresIn: number;
1679
- updateAge: number;
1680
- cookieCache: {
1681
- enabled: true;
1682
- maxAge: number;
1683
- };
1684
- };
1685
- }>;
1686
- db: drizzle_orm_libsql.LibSQLDatabase<typeof schema> & {
1687
- $client: _libsql_client.Client;
1688
- };
136
+ createDb: typeof createDb;
137
+ createAuth: typeof createAuth;
1689
138
  schema: typeof schema;
1690
- client: {
1691
- sveltekit: {
1692
- login: {
1693
- social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1694
- 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 & {});
1695
- callbackURL?: string | undefined;
1696
- newUserCallbackURL?: string | undefined;
1697
- errorCallbackURL?: string | undefined;
1698
- disableRedirect?: boolean | undefined;
1699
- idToken?: {
1700
- token: string;
1701
- nonce?: string | undefined;
1702
- accessToken?: string | undefined;
1703
- refreshToken?: string | undefined;
1704
- expiresAt?: number | undefined;
1705
- } | undefined;
1706
- scopes?: string[] | undefined;
1707
- requestSignUp?: boolean | undefined;
1708
- loginHint?: string | undefined;
1709
- additionalData?: Record<string, any> | undefined;
1710
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1711
- 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 & {});
1712
- callbackURL?: string | undefined;
1713
- newUserCallbackURL?: string | undefined;
1714
- errorCallbackURL?: string | undefined;
1715
- disableRedirect?: boolean | undefined;
1716
- idToken?: {
1717
- token: string;
1718
- nonce?: string | undefined;
1719
- accessToken?: string | undefined;
1720
- refreshToken?: string | undefined;
1721
- expiresAt?: number | undefined;
1722
- } | undefined;
1723
- scopes?: string[] | undefined;
1724
- requestSignUp?: boolean | undefined;
1725
- loginHint?: string | undefined;
1726
- additionalData?: Record<string, any> | undefined;
1727
- } & {
1728
- fetchOptions?: FetchOptions | undefined;
1729
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<{
1730
- redirect: boolean;
1731
- url: string;
1732
- } | {
1733
- redirect: boolean;
1734
- token: string;
1735
- url: undefined;
1736
- user: {
1737
- id: string;
1738
- createdAt: Date;
1739
- updatedAt: Date;
1740
- email: string;
1741
- emailVerified: boolean;
1742
- name: string;
1743
- image?: string | null | undefined | undefined;
1744
- };
1745
- }>, {
1746
- code?: string | undefined;
1747
- message?: string | undefined;
1748
- }, FetchOptions["throw"] extends true ? true : false>>;
1749
- } & {
1750
- email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1751
- email: string;
1752
- password: string;
1753
- callbackURL?: string | undefined;
1754
- rememberMe?: boolean | undefined;
1755
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1756
- email: string;
1757
- password: string;
1758
- callbackURL?: string | undefined;
1759
- rememberMe?: boolean | undefined;
1760
- } & {
1761
- fetchOptions?: FetchOptions | undefined;
1762
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1763
- redirect: boolean;
1764
- token: string;
1765
- url?: string | undefined;
1766
- user: {
1767
- id: string;
1768
- createdAt: Date;
1769
- updatedAt: Date;
1770
- email: string;
1771
- emailVerified: boolean;
1772
- name: string;
1773
- image?: string | null | undefined | undefined;
1774
- };
1775
- }, {
1776
- code?: string | undefined;
1777
- message?: string | undefined;
1778
- }, FetchOptions["throw"] extends true ? true : false>>;
1779
- };
1780
- signIn: {
1781
- social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1782
- 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 & {});
1783
- callbackURL?: string | undefined;
1784
- newUserCallbackURL?: string | undefined;
1785
- errorCallbackURL?: string | undefined;
1786
- disableRedirect?: boolean | undefined;
1787
- idToken?: {
1788
- token: string;
1789
- nonce?: string | undefined;
1790
- accessToken?: string | undefined;
1791
- refreshToken?: string | undefined;
1792
- expiresAt?: number | undefined;
1793
- } | undefined;
1794
- scopes?: string[] | undefined;
1795
- requestSignUp?: boolean | undefined;
1796
- loginHint?: string | undefined;
1797
- additionalData?: Record<string, any> | undefined;
1798
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1799
- 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 & {});
1800
- callbackURL?: string | undefined;
1801
- newUserCallbackURL?: string | undefined;
1802
- errorCallbackURL?: string | undefined;
1803
- disableRedirect?: boolean | undefined;
1804
- idToken?: {
1805
- token: string;
1806
- nonce?: string | undefined;
1807
- accessToken?: string | undefined;
1808
- refreshToken?: string | undefined;
1809
- expiresAt?: number | undefined;
1810
- } | undefined;
1811
- scopes?: string[] | undefined;
1812
- requestSignUp?: boolean | undefined;
1813
- loginHint?: string | undefined;
1814
- additionalData?: Record<string, any> | undefined;
1815
- } & {
1816
- fetchOptions?: FetchOptions | undefined;
1817
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<{
1818
- redirect: boolean;
1819
- url: string;
1820
- } | {
1821
- redirect: boolean;
1822
- token: string;
1823
- url: undefined;
1824
- user: {
1825
- id: string;
1826
- createdAt: Date;
1827
- updatedAt: Date;
1828
- email: string;
1829
- emailVerified: boolean;
1830
- name: string;
1831
- image?: string | null | undefined | undefined;
1832
- };
1833
- }>, {
1834
- code?: string | undefined;
1835
- message?: string | undefined;
1836
- }, FetchOptions["throw"] extends true ? true : false>>;
1837
- } & {
1838
- email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1839
- email: string;
1840
- password: string;
1841
- callbackURL?: string | undefined;
1842
- rememberMe?: boolean | undefined;
1843
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1844
- email: string;
1845
- password: string;
1846
- callbackURL?: string | undefined;
1847
- rememberMe?: boolean | undefined;
1848
- } & {
1849
- fetchOptions?: FetchOptions | undefined;
1850
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1851
- redirect: boolean;
1852
- token: string;
1853
- url?: string | undefined;
1854
- user: {
1855
- id: string;
1856
- createdAt: Date;
1857
- updatedAt: Date;
1858
- email: string;
1859
- emailVerified: boolean;
1860
- name: string;
1861
- image?: string | null | undefined | undefined;
1862
- };
1863
- }, {
1864
- code?: string | undefined;
1865
- message?: string | undefined;
1866
- }, FetchOptions["throw"] extends true ? true : false>>;
1867
- };
1868
- signOut: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1869
- query?: Record<string, any> | undefined;
1870
- fetchOptions?: FetchOptions | undefined;
1871
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1872
- success: boolean;
1873
- }, {
1874
- code?: string | undefined;
1875
- message?: string | undefined;
1876
- }, FetchOptions["throw"] extends true ? true : false>>;
1877
- signUp: {
1878
- email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1879
- name: string;
1880
- email: string;
1881
- password: string;
1882
- image?: string | undefined;
1883
- callbackURL?: string | undefined;
1884
- rememberMe?: boolean | undefined;
1885
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1886
- email: string;
1887
- name: string;
1888
- password: string;
1889
- image?: string | undefined;
1890
- callbackURL?: string | undefined;
1891
- fetchOptions?: FetchOptions | undefined;
1892
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<{
1893
- token: null;
1894
- user: {
1895
- id: string;
1896
- createdAt: Date;
1897
- updatedAt: Date;
1898
- email: string;
1899
- emailVerified: boolean;
1900
- name: string;
1901
- image?: string | null | undefined | undefined;
1902
- };
1903
- } | {
1904
- token: string;
1905
- user: {
1906
- id: string;
1907
- createdAt: Date;
1908
- updatedAt: Date;
1909
- email: string;
1910
- emailVerified: boolean;
1911
- name: string;
1912
- image?: string | null | undefined | undefined;
1913
- };
1914
- }>, {
1915
- code?: string | undefined;
1916
- message?: string | undefined;
1917
- }, FetchOptions["throw"] extends true ? true : false>>;
1918
- };
1919
- resetPassword: (<FetchOptions extends better_auth.ClientFetchOption<Partial<{
1920
- newPassword: string;
1921
- token?: string | undefined;
1922
- }> & Record<string, any>, Partial<{
1923
- token?: string | undefined;
1924
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1925
- newPassword: string;
1926
- token?: string | undefined;
1927
- } & {
1928
- fetchOptions?: FetchOptions | undefined;
1929
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1930
- status: boolean;
1931
- }, {
1932
- code?: string | undefined;
1933
- message?: string | undefined;
1934
- }, FetchOptions["throw"] extends true ? true : false>>) & {
1935
- ":token": <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1936
- callbackURL: string;
1937
- }> & Record<string, any>, {
1938
- token: string;
1939
- }>>(data_0: better_auth.Prettify<{
1940
- query: {
1941
- callbackURL: string;
1942
- };
1943
- fetchOptions?: FetchOptions | undefined;
1944
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<never, {
1945
- code?: string | undefined;
1946
- message?: string | undefined;
1947
- }, FetchOptions["throw"] extends true ? true : false>>;
1948
- };
1949
- verifyEmail: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1950
- token: string;
1951
- callbackURL?: string | undefined;
1952
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1953
- query: {
1954
- token: string;
1955
- callbackURL?: string | undefined;
1956
- };
1957
- fetchOptions?: FetchOptions | undefined;
1958
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<void | {
1959
- status: boolean;
1960
- }>, {
1961
- code?: string | undefined;
1962
- message?: string | undefined;
1963
- }, FetchOptions["throw"] extends true ? true : false>>;
1964
- sendVerificationEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1965
- email: string;
1966
- callbackURL?: string | undefined;
1967
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1968
- email: string;
1969
- callbackURL?: string | undefined;
1970
- } & {
1971
- fetchOptions?: FetchOptions | undefined;
1972
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1973
- status: boolean;
1974
- }, {
1975
- code?: string | undefined;
1976
- message?: string | undefined;
1977
- }, FetchOptions["throw"] extends true ? true : false>>;
1978
- changeEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1979
- newEmail: string;
1980
- callbackURL?: string | undefined;
1981
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1982
- newEmail: string;
1983
- callbackURL?: string | undefined;
1984
- } & {
1985
- fetchOptions?: FetchOptions | undefined;
1986
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
1987
- status: boolean;
1988
- }, {
1989
- code?: string | undefined;
1990
- message?: string | undefined;
1991
- }, FetchOptions["throw"] extends true ? true : false>>;
1992
- changePassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1993
- newPassword: string;
1994
- currentPassword: string;
1995
- revokeOtherSessions?: boolean | undefined;
1996
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1997
- newPassword: string;
1998
- currentPassword: string;
1999
- revokeOtherSessions?: boolean | undefined;
2000
- } & {
2001
- fetchOptions?: FetchOptions | undefined;
2002
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2003
- token: string | null;
2004
- user: {
2005
- id: string;
2006
- email: string;
2007
- name: string;
2008
- image: string | null | undefined;
2009
- emailVerified: boolean;
2010
- createdAt: Date;
2011
- updatedAt: Date;
2012
- };
2013
- }, {
2014
- code?: string | undefined;
2015
- message?: string | undefined;
2016
- }, FetchOptions["throw"] extends true ? true : false>>;
2017
- updateUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<Partial<{}> & {
2018
- name?: string | undefined;
2019
- image?: string | undefined | null;
2020
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2021
- image?: (string | null) | undefined;
2022
- name?: string | undefined;
2023
- fetchOptions?: FetchOptions | undefined;
2024
- } & Partial<{}>> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2025
- status: boolean;
2026
- }, {
2027
- code?: string | undefined;
2028
- message?: string | undefined;
2029
- }, FetchOptions["throw"] extends true ? true : false>>;
2030
- deleteUser: (<FetchOptions extends better_auth.ClientFetchOption<Partial<{
2031
- callbackURL?: string | undefined;
2032
- password?: string | undefined;
2033
- token?: string | undefined;
2034
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2035
- callbackURL?: string | undefined;
2036
- password?: string | undefined;
2037
- token?: string | undefined;
2038
- } & {
2039
- fetchOptions?: FetchOptions | undefined;
2040
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2041
- success: boolean;
2042
- message: string;
2043
- }, {
2044
- code?: string | undefined;
2045
- message?: string | undefined;
2046
- }, FetchOptions["throw"] extends true ? true : false>>) & {
2047
- callback: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
2048
- token: string;
2049
- callbackURL?: string | undefined;
2050
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2051
- query: {
2052
- token: string;
2053
- callbackURL?: string | undefined;
2054
- };
2055
- fetchOptions?: FetchOptions | undefined;
2056
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2057
- success: boolean;
2058
- message: string;
2059
- }, {
2060
- code?: string | undefined;
2061
- message?: string | undefined;
2062
- }, FetchOptions["throw"] extends true ? true : false>>;
2063
- };
2064
- requestPasswordReset: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2065
- email: string;
2066
- redirectTo?: string | undefined;
2067
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2068
- email: string;
2069
- redirectTo?: string | undefined;
2070
- } & {
2071
- fetchOptions?: FetchOptions | undefined;
2072
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2073
- status: boolean;
2074
- message: string;
2075
- }, {
2076
- code?: string | undefined;
2077
- message?: string | undefined;
2078
- }, FetchOptions["throw"] extends true ? true : false>>;
2079
- listSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2080
- query?: Record<string, any> | undefined;
2081
- fetchOptions?: FetchOptions | undefined;
2082
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<better_auth.Prettify<{
2083
- id: string;
2084
- createdAt: Date;
2085
- updatedAt: Date;
2086
- userId: string;
2087
- expiresAt: Date;
2088
- token: string;
2089
- ipAddress?: string | null | undefined | undefined;
2090
- userAgent?: string | null | undefined | undefined;
2091
- }>[], {
2092
- code?: string | undefined;
2093
- message?: string | undefined;
2094
- }, FetchOptions["throw"] extends true ? true : false>>;
2095
- revokeSession: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2096
- token: string;
2097
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2098
- token: string;
2099
- } & {
2100
- fetchOptions?: FetchOptions | undefined;
2101
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2102
- status: boolean;
2103
- }, {
2104
- code?: string | undefined;
2105
- message?: string | undefined;
2106
- }, FetchOptions["throw"] extends true ? true : false>>;
2107
- revokeSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2108
- query?: Record<string, any> | undefined;
2109
- fetchOptions?: FetchOptions | undefined;
2110
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2111
- status: boolean;
2112
- }, {
2113
- code?: string | undefined;
2114
- message?: string | undefined;
2115
- }, FetchOptions["throw"] extends true ? true : false>>;
2116
- revokeOtherSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2117
- query?: Record<string, any> | undefined;
2118
- fetchOptions?: FetchOptions | undefined;
2119
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2120
- status: boolean;
2121
- }, {
2122
- code?: string | undefined;
2123
- message?: string | undefined;
2124
- }, FetchOptions["throw"] extends true ? true : false>>;
2125
- linkSocial: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2126
- provider: unknown;
2127
- callbackURL?: string | undefined;
2128
- idToken?: {
2129
- token: string;
2130
- nonce?: string | undefined;
2131
- accessToken?: string | undefined;
2132
- refreshToken?: string | undefined;
2133
- scopes?: string[] | undefined;
2134
- } | undefined;
2135
- requestSignUp?: boolean | undefined;
2136
- scopes?: string[] | undefined;
2137
- errorCallbackURL?: string | undefined;
2138
- disableRedirect?: boolean | undefined;
2139
- additionalData?: Record<string, any> | undefined;
2140
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2141
- provider: unknown;
2142
- callbackURL?: string | undefined;
2143
- idToken?: {
2144
- token: string;
2145
- nonce?: string | undefined;
2146
- accessToken?: string | undefined;
2147
- refreshToken?: string | undefined;
2148
- scopes?: string[] | undefined;
2149
- } | undefined;
2150
- requestSignUp?: boolean | undefined;
2151
- scopes?: string[] | undefined;
2152
- errorCallbackURL?: string | undefined;
2153
- disableRedirect?: boolean | undefined;
2154
- additionalData?: Record<string, any> | undefined;
2155
- } & {
2156
- fetchOptions?: FetchOptions | undefined;
2157
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2158
- url: string;
2159
- redirect: boolean;
2160
- }, {
2161
- code?: string | undefined;
2162
- message?: string | undefined;
2163
- }, FetchOptions["throw"] extends true ? true : false>>;
2164
- listAccounts: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2165
- query?: Record<string, any> | undefined;
2166
- fetchOptions?: FetchOptions | undefined;
2167
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2168
- id: string;
2169
- providerId: string;
2170
- createdAt: Date;
2171
- updatedAt: Date;
2172
- accountId: string;
2173
- userId: string;
2174
- scopes: string[];
2175
- }[], {
2176
- code?: string | undefined;
2177
- message?: string | undefined;
2178
- }, FetchOptions["throw"] extends true ? true : false>>;
2179
- unlinkAccount: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2180
- providerId: string;
2181
- accountId?: string | undefined;
2182
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2183
- providerId: string;
2184
- accountId?: string | undefined;
2185
- } & {
2186
- fetchOptions?: FetchOptions | undefined;
2187
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2188
- status: boolean;
2189
- }, {
2190
- code?: string | undefined;
2191
- message?: string | undefined;
2192
- }, FetchOptions["throw"] extends true ? true : false>>;
2193
- refreshToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2194
- providerId: string;
2195
- accountId?: string | undefined;
2196
- userId?: string | undefined;
2197
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2198
- providerId: string;
2199
- accountId?: string | undefined;
2200
- userId?: string | undefined;
2201
- } & {
2202
- fetchOptions?: FetchOptions | undefined;
2203
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2204
- accessToken: string | undefined;
2205
- refreshToken: string | undefined;
2206
- accessTokenExpiresAt: Date | undefined;
2207
- refreshTokenExpiresAt: Date | undefined;
2208
- scope: string | null | undefined;
2209
- idToken: string | null | undefined;
2210
- providerId: string;
2211
- accountId: string;
2212
- }, {
2213
- code?: string | undefined;
2214
- message?: string | undefined;
2215
- }, FetchOptions["throw"] extends true ? true : false>>;
2216
- getAccessToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2217
- providerId: string;
2218
- accountId?: string | undefined;
2219
- userId?: string | undefined;
2220
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2221
- providerId: string;
2222
- accountId?: string | undefined;
2223
- userId?: string | undefined;
2224
- } & {
2225
- fetchOptions?: FetchOptions | undefined;
2226
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2227
- accessToken: string;
2228
- accessTokenExpiresAt: Date | undefined;
2229
- scopes: string[];
2230
- idToken: string | undefined;
2231
- }, {
2232
- code?: string | undefined;
2233
- message?: string | undefined;
2234
- }, FetchOptions["throw"] extends true ? true : false>>;
2235
- accountInfo: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
2236
- accountId?: string | undefined;
2237
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2238
- query?: {
2239
- accountId?: string | undefined;
2240
- } | undefined;
2241
- fetchOptions?: FetchOptions | undefined;
2242
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2243
- user: better_auth.OAuth2UserInfo;
2244
- data: Record<string, any>;
2245
- }, {
2246
- code?: string | undefined;
2247
- message?: string | undefined;
2248
- }, FetchOptions["throw"] extends true ? true : false>>;
2249
- getSession: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
2250
- disableCookieCache?: unknown;
2251
- disableRefresh?: unknown;
2252
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2253
- query?: {
2254
- disableCookieCache?: unknown;
2255
- disableRefresh?: unknown;
2256
- } | undefined;
2257
- fetchOptions?: FetchOptions | undefined;
2258
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2259
- user: {
2260
- id: string;
2261
- createdAt: Date;
2262
- updatedAt: Date;
2263
- email: string;
2264
- emailVerified: boolean;
2265
- name: string;
2266
- image?: string | null | undefined;
2267
- };
2268
- session: {
2269
- id: string;
2270
- createdAt: Date;
2271
- updatedAt: Date;
2272
- userId: string;
2273
- expiresAt: Date;
2274
- token: string;
2275
- ipAddress?: string | null | undefined;
2276
- userAgent?: string | null | undefined;
2277
- };
2278
- } | null, {
2279
- code?: string | undefined;
2280
- message?: string | undefined;
2281
- }, FetchOptions["throw"] extends true ? true : false>>;
2282
- useSession: () => nanostores.Atom<{
2283
- data: {
2284
- user: {
2285
- id: string;
2286
- createdAt: Date;
2287
- updatedAt: Date;
2288
- email: string;
2289
- emailVerified: boolean;
2290
- name: string;
2291
- image?: string | null | undefined;
2292
- };
2293
- session: {
2294
- id: string;
2295
- createdAt: Date;
2296
- updatedAt: Date;
2297
- userId: string;
2298
- expiresAt: Date;
2299
- token: string;
2300
- ipAddress?: string | null | undefined;
2301
- userAgent?: string | null | undefined;
2302
- };
2303
- } | null;
2304
- error: _better_fetch_fetch.BetterFetchError | null;
2305
- isPending: boolean;
2306
- isRefetching: boolean;
2307
- refetch: (queryParams?: {
2308
- query?: better_auth.SessionQueryParams;
2309
- } | undefined) => Promise<void>;
2310
- }>;
2311
- $fetch: _better_fetch_fetch.BetterFetch<{
2312
- plugins: (_better_fetch_fetch.BetterFetchPlugin<Record<string, any>> | {
2313
- id: string;
2314
- name: string;
2315
- hooks: {
2316
- onSuccess(context: _better_fetch_fetch.SuccessContext<any>): void;
2317
- };
2318
- } | {
2319
- id: string;
2320
- name: string;
2321
- hooks: {
2322
- onSuccess: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
2323
- onError: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
2324
- onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
2325
- onResponse: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
2326
- };
2327
- })[];
2328
- cache?: RequestCache | undefined;
2329
- method: string;
2330
- window?: null | undefined;
2331
- headers?: (HeadersInit & (HeadersInit | {
2332
- accept: "application/json" | "text/plain" | "application/octet-stream";
2333
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
2334
- authorization: "Bearer" | "Basic";
2335
- })) | undefined;
2336
- redirect?: RequestRedirect | undefined;
2337
- credentials?: RequestCredentials;
2338
- integrity?: string | undefined;
2339
- keepalive?: boolean | undefined;
2340
- mode?: RequestMode | undefined;
2341
- priority?: RequestPriority | undefined;
2342
- referrer?: string | undefined;
2343
- referrerPolicy?: ReferrerPolicy | undefined;
2344
- signal?: (AbortSignal | null) | undefined;
2345
- onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
2346
- hookOptions?: {
2347
- cloneResponse?: boolean;
2348
- } | undefined;
2349
- timeout?: number | undefined;
2350
- customFetchImpl: _better_fetch_fetch.FetchEsque;
2351
- baseURL: string;
2352
- throw?: boolean | undefined;
2353
- auth?: ({
2354
- type: "Bearer";
2355
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
2356
- } | {
2357
- type: "Basic";
2358
- username: string | (() => string | undefined) | undefined;
2359
- password: string | (() => string | undefined) | undefined;
2360
- } | {
2361
- type: "Custom";
2362
- prefix: string | (() => string | undefined) | undefined;
2363
- value: string | (() => string | undefined) | undefined;
2364
- }) | undefined;
2365
- body?: any;
2366
- query?: any;
2367
- params?: any;
2368
- duplex?: "full" | "half" | undefined;
2369
- jsonParser: (text: string) => Promise<any> | any;
2370
- retry?: _better_fetch_fetch.RetryOptions | undefined;
2371
- retryAttempt?: number | undefined;
2372
- output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
2373
- errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
2374
- disableValidation?: boolean | undefined;
2375
- disableSignal?: boolean | undefined;
2376
- }, unknown, unknown, {}>;
2377
- $store: {
2378
- notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
2379
- listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
2380
- atoms: Record<string, nanostores.WritableAtom<any>>;
2381
- };
2382
- $Infer: {
2383
- Session: {
2384
- user: {
2385
- id: string;
2386
- createdAt: Date;
2387
- updatedAt: Date;
2388
- email: string;
2389
- emailVerified: boolean;
2390
- name: string;
2391
- image?: string | null | undefined;
2392
- };
2393
- session: {
2394
- id: string;
2395
- createdAt: Date;
2396
- updatedAt: Date;
2397
- userId: string;
2398
- expiresAt: Date;
2399
- token: string;
2400
- ipAddress?: string | null | undefined;
2401
- userAgent?: string | null | undefined;
2402
- };
2403
- };
2404
- };
2405
- $ERROR_CODES: {
2406
- readonly USER_NOT_FOUND: "User not found";
2407
- readonly FAILED_TO_CREATE_USER: "Failed to create user";
2408
- readonly FAILED_TO_CREATE_SESSION: "Failed to create session";
2409
- readonly FAILED_TO_UPDATE_USER: "Failed to update user";
2410
- readonly FAILED_TO_GET_SESSION: "Failed to get session";
2411
- readonly INVALID_PASSWORD: "Invalid password";
2412
- readonly INVALID_EMAIL: "Invalid email";
2413
- readonly INVALID_EMAIL_OR_PASSWORD: "Invalid email or password";
2414
- readonly SOCIAL_ACCOUNT_ALREADY_LINKED: "Social account already linked";
2415
- readonly PROVIDER_NOT_FOUND: "Provider not found";
2416
- readonly INVALID_TOKEN: "Invalid token";
2417
- readonly ID_TOKEN_NOT_SUPPORTED: "id_token not supported";
2418
- readonly FAILED_TO_GET_USER_INFO: "Failed to get user info";
2419
- readonly USER_EMAIL_NOT_FOUND: "User email not found";
2420
- readonly EMAIL_NOT_VERIFIED: "Email not verified";
2421
- readonly PASSWORD_TOO_SHORT: "Password too short";
2422
- readonly PASSWORD_TOO_LONG: "Password too long";
2423
- readonly USER_ALREADY_EXISTS: "User already exists.";
2424
- readonly USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: "User already exists. Use another email.";
2425
- readonly EMAIL_CAN_NOT_BE_UPDATED: "Email can not be updated";
2426
- readonly CREDENTIAL_ACCOUNT_NOT_FOUND: "Credential account not found";
2427
- readonly SESSION_EXPIRED: "Session expired. Re-authenticate to perform this action.";
2428
- readonly FAILED_TO_UNLINK_LAST_ACCOUNT: "You can't unlink your last account";
2429
- readonly ACCOUNT_NOT_FOUND: "Account not found";
2430
- readonly USER_ALREADY_HAS_PASSWORD: "User already has a password. Provide that to delete the account.";
2431
- readonly CROSS_SITE_NAVIGATION_LOGIN_BLOCKED: "Cross-site navigation login blocked. This request appears to be a CSRF attack.";
2432
- readonly VERIFICATION_EMAIL_NOT_ENABLED: "Verification email isn't enabled";
2433
- readonly EMAIL_ALREADY_VERIFIED: "Email is already verified";
2434
- readonly EMAIL_MISMATCH: "Email mismatch";
2435
- readonly SESSION_NOT_FRESH: "Session is not fresh";
2436
- readonly LINKED_ACCOUNT_ALREADY_EXISTS: "Linked account already exists";
2437
- readonly INVALID_ORIGIN: "Invalid origin";
2438
- readonly INVALID_CALLBACK_URL: "Invalid callbackURL";
2439
- readonly INVALID_REDIRECT_URL: "Invalid redirectURL";
2440
- readonly INVALID_ERROR_CALLBACK_URL: "Invalid errorCallbackURL";
2441
- readonly INVALID_NEW_USER_CALLBACK_URL: "Invalid newUserCallbackURL";
2442
- readonly MISSING_OR_NULL_ORIGIN: "Missing or null Origin";
2443
- readonly CALLBACK_URL_REQUIRED: "callbackURL is required";
2444
- readonly FAILED_TO_CREATE_VERIFICATION: "Unable to create verification";
2445
- readonly FIELD_NOT_ALLOWED: "Field not allowed to be set";
2446
- readonly ASYNC_VALIDATION_NOT_SUPPORTED: "Async validation is not supported";
2447
- readonly VALIDATION_ERROR: "Validation Error";
2448
- readonly MISSING_FIELD: "Field is required";
2449
- };
2450
- };
2451
- nextjs: {
2452
- login: {
2453
- social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2454
- 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 & {});
2455
- callbackURL?: string | undefined;
2456
- newUserCallbackURL?: string | undefined;
2457
- errorCallbackURL?: string | undefined;
2458
- disableRedirect?: boolean | undefined;
2459
- idToken?: {
2460
- token: string;
2461
- nonce?: string | undefined;
2462
- accessToken?: string | undefined;
2463
- refreshToken?: string | undefined;
2464
- expiresAt?: number | undefined;
2465
- } | undefined;
2466
- scopes?: string[] | undefined;
2467
- requestSignUp?: boolean | undefined;
2468
- loginHint?: string | undefined;
2469
- additionalData?: Record<string, any> | undefined;
2470
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2471
- 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 & {});
2472
- callbackURL?: string | undefined;
2473
- newUserCallbackURL?: string | undefined;
2474
- errorCallbackURL?: string | undefined;
2475
- disableRedirect?: boolean | undefined;
2476
- idToken?: {
2477
- token: string;
2478
- nonce?: string | undefined;
2479
- accessToken?: string | undefined;
2480
- refreshToken?: string | undefined;
2481
- expiresAt?: number | undefined;
2482
- } | undefined;
2483
- scopes?: string[] | undefined;
2484
- requestSignUp?: boolean | undefined;
2485
- loginHint?: string | undefined;
2486
- additionalData?: Record<string, any> | undefined;
2487
- } & {
2488
- fetchOptions?: FetchOptions | undefined;
2489
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<{
2490
- redirect: boolean;
2491
- url: string;
2492
- } | {
2493
- redirect: boolean;
2494
- token: string;
2495
- url: undefined;
2496
- user: {
2497
- id: string;
2498
- createdAt: Date;
2499
- updatedAt: Date;
2500
- email: string;
2501
- emailVerified: boolean;
2502
- name: string;
2503
- image?: string | null | undefined | undefined;
2504
- };
2505
- }>, {
2506
- code?: string | undefined;
2507
- message?: string | undefined;
2508
- }, FetchOptions["throw"] extends true ? true : false>>;
2509
- } & {
2510
- email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2511
- email: string;
2512
- password: string;
2513
- callbackURL?: string | undefined;
2514
- rememberMe?: boolean | undefined;
2515
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2516
- email: string;
2517
- password: string;
2518
- callbackURL?: string | undefined;
2519
- rememberMe?: boolean | undefined;
2520
- } & {
2521
- fetchOptions?: FetchOptions | undefined;
2522
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2523
- redirect: boolean;
2524
- token: string;
2525
- url?: string | undefined;
2526
- user: {
2527
- id: string;
2528
- createdAt: Date;
2529
- updatedAt: Date;
2530
- email: string;
2531
- emailVerified: boolean;
2532
- name: string;
2533
- image?: string | null | undefined | undefined;
2534
- };
2535
- }, {
2536
- code?: string | undefined;
2537
- message?: string | undefined;
2538
- }, FetchOptions["throw"] extends true ? true : false>>;
2539
- };
2540
- signIn: {
2541
- social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2542
- 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 & {});
2543
- callbackURL?: string | undefined;
2544
- newUserCallbackURL?: string | undefined;
2545
- errorCallbackURL?: string | undefined;
2546
- disableRedirect?: boolean | undefined;
2547
- idToken?: {
2548
- token: string;
2549
- nonce?: string | undefined;
2550
- accessToken?: string | undefined;
2551
- refreshToken?: string | undefined;
2552
- expiresAt?: number | undefined;
2553
- } | undefined;
2554
- scopes?: string[] | undefined;
2555
- requestSignUp?: boolean | undefined;
2556
- loginHint?: string | undefined;
2557
- additionalData?: Record<string, any> | undefined;
2558
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2559
- 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 & {});
2560
- callbackURL?: string | undefined;
2561
- newUserCallbackURL?: string | undefined;
2562
- errorCallbackURL?: string | undefined;
2563
- disableRedirect?: boolean | undefined;
2564
- idToken?: {
2565
- token: string;
2566
- nonce?: string | undefined;
2567
- accessToken?: string | undefined;
2568
- refreshToken?: string | undefined;
2569
- expiresAt?: number | undefined;
2570
- } | undefined;
2571
- scopes?: string[] | undefined;
2572
- requestSignUp?: boolean | undefined;
2573
- loginHint?: string | undefined;
2574
- additionalData?: Record<string, any> | undefined;
2575
- } & {
2576
- fetchOptions?: FetchOptions | undefined;
2577
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<{
2578
- redirect: boolean;
2579
- url: string;
2580
- } | {
2581
- redirect: boolean;
2582
- token: string;
2583
- url: undefined;
2584
- user: {
2585
- id: string;
2586
- createdAt: Date;
2587
- updatedAt: Date;
2588
- email: string;
2589
- emailVerified: boolean;
2590
- name: string;
2591
- image?: string | null | undefined | undefined;
2592
- };
2593
- }>, {
2594
- code?: string | undefined;
2595
- message?: string | undefined;
2596
- }, FetchOptions["throw"] extends true ? true : false>>;
2597
- } & {
2598
- email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2599
- email: string;
2600
- password: string;
2601
- callbackURL?: string | undefined;
2602
- rememberMe?: boolean | undefined;
2603
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2604
- email: string;
2605
- password: string;
2606
- callbackURL?: string | undefined;
2607
- rememberMe?: boolean | undefined;
2608
- } & {
2609
- fetchOptions?: FetchOptions | undefined;
2610
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2611
- redirect: boolean;
2612
- token: string;
2613
- url?: string | undefined;
2614
- user: {
2615
- id: string;
2616
- createdAt: Date;
2617
- updatedAt: Date;
2618
- email: string;
2619
- emailVerified: boolean;
2620
- name: string;
2621
- image?: string | null | undefined | undefined;
2622
- };
2623
- }, {
2624
- code?: string | undefined;
2625
- message?: string | undefined;
2626
- }, FetchOptions["throw"] extends true ? true : false>>;
2627
- };
2628
- signOut: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2629
- query?: Record<string, any> | undefined;
2630
- fetchOptions?: FetchOptions | undefined;
2631
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2632
- success: boolean;
2633
- }, {
2634
- code?: string | undefined;
2635
- message?: string | undefined;
2636
- }, FetchOptions["throw"] extends true ? true : false>>;
2637
- signUp: {
2638
- email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2639
- name: string;
2640
- email: string;
2641
- password: string;
2642
- image?: string | undefined;
2643
- callbackURL?: string | undefined;
2644
- rememberMe?: boolean | undefined;
2645
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2646
- email: string;
2647
- name: string;
2648
- password: string;
2649
- image?: string | undefined;
2650
- callbackURL?: string | undefined;
2651
- fetchOptions?: FetchOptions | undefined;
2652
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<{
2653
- token: null;
2654
- user: {
2655
- id: string;
2656
- createdAt: Date;
2657
- updatedAt: Date;
2658
- email: string;
2659
- emailVerified: boolean;
2660
- name: string;
2661
- image?: string | null | undefined | undefined;
2662
- };
2663
- } | {
2664
- token: string;
2665
- user: {
2666
- id: string;
2667
- createdAt: Date;
2668
- updatedAt: Date;
2669
- email: string;
2670
- emailVerified: boolean;
2671
- name: string;
2672
- image?: string | null | undefined | undefined;
2673
- };
2674
- }>, {
2675
- code?: string | undefined;
2676
- message?: string | undefined;
2677
- }, FetchOptions["throw"] extends true ? true : false>>;
2678
- };
2679
- resetPassword: (<FetchOptions extends better_auth.ClientFetchOption<Partial<{
2680
- newPassword: string;
2681
- token?: string | undefined;
2682
- }> & Record<string, any>, Partial<{
2683
- token?: string | undefined;
2684
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2685
- newPassword: string;
2686
- token?: string | undefined;
2687
- } & {
2688
- fetchOptions?: FetchOptions | undefined;
2689
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2690
- status: boolean;
2691
- }, {
2692
- code?: string | undefined;
2693
- message?: string | undefined;
2694
- }, FetchOptions["throw"] extends true ? true : false>>) & {
2695
- ":token": <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
2696
- callbackURL: string;
2697
- }> & Record<string, any>, {
2698
- token: string;
2699
- }>>(data_0: better_auth.Prettify<{
2700
- query: {
2701
- callbackURL: string;
2702
- };
2703
- fetchOptions?: FetchOptions | undefined;
2704
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<never, {
2705
- code?: string | undefined;
2706
- message?: string | undefined;
2707
- }, FetchOptions["throw"] extends true ? true : false>>;
2708
- };
2709
- verifyEmail: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
2710
- token: string;
2711
- callbackURL?: string | undefined;
2712
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2713
- query: {
2714
- token: string;
2715
- callbackURL?: string | undefined;
2716
- };
2717
- fetchOptions?: FetchOptions | undefined;
2718
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<void | {
2719
- status: boolean;
2720
- }>, {
2721
- code?: string | undefined;
2722
- message?: string | undefined;
2723
- }, FetchOptions["throw"] extends true ? true : false>>;
2724
- sendVerificationEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2725
- email: string;
2726
- callbackURL?: string | undefined;
2727
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2728
- email: string;
2729
- callbackURL?: string | undefined;
2730
- } & {
2731
- fetchOptions?: FetchOptions | undefined;
2732
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2733
- status: boolean;
2734
- }, {
2735
- code?: string | undefined;
2736
- message?: string | undefined;
2737
- }, FetchOptions["throw"] extends true ? true : false>>;
2738
- changeEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2739
- newEmail: string;
2740
- callbackURL?: string | undefined;
2741
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2742
- newEmail: string;
2743
- callbackURL?: string | undefined;
2744
- } & {
2745
- fetchOptions?: FetchOptions | undefined;
2746
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2747
- status: boolean;
2748
- }, {
2749
- code?: string | undefined;
2750
- message?: string | undefined;
2751
- }, FetchOptions["throw"] extends true ? true : false>>;
2752
- changePassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2753
- newPassword: string;
2754
- currentPassword: string;
2755
- revokeOtherSessions?: boolean | undefined;
2756
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2757
- newPassword: string;
2758
- currentPassword: string;
2759
- revokeOtherSessions?: boolean | undefined;
2760
- } & {
2761
- fetchOptions?: FetchOptions | undefined;
2762
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2763
- token: string | null;
2764
- user: {
2765
- id: string;
2766
- email: string;
2767
- name: string;
2768
- image: string | null | undefined;
2769
- emailVerified: boolean;
2770
- createdAt: Date;
2771
- updatedAt: Date;
2772
- };
2773
- }, {
2774
- code?: string | undefined;
2775
- message?: string | undefined;
2776
- }, FetchOptions["throw"] extends true ? true : false>>;
2777
- updateUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<Partial<{}> & {
2778
- name?: string | undefined;
2779
- image?: string | undefined | null;
2780
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2781
- image?: (string | null) | undefined;
2782
- name?: string | undefined;
2783
- fetchOptions?: FetchOptions | undefined;
2784
- } & Partial<{}>> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2785
- status: boolean;
2786
- }, {
2787
- code?: string | undefined;
2788
- message?: string | undefined;
2789
- }, FetchOptions["throw"] extends true ? true : false>>;
2790
- deleteUser: (<FetchOptions extends better_auth.ClientFetchOption<Partial<{
2791
- callbackURL?: string | undefined;
2792
- password?: string | undefined;
2793
- token?: string | undefined;
2794
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2795
- callbackURL?: string | undefined;
2796
- password?: string | undefined;
2797
- token?: string | undefined;
2798
- } & {
2799
- fetchOptions?: FetchOptions | undefined;
2800
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2801
- success: boolean;
2802
- message: string;
2803
- }, {
2804
- code?: string | undefined;
2805
- message?: string | undefined;
2806
- }, FetchOptions["throw"] extends true ? true : false>>) & {
2807
- callback: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
2808
- token: string;
2809
- callbackURL?: string | undefined;
2810
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2811
- query: {
2812
- token: string;
2813
- callbackURL?: string | undefined;
2814
- };
2815
- fetchOptions?: FetchOptions | undefined;
2816
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2817
- success: boolean;
2818
- message: string;
2819
- }, {
2820
- code?: string | undefined;
2821
- message?: string | undefined;
2822
- }, FetchOptions["throw"] extends true ? true : false>>;
2823
- };
2824
- requestPasswordReset: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2825
- email: string;
2826
- redirectTo?: string | undefined;
2827
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2828
- email: string;
2829
- redirectTo?: string | undefined;
2830
- } & {
2831
- fetchOptions?: FetchOptions | undefined;
2832
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2833
- status: boolean;
2834
- message: string;
2835
- }, {
2836
- code?: string | undefined;
2837
- message?: string | undefined;
2838
- }, FetchOptions["throw"] extends true ? true : false>>;
2839
- listSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2840
- query?: Record<string, any> | undefined;
2841
- fetchOptions?: FetchOptions | undefined;
2842
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<better_auth.Prettify<{
2843
- id: string;
2844
- createdAt: Date;
2845
- updatedAt: Date;
2846
- userId: string;
2847
- expiresAt: Date;
2848
- token: string;
2849
- ipAddress?: string | null | undefined | undefined;
2850
- userAgent?: string | null | undefined | undefined;
2851
- }>[], {
2852
- code?: string | undefined;
2853
- message?: string | undefined;
2854
- }, FetchOptions["throw"] extends true ? true : false>>;
2855
- revokeSession: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2856
- token: string;
2857
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2858
- token: string;
2859
- } & {
2860
- fetchOptions?: FetchOptions | undefined;
2861
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2862
- status: boolean;
2863
- }, {
2864
- code?: string | undefined;
2865
- message?: string | undefined;
2866
- }, FetchOptions["throw"] extends true ? true : false>>;
2867
- revokeSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2868
- query?: Record<string, any> | undefined;
2869
- fetchOptions?: FetchOptions | undefined;
2870
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2871
- status: boolean;
2872
- }, {
2873
- code?: string | undefined;
2874
- message?: string | undefined;
2875
- }, FetchOptions["throw"] extends true ? true : false>>;
2876
- revokeOtherSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2877
- query?: Record<string, any> | undefined;
2878
- fetchOptions?: FetchOptions | undefined;
2879
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2880
- status: boolean;
2881
- }, {
2882
- code?: string | undefined;
2883
- message?: string | undefined;
2884
- }, FetchOptions["throw"] extends true ? true : false>>;
2885
- linkSocial: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2886
- provider: unknown;
2887
- callbackURL?: string | undefined;
2888
- idToken?: {
2889
- token: string;
2890
- nonce?: string | undefined;
2891
- accessToken?: string | undefined;
2892
- refreshToken?: string | undefined;
2893
- scopes?: string[] | undefined;
2894
- } | undefined;
2895
- requestSignUp?: boolean | undefined;
2896
- scopes?: string[] | undefined;
2897
- errorCallbackURL?: string | undefined;
2898
- disableRedirect?: boolean | undefined;
2899
- additionalData?: Record<string, any> | undefined;
2900
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2901
- provider: unknown;
2902
- callbackURL?: string | undefined;
2903
- idToken?: {
2904
- token: string;
2905
- nonce?: string | undefined;
2906
- accessToken?: string | undefined;
2907
- refreshToken?: string | undefined;
2908
- scopes?: string[] | undefined;
2909
- } | undefined;
2910
- requestSignUp?: boolean | undefined;
2911
- scopes?: string[] | undefined;
2912
- errorCallbackURL?: string | undefined;
2913
- disableRedirect?: boolean | undefined;
2914
- additionalData?: Record<string, any> | undefined;
2915
- } & {
2916
- fetchOptions?: FetchOptions | undefined;
2917
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2918
- url: string;
2919
- redirect: boolean;
2920
- }, {
2921
- code?: string | undefined;
2922
- message?: string | undefined;
2923
- }, FetchOptions["throw"] extends true ? true : false>>;
2924
- listAccounts: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2925
- query?: Record<string, any> | undefined;
2926
- fetchOptions?: FetchOptions | undefined;
2927
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2928
- id: string;
2929
- providerId: string;
2930
- createdAt: Date;
2931
- updatedAt: Date;
2932
- accountId: string;
2933
- userId: string;
2934
- scopes: string[];
2935
- }[], {
2936
- code?: string | undefined;
2937
- message?: string | undefined;
2938
- }, FetchOptions["throw"] extends true ? true : false>>;
2939
- unlinkAccount: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2940
- providerId: string;
2941
- accountId?: string | undefined;
2942
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2943
- providerId: string;
2944
- accountId?: string | undefined;
2945
- } & {
2946
- fetchOptions?: FetchOptions | undefined;
2947
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2948
- status: boolean;
2949
- }, {
2950
- code?: string | undefined;
2951
- message?: string | undefined;
2952
- }, FetchOptions["throw"] extends true ? true : false>>;
2953
- refreshToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2954
- providerId: string;
2955
- accountId?: string | undefined;
2956
- userId?: string | undefined;
2957
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2958
- providerId: string;
2959
- accountId?: string | undefined;
2960
- userId?: string | undefined;
2961
- } & {
2962
- fetchOptions?: FetchOptions | undefined;
2963
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2964
- accessToken: string | undefined;
2965
- refreshToken: string | undefined;
2966
- accessTokenExpiresAt: Date | undefined;
2967
- refreshTokenExpiresAt: Date | undefined;
2968
- scope: string | null | undefined;
2969
- idToken: string | null | undefined;
2970
- providerId: string;
2971
- accountId: string;
2972
- }, {
2973
- code?: string | undefined;
2974
- message?: string | undefined;
2975
- }, FetchOptions["throw"] extends true ? true : false>>;
2976
- getAccessToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2977
- providerId: string;
2978
- accountId?: string | undefined;
2979
- userId?: string | undefined;
2980
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2981
- providerId: string;
2982
- accountId?: string | undefined;
2983
- userId?: string | undefined;
2984
- } & {
2985
- fetchOptions?: FetchOptions | undefined;
2986
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2987
- accessToken: string;
2988
- accessTokenExpiresAt: Date | undefined;
2989
- scopes: string[];
2990
- idToken: string | undefined;
2991
- }, {
2992
- code?: string | undefined;
2993
- message?: string | undefined;
2994
- }, FetchOptions["throw"] extends true ? true : false>>;
2995
- accountInfo: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
2996
- accountId?: string | undefined;
2997
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2998
- query?: {
2999
- accountId?: string | undefined;
3000
- } | undefined;
3001
- fetchOptions?: FetchOptions | undefined;
3002
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
3003
- user: better_auth.OAuth2UserInfo;
3004
- data: Record<string, any>;
3005
- }, {
3006
- code?: string | undefined;
3007
- message?: string | undefined;
3008
- }, FetchOptions["throw"] extends true ? true : false>>;
3009
- getSession: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
3010
- disableCookieCache?: unknown;
3011
- disableRefresh?: unknown;
3012
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
3013
- query?: {
3014
- disableCookieCache?: unknown;
3015
- disableRefresh?: unknown;
3016
- } | undefined;
3017
- fetchOptions?: FetchOptions | undefined;
3018
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
3019
- user: {
3020
- id: string;
3021
- createdAt: Date;
3022
- updatedAt: Date;
3023
- email: string;
3024
- emailVerified: boolean;
3025
- name: string;
3026
- image?: string | null | undefined;
3027
- };
3028
- session: {
3029
- id: string;
3030
- createdAt: Date;
3031
- updatedAt: Date;
3032
- userId: string;
3033
- expiresAt: Date;
3034
- token: string;
3035
- ipAddress?: string | null | undefined;
3036
- userAgent?: string | null | undefined;
3037
- };
3038
- } | null, {
3039
- code?: string | undefined;
3040
- message?: string | undefined;
3041
- }, FetchOptions["throw"] extends true ? true : false>>;
3042
- useSession: () => {
3043
- data: {
3044
- user: {
3045
- id: string;
3046
- createdAt: Date;
3047
- updatedAt: Date;
3048
- email: string;
3049
- emailVerified: boolean;
3050
- name: string;
3051
- image?: string | null | undefined;
3052
- };
3053
- session: {
3054
- id: string;
3055
- createdAt: Date;
3056
- updatedAt: Date;
3057
- userId: string;
3058
- expiresAt: Date;
3059
- token: string;
3060
- ipAddress?: string | null | undefined;
3061
- userAgent?: string | null | undefined;
3062
- };
3063
- } | null;
3064
- isPending: boolean;
3065
- isRefetching: boolean;
3066
- error: _better_fetch_fetch.BetterFetchError | null;
3067
- refetch: (queryParams?: {
3068
- query?: better_auth.SessionQueryParams;
3069
- } | undefined) => Promise<void>;
3070
- };
3071
- $Infer: {
3072
- Session: {
3073
- user: {
3074
- id: string;
3075
- createdAt: Date;
3076
- updatedAt: Date;
3077
- email: string;
3078
- emailVerified: boolean;
3079
- name: string;
3080
- image?: string | null | undefined;
3081
- };
3082
- session: {
3083
- id: string;
3084
- createdAt: Date;
3085
- updatedAt: Date;
3086
- userId: string;
3087
- expiresAt: Date;
3088
- token: string;
3089
- ipAddress?: string | null | undefined;
3090
- userAgent?: string | null | undefined;
3091
- };
3092
- };
3093
- };
3094
- $fetch: _better_fetch_fetch.BetterFetch<{
3095
- plugins: (_better_fetch_fetch.BetterFetchPlugin<Record<string, any>> | {
3096
- id: string;
3097
- name: string;
3098
- hooks: {
3099
- onSuccess(context: _better_fetch_fetch.SuccessContext<any>): void;
3100
- };
3101
- } | {
3102
- id: string;
3103
- name: string;
3104
- hooks: {
3105
- onSuccess: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
3106
- onError: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
3107
- onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
3108
- onResponse: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
3109
- };
3110
- })[];
3111
- cache?: RequestCache | undefined;
3112
- method: string;
3113
- window?: null | undefined;
3114
- headers?: (HeadersInit & (HeadersInit | {
3115
- accept: "application/json" | "text/plain" | "application/octet-stream";
3116
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
3117
- authorization: "Bearer" | "Basic";
3118
- })) | undefined;
3119
- redirect?: RequestRedirect | undefined;
3120
- credentials?: RequestCredentials;
3121
- integrity?: string | undefined;
3122
- keepalive?: boolean | undefined;
3123
- mode?: RequestMode | undefined;
3124
- priority?: RequestPriority | undefined;
3125
- referrer?: string | undefined;
3126
- referrerPolicy?: ReferrerPolicy | undefined;
3127
- signal?: (AbortSignal | null) | undefined;
3128
- onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
3129
- hookOptions?: {
3130
- cloneResponse?: boolean;
3131
- } | undefined;
3132
- timeout?: number | undefined;
3133
- customFetchImpl: _better_fetch_fetch.FetchEsque;
3134
- baseURL: string;
3135
- throw?: boolean | undefined;
3136
- auth?: ({
3137
- type: "Bearer";
3138
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
3139
- } | {
3140
- type: "Basic";
3141
- username: string | (() => string | undefined) | undefined;
3142
- password: string | (() => string | undefined) | undefined;
3143
- } | {
3144
- type: "Custom";
3145
- prefix: string | (() => string | undefined) | undefined;
3146
- value: string | (() => string | undefined) | undefined;
3147
- }) | undefined;
3148
- body?: any;
3149
- query?: any;
3150
- params?: any;
3151
- duplex?: "full" | "half" | undefined;
3152
- jsonParser: (text: string) => Promise<any> | any;
3153
- retry?: _better_fetch_fetch.RetryOptions | undefined;
3154
- retryAttempt?: number | undefined;
3155
- output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
3156
- errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
3157
- disableValidation?: boolean | undefined;
3158
- disableSignal?: boolean | undefined;
3159
- }, unknown, unknown, {}>;
3160
- $store: {
3161
- notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
3162
- listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
3163
- atoms: Record<string, nanostores.WritableAtom<any>>;
3164
- };
3165
- $ERROR_CODES: {
3166
- readonly USER_NOT_FOUND: "User not found";
3167
- readonly FAILED_TO_CREATE_USER: "Failed to create user";
3168
- readonly FAILED_TO_CREATE_SESSION: "Failed to create session";
3169
- readonly FAILED_TO_UPDATE_USER: "Failed to update user";
3170
- readonly FAILED_TO_GET_SESSION: "Failed to get session";
3171
- readonly INVALID_PASSWORD: "Invalid password";
3172
- readonly INVALID_EMAIL: "Invalid email";
3173
- readonly INVALID_EMAIL_OR_PASSWORD: "Invalid email or password";
3174
- readonly SOCIAL_ACCOUNT_ALREADY_LINKED: "Social account already linked";
3175
- readonly PROVIDER_NOT_FOUND: "Provider not found";
3176
- readonly INVALID_TOKEN: "Invalid token";
3177
- readonly ID_TOKEN_NOT_SUPPORTED: "id_token not supported";
3178
- readonly FAILED_TO_GET_USER_INFO: "Failed to get user info";
3179
- readonly USER_EMAIL_NOT_FOUND: "User email not found";
3180
- readonly EMAIL_NOT_VERIFIED: "Email not verified";
3181
- readonly PASSWORD_TOO_SHORT: "Password too short";
3182
- readonly PASSWORD_TOO_LONG: "Password too long";
3183
- readonly USER_ALREADY_EXISTS: "User already exists.";
3184
- readonly USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: "User already exists. Use another email.";
3185
- readonly EMAIL_CAN_NOT_BE_UPDATED: "Email can not be updated";
3186
- readonly CREDENTIAL_ACCOUNT_NOT_FOUND: "Credential account not found";
3187
- readonly SESSION_EXPIRED: "Session expired. Re-authenticate to perform this action.";
3188
- readonly FAILED_TO_UNLINK_LAST_ACCOUNT: "You can't unlink your last account";
3189
- readonly ACCOUNT_NOT_FOUND: "Account not found";
3190
- readonly USER_ALREADY_HAS_PASSWORD: "User already has a password. Provide that to delete the account.";
3191
- readonly CROSS_SITE_NAVIGATION_LOGIN_BLOCKED: "Cross-site navigation login blocked. This request appears to be a CSRF attack.";
3192
- readonly VERIFICATION_EMAIL_NOT_ENABLED: "Verification email isn't enabled";
3193
- readonly EMAIL_ALREADY_VERIFIED: "Email is already verified";
3194
- readonly EMAIL_MISMATCH: "Email mismatch";
3195
- readonly SESSION_NOT_FRESH: "Session is not fresh";
3196
- readonly LINKED_ACCOUNT_ALREADY_EXISTS: "Linked account already exists";
3197
- readonly INVALID_ORIGIN: "Invalid origin";
3198
- readonly INVALID_CALLBACK_URL: "Invalid callbackURL";
3199
- readonly INVALID_REDIRECT_URL: "Invalid redirectURL";
3200
- readonly INVALID_ERROR_CALLBACK_URL: "Invalid errorCallbackURL";
3201
- readonly INVALID_NEW_USER_CALLBACK_URL: "Invalid newUserCallbackURL";
3202
- readonly MISSING_OR_NULL_ORIGIN: "Missing or null Origin";
3203
- readonly CALLBACK_URL_REQUIRED: "callbackURL is required";
3204
- readonly FAILED_TO_CREATE_VERIFICATION: "Unable to create verification";
3205
- readonly FIELD_NOT_ALLOWED: "Field not allowed to be set";
3206
- readonly ASYNC_VALIDATION_NOT_SUPPORTED: "Async validation is not supported";
3207
- readonly VALIDATION_ERROR: "Validation Error";
3208
- readonly MISSING_FIELD: "Field is required";
3209
- };
3210
- };
3211
- };
3212
139
  server: {
140
+ createSvelteKitServer: typeof createSvelteKitServer;
141
+ createNextJsServer: typeof createNextJsServer;
3213
142
  express: {
143
+ createMiddleware: (db?: drizzle_orm_libsql.LibSQLDatabase<Record<string, unknown>> & {
144
+ $client: _libsql_client.Client;
145
+ }) => (options?: MiddlewareOptions) => (req: express.Request, res: express.Response, next: express.NextFunction) => Promise<void | express.Response<any, Record<string, any>>>;
3214
146
  middleware: (options?: MiddlewareOptions) => (req: express.Request, res: express.Response, next: express.NextFunction) => Promise<void | express.Response<any, Record<string, any>>>;
3215
147
  isAuthenticated: typeof isAuthenticated;
3216
148
  getAuthContext: typeof getAuthContext;
3217
149
  };
3218
- sveltekit: {
3219
- auth: better_auth.Auth<{
3220
- database: (options: better_auth.BetterAuthOptions) => better_auth.DBAdapter<better_auth.BetterAuthOptions>;
3221
- baseURL: string | undefined;
3222
- secret: string | undefined;
3223
- trustedOrigins: string[] | undefined;
3224
- socialProviders: {
3225
- google: {
3226
- clientId: string;
3227
- clientSecret: string;
3228
- };
3229
- };
3230
- session: {
3231
- expiresIn: number;
3232
- updateAge: number;
3233
- cookieCache: {
3234
- enabled: true;
3235
- maxAge: number;
3236
- };
3237
- };
3238
- }>;
3239
- handler: {
3240
- GET: (event: {
3241
- request: Request;
3242
- }) => Response | Promise<Response>;
3243
- POST: (event: {
3244
- request: Request;
3245
- }) => Response | Promise<Response>;
3246
- };
3247
- createHandle: () => _sveltejs_kit.Handle;
3248
- getSession: (event: _sveltejs_kit.RequestEvent) => Promise<SessionResult>;
3249
- isAuthenticated: (event: _sveltejs_kit.RequestEvent) => Promise<boolean>;
3250
- makeAuthenticatedCall: <TArgs extends any[], TReturn>(fn: (ctx: {
3251
- user: SessionData["user"];
3252
- session: SessionData["session"];
3253
- db: typeof db;
3254
- event: _sveltejs_kit.RequestEvent;
3255
- }, ...args: TArgs) => Promise<TReturn>) => (event: _sveltejs_kit.RequestEvent, ...args: TArgs) => Promise<TReturn>;
3256
- };
3257
- nextjs: {
3258
- auth: better_auth.Auth<{
3259
- database: (options: better_auth.BetterAuthOptions) => better_auth.DBAdapter<better_auth.BetterAuthOptions>;
3260
- baseURL: string | undefined;
3261
- secret: string | undefined;
3262
- trustedOrigins: string[] | undefined;
3263
- socialProviders: {
3264
- google: {
3265
- clientId: string;
3266
- clientSecret: string;
3267
- };
3268
- };
3269
- session: {
3270
- expiresIn: number;
3271
- updateAge: number;
3272
- cookieCache: {
3273
- enabled: true;
3274
- maxAge: number;
3275
- };
3276
- };
3277
- }>;
3278
- handler: {
3279
- GET: {
3280
- GET: (request: Request) => Promise<Response>;
3281
- POST: (request: Request) => Promise<Response>;
3282
- PATCH: (request: Request) => Promise<Response>;
3283
- PUT: (request: Request) => Promise<Response>;
3284
- DELETE: (request: Request) => Promise<Response>;
3285
- };
3286
- POST: {
3287
- GET: (request: Request) => Promise<Response>;
3288
- POST: (request: Request) => Promise<Response>;
3289
- PATCH: (request: Request) => Promise<Response>;
3290
- PUT: (request: Request) => Promise<Response>;
3291
- DELETE: (request: Request) => Promise<Response>;
3292
- };
3293
- };
3294
- getSession: () => Promise<SessionResult>;
3295
- getSessionFromHeaders: (requestHeaders: Headers) => Promise<SessionResult>;
3296
- isAuthenticated: () => Promise<boolean>;
3297
- getUser: () => Promise<{
3298
- id: string;
3299
- createdAt: Date;
3300
- updatedAt: Date;
3301
- email: string;
3302
- emailVerified: boolean;
3303
- name: string;
3304
- image?: string | null | undefined | undefined;
3305
- } | null>;
3306
- makeAuthenticatedCall: <TArgs extends any[], TReturn>(fn: (ctx: {
3307
- user: SessionData["user"];
3308
- session: SessionData["session"];
3309
- db: typeof db;
3310
- }, ...args: TArgs) => Promise<TReturn>) => (...args: TArgs) => Promise<TReturn>;
3311
- };
3312
150
  };
3313
151
  bff: {
3314
- createNextJsBff: (baseUrlOrConfig: string | BffClientConfig) => NextJsBffClient;
152
+ createNextJsBff: (auth: better_auth.Auth<better_auth.BetterAuthOptions>, baseUrlOrConfig: string | BffClientConfig) => NextJsBffClient;
3315
153
  createSvelteKitBff: (baseUrlOrConfig: string | BffClientConfig) => SvelteKitBffClient;
3316
154
  };
3317
155
  };
3318
156
 
3319
- export { BffClientConfig, MiddlewareOptions, SessionData, SessionResult, auth, bff, client, db, hyle as default, getAuthContext, isAuthenticated, server };
157
+ export { BffClientConfig, type HyleAuthConfig, type HyleDbConfig, MiddlewareOptions, bff, createAuth, createDb, createNextJsServer, createSvelteKitServer, hyle as default, getAuthContext, isAuthenticated, schema };