@choiceform/shared-auth 0.1.12 → 0.1.14

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.
package/dist/init.d.ts CHANGED
@@ -8,16 +8,23 @@ import type { AuthConfig } from "./config";
8
8
  *
9
9
  * @param config - 认证配置
10
10
  * @param config.baseURL - Better Auth API 基础 URL
11
- * @param config.defaultRedirectAfterLogin - 登录后默认跳转地址,默认为 "/explore"
12
11
  * @param config.plugins - Better Auth 插件列表,如果不传则使用默认的 organizationClient
13
- * @param config.signInPath - 登录页面路径,默认为 "/sign-in"
14
12
  * @param config.tokenStorageKey - Token 存储的 localStorage key,默认为 "auth-token"
13
+ * @param config.defaultRedirectAfterLogin - (已废弃) 建议在 SignInPage 组件中通过 redirectUrl prop 传入
14
+ * @param config.signInPath - (已废弃) 建议在 ProtectedRoute 组件中通过 onUnauthorized 回调处理导航
15
15
  */
16
16
  export declare function initAuth(config: {
17
17
  baseURL: string;
18
+ /** @deprecated 建议在 SignInPage 组件中通过 redirectUrl prop 传入 */
18
19
  defaultRedirectAfterLogin?: string;
19
20
  plugins?: AuthConfig["plugins"];
21
+ /** @deprecated 建议在 ProtectedRoute 组件中通过 onUnauthorized 回调处理导航 */
20
22
  signInPath?: string;
23
+ /**
24
+ * 跳过错误时的 token 清除(开发环境用)
25
+ * 启用后,网络错误、解析错误等不会清除 token,避免开发时频繁登出
26
+ */
27
+ skipTokenCleanupOnError?: boolean;
21
28
  tokenStorageKey?: string;
22
29
  }): {
23
30
  getCurrentUser: () => import("./types").SessionUser | null;
@@ -52,7 +59,7 @@ export declare function initAuth(config: {
52
59
  setLoading(loading: boolean): void;
53
60
  setError(error: string | null): void;
54
61
  signIn(provider?: string, redirectTo?: string): Promise<void>;
55
- signOut(): Promise<void>;
62
+ signOut(redirectTo?: string): Promise<void>;
56
63
  updateUser(user: import("./types").SessionUser | null): void;
57
64
  getUser(): import("./types").SessionUser | null;
58
65
  };
@@ -61,76 +68,24 @@ export declare function initAuth(config: {
61
68
  };
62
69
  authClient: {
63
70
  signIn: {
64
- social: <FetchOptions extends {
65
- method?: string | undefined;
66
- headers?: (HeadersInit & (HeadersInit | {
67
- accept: "application/json" | "text/plain" | "application/octet-stream";
68
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
69
- authorization: "Bearer" | "Basic";
70
- })) | undefined;
71
- cache?: RequestCache | undefined;
72
- credentials?: RequestCredentials | undefined;
73
- integrity?: string | undefined;
74
- keepalive?: boolean | undefined;
75
- mode?: RequestMode | undefined;
76
- priority?: RequestPriority | undefined;
77
- redirect?: RequestRedirect | undefined;
78
- referrer?: string | undefined;
79
- referrerPolicy?: ReferrerPolicy | undefined;
80
- signal?: (AbortSignal | null) | undefined;
81
- window?: null | undefined;
82
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
83
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
84
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
85
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
86
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
87
- hookOptions?: {
88
- cloneResponse?: boolean;
71
+ social: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
72
+ provider: unknown;
73
+ callbackURL?: string | undefined;
74
+ newUserCallbackURL?: string | undefined;
75
+ errorCallbackURL?: string | undefined;
76
+ disableRedirect?: boolean | undefined;
77
+ idToken?: {
78
+ token: string;
79
+ nonce?: string | undefined;
80
+ accessToken?: string | undefined;
81
+ refreshToken?: string | undefined;
82
+ expiresAt?: number | undefined;
89
83
  } | undefined;
90
- timeout?: number | undefined;
91
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
92
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
93
- baseURL?: string | undefined;
94
- throw?: boolean | undefined;
95
- auth?: ({
96
- type: "Bearer";
97
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
98
- } | {
99
- type: "Basic";
100
- username: string | (() => string | undefined) | undefined;
101
- password: string | (() => string | undefined) | undefined;
102
- } | {
103
- type: "Custom";
104
- prefix: string | (() => string | undefined) | undefined;
105
- value: string | (() => string | undefined) | undefined;
106
- }) | undefined;
107
- body?: (Partial<{
108
- provider: unknown;
109
- callbackURL?: string | undefined;
110
- newUserCallbackURL?: string | undefined;
111
- errorCallbackURL?: string | undefined;
112
- disableRedirect?: boolean | undefined;
113
- idToken?: {
114
- token: string;
115
- nonce?: string | undefined;
116
- accessToken?: string | undefined;
117
- refreshToken?: string | undefined;
118
- expiresAt?: number | undefined;
119
- } | undefined;
120
- scopes?: string[] | undefined;
121
- requestSignUp?: boolean | undefined;
122
- loginHint?: string | undefined;
123
- }> & Record<string, any>) | undefined;
124
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
125
- params?: Record<string, any> | undefined;
126
- duplex?: "full" | "half" | undefined;
127
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
128
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
129
- retryAttempt?: number | undefined;
130
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
131
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
132
- disableValidation?: boolean | undefined;
133
- }>(data_0: import("better-auth").Prettify<{
84
+ scopes?: string[] | undefined;
85
+ requestSignUp?: boolean | undefined;
86
+ loginHint?: string | undefined;
87
+ additionalData?: Record<string, any> | undefined;
88
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
134
89
  provider: unknown;
135
90
  callbackURL?: string | undefined;
136
91
  newUserCallbackURL?: string | undefined;
@@ -146,6 +101,7 @@ export declare function initAuth(config: {
146
101
  scopes?: string[] | undefined;
147
102
  requestSignUp?: boolean | undefined;
148
103
  loginHint?: string | undefined;
104
+ additionalData?: Record<string, any> | undefined;
149
105
  } & {
150
106
  fetchOptions?: FetchOptions | undefined;
151
107
  }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<NonNullable<{
@@ -165,141 +121,35 @@ export declare function initAuth(config: {
165
121
  url: string;
166
122
  redirect: boolean;
167
123
  }>, {
168
- code?: string;
169
- message?: string;
124
+ code?: string | undefined;
125
+ message?: string | undefined;
170
126
  }, FetchOptions["throw"] extends true ? true : false>>;
171
127
  };
172
128
  } & {
173
- signOut: <FetchOptions extends {
174
- method?: string | undefined;
175
- headers?: (HeadersInit & (HeadersInit | {
176
- accept: "application/json" | "text/plain" | "application/octet-stream";
177
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
178
- authorization: "Bearer" | "Basic";
179
- })) | undefined;
180
- cache?: RequestCache | undefined;
181
- credentials?: RequestCredentials | undefined;
182
- integrity?: string | undefined;
183
- keepalive?: boolean | undefined;
184
- mode?: RequestMode | undefined;
185
- priority?: RequestPriority | undefined;
186
- redirect?: RequestRedirect | undefined;
187
- referrer?: string | undefined;
188
- referrerPolicy?: ReferrerPolicy | undefined;
189
- signal?: (AbortSignal | null) | undefined;
190
- window?: null | undefined;
191
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
192
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
193
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
194
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
195
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
196
- hookOptions?: {
197
- cloneResponse?: boolean;
198
- } | undefined;
199
- timeout?: number | undefined;
200
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
201
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
202
- baseURL?: string | undefined;
203
- throw?: boolean | undefined;
204
- auth?: ({
205
- type: "Bearer";
206
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
207
- } | {
208
- type: "Basic";
209
- username: string | (() => string | undefined) | undefined;
210
- password: string | (() => string | undefined) | undefined;
211
- } | {
212
- type: "Custom";
213
- prefix: string | (() => string | undefined) | undefined;
214
- value: string | (() => string | undefined) | undefined;
215
- }) | undefined;
216
- body?: undefined;
217
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
218
- params?: Record<string, any> | undefined;
219
- duplex?: "full" | "half" | undefined;
220
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
221
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
222
- retryAttempt?: number | undefined;
223
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
224
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
225
- disableValidation?: boolean | undefined;
226
- }>(data_0?: import("better-auth").Prettify<{
129
+ signOut: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/client/plugins").Prettify<{
227
130
  query?: Record<string, any> | undefined;
228
131
  fetchOptions?: FetchOptions | undefined;
229
132
  }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
230
133
  success: boolean;
231
134
  }, {
232
- code?: string;
233
- message?: string;
135
+ code?: string | undefined;
136
+ message?: string | undefined;
234
137
  }, FetchOptions["throw"] extends true ? true : false>>;
235
138
  } & {
236
139
  signUp: {
237
- email: <FetchOptions extends {
238
- method?: string | undefined;
239
- headers?: (HeadersInit & (HeadersInit | {
240
- accept: "application/json" | "text/plain" | "application/octet-stream";
241
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
242
- authorization: "Bearer" | "Basic";
243
- })) | undefined;
244
- cache?: RequestCache | undefined;
245
- credentials?: RequestCredentials | undefined;
246
- integrity?: string | undefined;
247
- keepalive?: boolean | undefined;
248
- mode?: RequestMode | undefined;
249
- priority?: RequestPriority | undefined;
250
- redirect?: RequestRedirect | undefined;
251
- referrer?: string | undefined;
252
- referrerPolicy?: ReferrerPolicy | undefined;
253
- signal?: (AbortSignal | null) | undefined;
254
- window?: null | undefined;
255
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
256
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
257
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
258
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
259
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
260
- hookOptions?: {
261
- cloneResponse?: boolean;
262
- } | undefined;
263
- timeout?: number | undefined;
264
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
265
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
266
- baseURL?: string | undefined;
267
- throw?: boolean | undefined;
268
- auth?: ({
269
- type: "Bearer";
270
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
271
- } | {
272
- type: "Basic";
273
- username: string | (() => string | undefined) | undefined;
274
- password: string | (() => string | undefined) | undefined;
275
- } | {
276
- type: "Custom";
277
- prefix: string | (() => string | undefined) | undefined;
278
- value: string | (() => string | undefined) | undefined;
279
- }) | undefined;
280
- body?: (Partial<{
281
- name: string;
282
- email: string;
283
- password: string;
284
- image?: string;
285
- callbackURL?: string;
286
- rememberMe?: boolean;
287
- }> & Record<string, any>) | undefined;
288
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
289
- params?: Record<string, any> | undefined;
290
- duplex?: "full" | "half" | undefined;
291
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
292
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
293
- retryAttempt?: number | undefined;
294
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
295
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
296
- disableValidation?: boolean | undefined;
297
- }>(data_0: import("better-auth").Prettify<{
140
+ email: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
141
+ name: string;
142
+ email: string;
143
+ password: string;
144
+ image?: string | undefined;
145
+ callbackURL?: string | undefined;
146
+ rememberMe?: boolean | undefined;
147
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
298
148
  email: string;
299
149
  name: string;
300
150
  password: string;
301
- image?: string;
302
- callbackURL?: string;
151
+ image?: string | undefined;
152
+ callbackURL?: string | undefined;
303
153
  fetchOptions?: FetchOptions | undefined;
304
154
  }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<NonNullable<{
305
155
  token: null;
@@ -324,71 +174,18 @@ export declare function initAuth(config: {
324
174
  updatedAt: Date;
325
175
  };
326
176
  }>, {
327
- code?: string;
328
- message?: string;
177
+ code?: string | undefined;
178
+ message?: string | undefined;
329
179
  }, FetchOptions["throw"] extends true ? true : false>>;
330
180
  };
331
181
  } & {
332
182
  signIn: {
333
- email: <FetchOptions extends {
334
- method?: string | undefined;
335
- headers?: (HeadersInit & (HeadersInit | {
336
- accept: "application/json" | "text/plain" | "application/octet-stream";
337
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
338
- authorization: "Bearer" | "Basic";
339
- })) | undefined;
340
- cache?: RequestCache | undefined;
341
- credentials?: RequestCredentials | undefined;
342
- integrity?: string | undefined;
343
- keepalive?: boolean | undefined;
344
- mode?: RequestMode | undefined;
345
- priority?: RequestPriority | undefined;
346
- redirect?: RequestRedirect | undefined;
347
- referrer?: string | undefined;
348
- referrerPolicy?: ReferrerPolicy | undefined;
349
- signal?: (AbortSignal | null) | undefined;
350
- window?: null | undefined;
351
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
352
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
353
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
354
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
355
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
356
- hookOptions?: {
357
- cloneResponse?: boolean;
358
- } | undefined;
359
- timeout?: number | undefined;
360
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
361
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
362
- baseURL?: string | undefined;
363
- throw?: boolean | undefined;
364
- auth?: ({
365
- type: "Bearer";
366
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
367
- } | {
368
- type: "Basic";
369
- username: string | (() => string | undefined) | undefined;
370
- password: string | (() => string | undefined) | undefined;
371
- } | {
372
- type: "Custom";
373
- prefix: string | (() => string | undefined) | undefined;
374
- value: string | (() => string | undefined) | undefined;
375
- }) | undefined;
376
- body?: (Partial<{
377
- email: string;
378
- password: string;
379
- callbackURL?: string | undefined;
380
- rememberMe?: boolean | undefined;
381
- }> & Record<string, any>) | undefined;
382
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
383
- params?: Record<string, any> | undefined;
384
- duplex?: "full" | "half" | undefined;
385
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
386
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
387
- retryAttempt?: number | undefined;
388
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
389
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
390
- disableValidation?: boolean | undefined;
391
- }>(data_0: import("better-auth").Prettify<{
183
+ email: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
184
+ email: string;
185
+ password: string;
186
+ callbackURL?: string | undefined;
187
+ rememberMe?: boolean | undefined;
188
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
392
189
  email: string;
393
190
  password: string;
394
191
  callbackURL?: string | undefined;
@@ -409,138 +206,17 @@ export declare function initAuth(config: {
409
206
  updatedAt: Date;
410
207
  };
411
208
  }, {
412
- code?: string;
413
- message?: string;
209
+ code?: string | undefined;
210
+ message?: string | undefined;
414
211
  }, FetchOptions["throw"] extends true ? true : false>>;
415
212
  };
416
213
  } & {
417
- forgetPassword: <FetchOptions extends {
418
- method?: string | undefined;
419
- headers?: (HeadersInit & (HeadersInit | {
420
- accept: "application/json" | "text/plain" | "application/octet-stream";
421
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
422
- authorization: "Bearer" | "Basic";
423
- })) | undefined;
424
- cache?: RequestCache | undefined;
425
- credentials?: RequestCredentials | undefined;
426
- integrity?: string | undefined;
427
- keepalive?: boolean | undefined;
428
- mode?: RequestMode | undefined;
429
- priority?: RequestPriority | undefined;
430
- redirect?: RequestRedirect | undefined;
431
- referrer?: string | undefined;
432
- referrerPolicy?: ReferrerPolicy | undefined;
433
- signal?: (AbortSignal | null) | undefined;
434
- window?: null | undefined;
435
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
436
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
437
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
438
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
439
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
440
- hookOptions?: {
441
- cloneResponse?: boolean;
442
- } | undefined;
443
- timeout?: number | undefined;
444
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
445
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
446
- baseURL?: string | undefined;
447
- throw?: boolean | undefined;
448
- auth?: ({
449
- type: "Bearer";
450
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
451
- } | {
452
- type: "Basic";
453
- username: string | (() => string | undefined) | undefined;
454
- password: string | (() => string | undefined) | undefined;
455
- } | {
456
- type: "Custom";
457
- prefix: string | (() => string | undefined) | undefined;
458
- value: string | (() => string | undefined) | undefined;
459
- }) | undefined;
460
- body?: (Partial<{
461
- email: string;
462
- redirectTo?: string | undefined;
463
- }> & Record<string, any>) | undefined;
464
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
465
- params?: Record<string, any> | undefined;
466
- duplex?: "full" | "half" | undefined;
467
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
468
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
469
- retryAttempt?: number | undefined;
470
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
471
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
472
- disableValidation?: boolean | undefined;
473
- }>(data_0: import("better-auth").Prettify<{
474
- email: string;
475
- redirectTo?: string | undefined;
476
- } & {
477
- fetchOptions?: FetchOptions | undefined;
478
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
479
- status: boolean;
480
- }, {
481
- code?: string;
482
- message?: string;
483
- }, FetchOptions["throw"] extends true ? true : false>>;
484
- } & {
485
- resetPassword: <FetchOptions extends {
486
- method?: string | undefined;
487
- headers?: (HeadersInit & (HeadersInit | {
488
- accept: "application/json" | "text/plain" | "application/octet-stream";
489
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
490
- authorization: "Bearer" | "Basic";
491
- })) | undefined;
492
- cache?: RequestCache | undefined;
493
- credentials?: RequestCredentials | undefined;
494
- integrity?: string | undefined;
495
- keepalive?: boolean | undefined;
496
- mode?: RequestMode | undefined;
497
- priority?: RequestPriority | undefined;
498
- redirect?: RequestRedirect | undefined;
499
- referrer?: string | undefined;
500
- referrerPolicy?: ReferrerPolicy | undefined;
501
- signal?: (AbortSignal | null) | undefined;
502
- window?: null | undefined;
503
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
504
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
505
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
506
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
507
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
508
- hookOptions?: {
509
- cloneResponse?: boolean;
510
- } | undefined;
511
- timeout?: number | undefined;
512
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
513
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
514
- baseURL?: string | undefined;
515
- throw?: boolean | undefined;
516
- auth?: ({
517
- type: "Bearer";
518
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
519
- } | {
520
- type: "Basic";
521
- username: string | (() => string | undefined) | undefined;
522
- password: string | (() => string | undefined) | undefined;
523
- } | {
524
- type: "Custom";
525
- prefix: string | (() => string | undefined) | undefined;
526
- value: string | (() => string | undefined) | undefined;
527
- }) | undefined;
528
- body?: (Partial<{
529
- newPassword: string;
530
- token?: string | undefined;
531
- }> & Record<string, any>) | undefined;
532
- query?: (Partial<{
533
- token?: string | undefined;
534
- }> & Record<string, any>) | undefined;
535
- params?: Record<string, any> | undefined;
536
- duplex?: "full" | "half" | undefined;
537
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
538
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
539
- retryAttempt?: number | undefined;
540
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
541
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
542
- disableValidation?: boolean | undefined;
543
- }>(data_0: import("better-auth").Prettify<{
214
+ resetPassword: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
215
+ newPassword: string;
216
+ token?: string | undefined;
217
+ }> & Record<string, any>, Partial<{
218
+ token?: string | undefined;
219
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
544
220
  newPassword: string;
545
221
  token?: string | undefined;
546
222
  } & {
@@ -548,67 +224,14 @@ export declare function initAuth(config: {
548
224
  }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
549
225
  status: boolean;
550
226
  }, {
551
- code?: string;
552
- message?: string;
227
+ code?: string | undefined;
228
+ message?: string | undefined;
553
229
  }, FetchOptions["throw"] extends true ? true : false>>;
554
230
  } & {
555
- verifyEmail: <FetchOptions extends {
556
- method?: string | undefined;
557
- headers?: (HeadersInit & (HeadersInit | {
558
- accept: "application/json" | "text/plain" | "application/octet-stream";
559
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
560
- authorization: "Bearer" | "Basic";
561
- })) | undefined;
562
- cache?: RequestCache | undefined;
563
- credentials?: RequestCredentials | undefined;
564
- integrity?: string | undefined;
565
- keepalive?: boolean | undefined;
566
- mode?: RequestMode | undefined;
567
- priority?: RequestPriority | undefined;
568
- redirect?: RequestRedirect | undefined;
569
- referrer?: string | undefined;
570
- referrerPolicy?: ReferrerPolicy | undefined;
571
- signal?: (AbortSignal | null) | undefined;
572
- window?: null | undefined;
573
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
574
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
575
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
576
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
577
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
578
- hookOptions?: {
579
- cloneResponse?: boolean;
580
- } | undefined;
581
- timeout?: number | undefined;
582
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
583
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
584
- baseURL?: string | undefined;
585
- throw?: boolean | undefined;
586
- auth?: ({
587
- type: "Bearer";
588
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
589
- } | {
590
- type: "Basic";
591
- username: string | (() => string | undefined) | undefined;
592
- password: string | (() => string | undefined) | undefined;
593
- } | {
594
- type: "Custom";
595
- prefix: string | (() => string | undefined) | undefined;
596
- value: string | (() => string | undefined) | undefined;
597
- }) | undefined;
598
- body?: undefined;
599
- query?: (Partial<{
600
- token: string;
601
- callbackURL?: string | undefined;
602
- }> & Record<string, any>) | undefined;
603
- params?: Record<string, any> | undefined;
604
- duplex?: "full" | "half" | undefined;
605
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
606
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
607
- retryAttempt?: number | undefined;
608
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
609
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
610
- disableValidation?: boolean | undefined;
611
- }>(data_0: import("better-auth").Prettify<{
231
+ verifyEmail: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
232
+ token: string;
233
+ callbackURL?: string | undefined;
234
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
612
235
  query: {
613
236
  token: string;
614
237
  callbackURL?: string | undefined;
@@ -616,6 +239,53 @@ export declare function initAuth(config: {
616
239
  fetchOptions?: FetchOptions | undefined;
617
240
  }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<NonNullable<void | {
618
241
  status: boolean;
242
+ }>, {
243
+ code?: string | undefined;
244
+ message?: string | undefined;
245
+ }, FetchOptions["throw"] extends true ? true : false>>;
246
+ } & {
247
+ sendVerificationEmail: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
248
+ email: string;
249
+ callbackURL?: string | undefined;
250
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
251
+ email: string;
252
+ callbackURL?: string | undefined;
253
+ } & {
254
+ fetchOptions?: FetchOptions | undefined;
255
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
256
+ status: boolean;
257
+ }, {
258
+ code?: string | undefined;
259
+ message?: string | undefined;
260
+ }, FetchOptions["throw"] extends true ? true : false>>;
261
+ } & {
262
+ changeEmail: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
263
+ newEmail: string;
264
+ callbackURL?: string | undefined;
265
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
266
+ newEmail: string;
267
+ callbackURL?: string | undefined;
268
+ } & {
269
+ fetchOptions?: FetchOptions | undefined;
270
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
271
+ status: boolean;
272
+ }, {
273
+ code?: string | undefined;
274
+ message?: string | undefined;
275
+ }, FetchOptions["throw"] extends true ? true : false>>;
276
+ } & {
277
+ changePassword: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
278
+ newPassword: string;
279
+ currentPassword: string;
280
+ revokeOtherSessions?: boolean | undefined;
281
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
282
+ newPassword: string;
283
+ currentPassword: string;
284
+ revokeOtherSessions?: boolean | undefined;
285
+ } & {
286
+ fetchOptions?: FetchOptions | undefined;
287
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
288
+ token: string | null;
619
289
  user: {
620
290
  id: string;
621
291
  email: string;
@@ -625,631 +295,79 @@ export declare function initAuth(config: {
625
295
  createdAt: Date;
626
296
  updatedAt: Date;
627
297
  };
628
- } | {
298
+ }, {
299
+ code?: string | undefined;
300
+ message?: string | undefined;
301
+ }, FetchOptions["throw"] extends true ? true : false>>;
302
+ } & {
303
+ updateUser: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<Partial<{}> & {
304
+ name?: string | undefined;
305
+ image?: string | undefined;
306
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/client/plugins").Prettify<{
307
+ image?: (string | null) | undefined;
308
+ name?: string | undefined;
309
+ fetchOptions?: FetchOptions | undefined;
310
+ } & Partial<{}>> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
629
311
  status: boolean;
630
- user: null;
631
- }>, {
632
- code?: string;
633
- message?: string;
312
+ }, {
313
+ code?: string | undefined;
314
+ message?: string | undefined;
634
315
  }, FetchOptions["throw"] extends true ? true : false>>;
635
316
  } & {
636
- sendVerificationEmail: <FetchOptions extends {
637
- method?: string | undefined;
638
- headers?: (HeadersInit & (HeadersInit | {
639
- accept: "application/json" | "text/plain" | "application/octet-stream";
640
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
641
- authorization: "Bearer" | "Basic";
642
- })) | undefined;
643
- cache?: RequestCache | undefined;
644
- credentials?: RequestCredentials | undefined;
645
- integrity?: string | undefined;
646
- keepalive?: boolean | undefined;
647
- mode?: RequestMode | undefined;
648
- priority?: RequestPriority | undefined;
649
- redirect?: RequestRedirect | undefined;
650
- referrer?: string | undefined;
651
- referrerPolicy?: ReferrerPolicy | undefined;
652
- signal?: (AbortSignal | null) | undefined;
653
- window?: null | undefined;
654
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
655
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
656
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
657
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
658
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
659
- hookOptions?: {
660
- cloneResponse?: boolean;
661
- } | undefined;
662
- timeout?: number | undefined;
663
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
664
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
665
- baseURL?: string | undefined;
666
- throw?: boolean | undefined;
667
- auth?: ({
668
- type: "Bearer";
669
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
670
- } | {
671
- type: "Basic";
672
- username: string | (() => string | undefined) | undefined;
673
- password: string | (() => string | undefined) | undefined;
674
- } | {
675
- type: "Custom";
676
- prefix: string | (() => string | undefined) | undefined;
677
- value: string | (() => string | undefined) | undefined;
678
- }) | undefined;
679
- body?: (Partial<{
680
- email: string;
681
- callbackURL?: string | undefined;
682
- }> & Record<string, any>) | undefined;
683
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
684
- params?: Record<string, any> | undefined;
685
- duplex?: "full" | "half" | undefined;
686
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
687
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
688
- retryAttempt?: number | undefined;
689
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
690
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
691
- disableValidation?: boolean | undefined;
692
- }>(data_0: import("better-auth").Prettify<{
693
- email: string;
694
- callbackURL?: string | undefined;
695
- } & {
696
- fetchOptions?: FetchOptions | undefined;
697
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
698
- status: boolean;
699
- }, {
700
- code?: string;
701
- message?: string;
702
- }, FetchOptions["throw"] extends true ? true : false>>;
703
- } & {
704
- changeEmail: <FetchOptions extends {
705
- method?: string | undefined;
706
- headers?: (HeadersInit & (HeadersInit | {
707
- accept: "application/json" | "text/plain" | "application/octet-stream";
708
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
709
- authorization: "Bearer" | "Basic";
710
- })) | undefined;
711
- cache?: RequestCache | undefined;
712
- credentials?: RequestCredentials | undefined;
713
- integrity?: string | undefined;
714
- keepalive?: boolean | undefined;
715
- mode?: RequestMode | undefined;
716
- priority?: RequestPriority | undefined;
717
- redirect?: RequestRedirect | undefined;
718
- referrer?: string | undefined;
719
- referrerPolicy?: ReferrerPolicy | undefined;
720
- signal?: (AbortSignal | null) | undefined;
721
- window?: null | undefined;
722
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
723
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
724
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
725
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
726
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
727
- hookOptions?: {
728
- cloneResponse?: boolean;
729
- } | undefined;
730
- timeout?: number | undefined;
731
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
732
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
733
- baseURL?: string | undefined;
734
- throw?: boolean | undefined;
735
- auth?: ({
736
- type: "Bearer";
737
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
738
- } | {
739
- type: "Basic";
740
- username: string | (() => string | undefined) | undefined;
741
- password: string | (() => string | undefined) | undefined;
742
- } | {
743
- type: "Custom";
744
- prefix: string | (() => string | undefined) | undefined;
745
- value: string | (() => string | undefined) | undefined;
746
- }) | undefined;
747
- body?: (Partial<{
748
- newEmail: string;
749
- callbackURL?: string | undefined;
750
- }> & Record<string, any>) | undefined;
751
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
752
- params?: Record<string, any> | undefined;
753
- duplex?: "full" | "half" | undefined;
754
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
755
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
756
- retryAttempt?: number | undefined;
757
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
758
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
759
- disableValidation?: boolean | undefined;
760
- }>(data_0: import("better-auth").Prettify<{
761
- newEmail: string;
762
- callbackURL?: string | undefined;
763
- } & {
764
- fetchOptions?: FetchOptions | undefined;
765
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
766
- status: boolean;
767
- }, {
768
- code?: string;
769
- message?: string;
770
- }, FetchOptions["throw"] extends true ? true : false>>;
771
- } & {
772
- changePassword: <FetchOptions extends {
773
- method?: string | undefined;
774
- headers?: (HeadersInit & (HeadersInit | {
775
- accept: "application/json" | "text/plain" | "application/octet-stream";
776
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
777
- authorization: "Bearer" | "Basic";
778
- })) | undefined;
779
- cache?: RequestCache | undefined;
780
- credentials?: RequestCredentials | undefined;
781
- integrity?: string | undefined;
782
- keepalive?: boolean | undefined;
783
- mode?: RequestMode | undefined;
784
- priority?: RequestPriority | undefined;
785
- redirect?: RequestRedirect | undefined;
786
- referrer?: string | undefined;
787
- referrerPolicy?: ReferrerPolicy | undefined;
788
- signal?: (AbortSignal | null) | undefined;
789
- window?: null | undefined;
790
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
791
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
792
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
793
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
794
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
795
- hookOptions?: {
796
- cloneResponse?: boolean;
797
- } | undefined;
798
- timeout?: number | undefined;
799
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
800
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
801
- baseURL?: string | undefined;
802
- throw?: boolean | undefined;
803
- auth?: ({
804
- type: "Bearer";
805
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
806
- } | {
807
- type: "Basic";
808
- username: string | (() => string | undefined) | undefined;
809
- password: string | (() => string | undefined) | undefined;
810
- } | {
811
- type: "Custom";
812
- prefix: string | (() => string | undefined) | undefined;
813
- value: string | (() => string | undefined) | undefined;
814
- }) | undefined;
815
- body?: (Partial<{
816
- newPassword: string;
817
- currentPassword: string;
818
- revokeOtherSessions?: boolean | undefined;
819
- }> & Record<string, any>) | undefined;
820
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
821
- params?: Record<string, any> | undefined;
822
- duplex?: "full" | "half" | undefined;
823
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
824
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
825
- retryAttempt?: number | undefined;
826
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
827
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
828
- disableValidation?: boolean | undefined;
829
- }>(data_0: import("better-auth").Prettify<{
830
- newPassword: string;
831
- currentPassword: string;
832
- revokeOtherSessions?: boolean | undefined;
833
- } & {
834
- fetchOptions?: FetchOptions | undefined;
835
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
836
- token: string | null;
837
- user: {
838
- id: string;
839
- email: string;
840
- name: string;
841
- image: string | null | undefined;
842
- emailVerified: boolean;
843
- createdAt: Date;
844
- updatedAt: Date;
845
- };
846
- }, {
847
- code?: string;
848
- message?: string;
849
- }, FetchOptions["throw"] extends true ? true : false>>;
850
- } & {
851
- updateUser: <FetchOptions extends {
852
- method?: string | undefined;
853
- headers?: (HeadersInit & (HeadersInit | {
854
- accept: "application/json" | "text/plain" | "application/octet-stream";
855
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
856
- authorization: "Bearer" | "Basic";
857
- })) | undefined;
858
- cache?: RequestCache | undefined;
859
- credentials?: RequestCredentials | undefined;
860
- integrity?: string | undefined;
861
- keepalive?: boolean | undefined;
862
- mode?: RequestMode | undefined;
863
- priority?: RequestPriority | undefined;
864
- redirect?: RequestRedirect | undefined;
865
- referrer?: string | undefined;
866
- referrerPolicy?: ReferrerPolicy | undefined;
867
- signal?: (AbortSignal | null) | undefined;
868
- window?: null | undefined;
869
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
870
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
871
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
872
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
873
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
874
- hookOptions?: {
875
- cloneResponse?: boolean;
876
- } | undefined;
877
- timeout?: number | undefined;
878
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
879
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
880
- baseURL?: string | undefined;
881
- throw?: boolean | undefined;
882
- auth?: ({
883
- type: "Bearer";
884
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
885
- } | {
886
- type: "Basic";
887
- username: string | (() => string | undefined) | undefined;
888
- password: string | (() => string | undefined) | undefined;
889
- } | {
890
- type: "Custom";
891
- prefix: string | (() => string | undefined) | undefined;
892
- value: string | (() => string | undefined) | undefined;
893
- }) | undefined;
894
- body?: (Partial<Partial<{}> & {
895
- name?: string;
896
- image?: string;
897
- }> & Record<string, any>) | undefined;
898
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
899
- params?: Record<string, any> | undefined;
900
- duplex?: "full" | "half" | undefined;
901
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
902
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
903
- retryAttempt?: number | undefined;
904
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
905
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
906
- disableValidation?: boolean | undefined;
907
- }>(data_0?: import("better-auth").Prettify<{
908
- image?: string | null;
909
- name?: string;
910
- fetchOptions?: FetchOptions | undefined;
911
- } & Partial<{}>> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
912
- status: boolean;
913
- }, {
914
- code?: string;
915
- message?: string;
916
- }, FetchOptions["throw"] extends true ? true : false>>;
917
- } & {
918
- deleteUser: <FetchOptions extends {
919
- method?: string | undefined;
920
- headers?: (HeadersInit & (HeadersInit | {
921
- accept: "application/json" | "text/plain" | "application/octet-stream";
922
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
923
- authorization: "Bearer" | "Basic";
924
- })) | undefined;
925
- cache?: RequestCache | undefined;
926
- credentials?: RequestCredentials | undefined;
927
- integrity?: string | undefined;
928
- keepalive?: boolean | undefined;
929
- mode?: RequestMode | undefined;
930
- priority?: RequestPriority | undefined;
931
- redirect?: RequestRedirect | undefined;
932
- referrer?: string | undefined;
933
- referrerPolicy?: ReferrerPolicy | undefined;
934
- signal?: (AbortSignal | null) | undefined;
935
- window?: null | undefined;
936
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
937
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
938
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
939
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
940
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
941
- hookOptions?: {
942
- cloneResponse?: boolean;
943
- } | undefined;
944
- timeout?: number | undefined;
945
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
946
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
947
- baseURL?: string | undefined;
948
- throw?: boolean | undefined;
949
- auth?: ({
950
- type: "Bearer";
951
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
952
- } | {
953
- type: "Basic";
954
- username: string | (() => string | undefined) | undefined;
955
- password: string | (() => string | undefined) | undefined;
956
- } | {
957
- type: "Custom";
958
- prefix: string | (() => string | undefined) | undefined;
959
- value: string | (() => string | undefined) | undefined;
960
- }) | undefined;
961
- body?: (Partial<{
962
- callbackURL?: string | undefined;
963
- password?: string | undefined;
964
- token?: string | undefined;
965
- }> & Record<string, any>) | undefined;
966
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
967
- params?: Record<string, any> | undefined;
968
- duplex?: "full" | "half" | undefined;
969
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
970
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
971
- retryAttempt?: number | undefined;
972
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
973
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
974
- disableValidation?: boolean | undefined;
975
- }>(data_0?: import("better-auth").Prettify<{
317
+ deleteUser: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
976
318
  callbackURL?: string | undefined;
977
319
  password?: string | undefined;
978
320
  token?: string | undefined;
979
- } & {
980
- fetchOptions?: FetchOptions | undefined;
981
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
982
- success: boolean;
983
- message: string;
984
- }, {
985
- code?: string;
986
- message?: string;
987
- }, FetchOptions["throw"] extends true ? true : false>>;
988
- } & {
989
- resetPassword: {
990
- ":token": <FetchOptions extends {
991
- method?: string | undefined;
992
- headers?: (HeadersInit & (HeadersInit | {
993
- accept: "application/json" | "text/plain" | "application/octet-stream";
994
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
995
- authorization: "Bearer" | "Basic";
996
- })) | undefined;
997
- cache?: RequestCache | undefined;
998
- credentials?: RequestCredentials | undefined;
999
- integrity?: string | undefined;
1000
- keepalive?: boolean | undefined;
1001
- mode?: RequestMode | undefined;
1002
- priority?: RequestPriority | undefined;
1003
- redirect?: RequestRedirect | undefined;
1004
- referrer?: string | undefined;
1005
- referrerPolicy?: ReferrerPolicy | undefined;
1006
- signal?: (AbortSignal | null) | undefined;
1007
- window?: null | undefined;
1008
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1009
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1010
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1011
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1012
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1013
- hookOptions?: {
1014
- cloneResponse?: boolean;
1015
- } | undefined;
1016
- timeout?: number | undefined;
1017
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1018
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1019
- baseURL?: string | undefined;
1020
- throw?: boolean | undefined;
1021
- auth?: ({
1022
- type: "Bearer";
1023
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1024
- } | {
1025
- type: "Basic";
1026
- username: string | (() => string | undefined) | undefined;
1027
- password: string | (() => string | undefined) | undefined;
1028
- } | {
1029
- type: "Custom";
1030
- prefix: string | (() => string | undefined) | undefined;
1031
- value: string | (() => string | undefined) | undefined;
1032
- }) | undefined;
1033
- body?: undefined;
1034
- query?: (Partial<{
1035
- callbackURL: string;
1036
- }> & Record<string, any>) | undefined;
1037
- params?: {
1038
- token: string;
1039
- } | undefined;
1040
- duplex?: "full" | "half" | undefined;
1041
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1042
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1043
- retryAttempt?: number | undefined;
1044
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1045
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1046
- disableValidation?: boolean | undefined;
1047
- }>(data_0: import("better-auth").Prettify<{
1048
- query: {
1049
- callbackURL: string;
1050
- };
1051
- fetchOptions?: FetchOptions | undefined;
1052
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<never, {
1053
- code?: string;
1054
- message?: string;
1055
- }, FetchOptions["throw"] extends true ? true : false>>;
1056
- };
1057
- } & {
1058
- requestPasswordReset: <FetchOptions extends {
1059
- method?: string | undefined;
1060
- headers?: (HeadersInit & (HeadersInit | {
1061
- accept: "application/json" | "text/plain" | "application/octet-stream";
1062
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1063
- authorization: "Bearer" | "Basic";
1064
- })) | undefined;
1065
- cache?: RequestCache | undefined;
1066
- credentials?: RequestCredentials | undefined;
1067
- integrity?: string | undefined;
1068
- keepalive?: boolean | undefined;
1069
- mode?: RequestMode | undefined;
1070
- priority?: RequestPriority | undefined;
1071
- redirect?: RequestRedirect | undefined;
1072
- referrer?: string | undefined;
1073
- referrerPolicy?: ReferrerPolicy | undefined;
1074
- signal?: (AbortSignal | null) | undefined;
1075
- window?: null | undefined;
1076
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1077
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1078
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1079
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1080
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1081
- hookOptions?: {
1082
- cloneResponse?: boolean;
1083
- } | undefined;
1084
- timeout?: number | undefined;
1085
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1086
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1087
- baseURL?: string | undefined;
1088
- throw?: boolean | undefined;
1089
- auth?: ({
1090
- type: "Bearer";
1091
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1092
- } | {
1093
- type: "Basic";
1094
- username: string | (() => string | undefined) | undefined;
1095
- password: string | (() => string | undefined) | undefined;
1096
- } | {
1097
- type: "Custom";
1098
- prefix: string | (() => string | undefined) | undefined;
1099
- value: string | (() => string | undefined) | undefined;
1100
- }) | undefined;
1101
- body?: (Partial<{
1102
- email: string;
1103
- redirectTo?: string | undefined;
1104
- }> & Record<string, any>) | undefined;
1105
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1106
- params?: Record<string, any> | undefined;
1107
- duplex?: "full" | "half" | undefined;
1108
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1109
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1110
- retryAttempt?: number | undefined;
1111
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1112
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1113
- disableValidation?: boolean | undefined;
1114
- }>(data_0: import("better-auth").Prettify<{
1115
- email: string;
1116
- redirectTo?: string | undefined;
1117
- } & {
1118
- fetchOptions?: FetchOptions | undefined;
1119
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
1120
- status: boolean;
1121
- message: string;
1122
- }, {
1123
- code?: string;
1124
- message?: string;
1125
- }, FetchOptions["throw"] extends true ? true : false>>;
1126
- } & {
1127
- resetPassword: {
1128
- ":token": <FetchOptions extends {
1129
- method?: string | undefined;
1130
- headers?: (HeadersInit & (HeadersInit | {
1131
- accept: "application/json" | "text/plain" | "application/octet-stream";
1132
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1133
- authorization: "Bearer" | "Basic";
1134
- })) | undefined;
1135
- cache?: RequestCache | undefined;
1136
- credentials?: RequestCredentials | undefined;
1137
- integrity?: string | undefined;
1138
- keepalive?: boolean | undefined;
1139
- mode?: RequestMode | undefined;
1140
- priority?: RequestPriority | undefined;
1141
- redirect?: RequestRedirect | undefined;
1142
- referrer?: string | undefined;
1143
- referrerPolicy?: ReferrerPolicy | undefined;
1144
- signal?: (AbortSignal | null) | undefined;
1145
- window?: null | undefined;
1146
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1147
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1148
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1149
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1150
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1151
- hookOptions?: {
1152
- cloneResponse?: boolean;
1153
- } | undefined;
1154
- timeout?: number | undefined;
1155
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1156
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1157
- baseURL?: string | undefined;
1158
- throw?: boolean | undefined;
1159
- auth?: ({
1160
- type: "Bearer";
1161
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1162
- } | {
1163
- type: "Basic";
1164
- username: string | (() => string | undefined) | undefined;
1165
- password: string | (() => string | undefined) | undefined;
1166
- } | {
1167
- type: "Custom";
1168
- prefix: string | (() => string | undefined) | undefined;
1169
- value: string | (() => string | undefined) | undefined;
1170
- }) | undefined;
1171
- body?: undefined;
1172
- query?: (Partial<{
1173
- callbackURL: string;
1174
- }> & Record<string, any>) | undefined;
1175
- params?: {
1176
- token: string;
1177
- } | undefined;
1178
- duplex?: "full" | "half" | undefined;
1179
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1180
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1181
- retryAttempt?: number | undefined;
1182
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1183
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1184
- disableValidation?: boolean | undefined;
1185
- }>(data_0: import("better-auth").Prettify<{
1186
- query: {
1187
- callbackURL: string;
1188
- };
1189
- fetchOptions?: FetchOptions | undefined;
1190
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<never, {
1191
- code?: string;
1192
- message?: string;
1193
- }, FetchOptions["throw"] extends true ? true : false>>;
1194
- };
1195
- } & {
1196
- listSessions: <FetchOptions extends {
1197
- method?: string | undefined;
1198
- headers?: (HeadersInit & (HeadersInit | {
1199
- accept: "application/json" | "text/plain" | "application/octet-stream";
1200
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1201
- authorization: "Bearer" | "Basic";
1202
- })) | undefined;
1203
- cache?: RequestCache | undefined;
1204
- credentials?: RequestCredentials | undefined;
1205
- integrity?: string | undefined;
1206
- keepalive?: boolean | undefined;
1207
- mode?: RequestMode | undefined;
1208
- priority?: RequestPriority | undefined;
1209
- redirect?: RequestRedirect | undefined;
1210
- referrer?: string | undefined;
1211
- referrerPolicy?: ReferrerPolicy | undefined;
1212
- signal?: (AbortSignal | null) | undefined;
1213
- window?: null | undefined;
1214
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1215
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1216
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1217
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1218
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1219
- hookOptions?: {
1220
- cloneResponse?: boolean;
1221
- } | undefined;
1222
- timeout?: number | undefined;
1223
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1224
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1225
- baseURL?: string | undefined;
1226
- throw?: boolean | undefined;
1227
- auth?: ({
1228
- type: "Bearer";
1229
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1230
- } | {
1231
- type: "Basic";
1232
- username: string | (() => string | undefined) | undefined;
1233
- password: string | (() => string | undefined) | undefined;
1234
- } | {
1235
- type: "Custom";
1236
- prefix: string | (() => string | undefined) | undefined;
1237
- value: string | (() => string | undefined) | undefined;
1238
- }) | undefined;
1239
- body?: undefined;
1240
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1241
- params?: Record<string, any> | undefined;
1242
- duplex?: "full" | "half" | undefined;
1243
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1244
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1245
- retryAttempt?: number | undefined;
1246
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1247
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1248
- disableValidation?: boolean | undefined;
1249
- }>(data_0?: import("better-auth").Prettify<{
321
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/client/plugins").Prettify<{
322
+ callbackURL?: string | undefined;
323
+ password?: string | undefined;
324
+ token?: string | undefined;
325
+ } & {
326
+ fetchOptions?: FetchOptions | undefined;
327
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
328
+ success: boolean;
329
+ message: string;
330
+ }, {
331
+ code?: string | undefined;
332
+ message?: string | undefined;
333
+ }, FetchOptions["throw"] extends true ? true : false>>;
334
+ } & {
335
+ requestPasswordReset: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
336
+ email: string;
337
+ redirectTo?: string | undefined;
338
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
339
+ email: string;
340
+ redirectTo?: string | undefined;
341
+ } & {
342
+ fetchOptions?: FetchOptions | undefined;
343
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
344
+ status: boolean;
345
+ message: string;
346
+ }, {
347
+ code?: string | undefined;
348
+ message?: string | undefined;
349
+ }, FetchOptions["throw"] extends true ? true : false>>;
350
+ } & {
351
+ resetPassword: {
352
+ ":token": <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
353
+ callbackURL: string;
354
+ }> & Record<string, any>, {
355
+ token: string;
356
+ }>>(data_0: import("better-auth/client/plugins").Prettify<{
357
+ query: {
358
+ callbackURL: string;
359
+ };
360
+ fetchOptions?: FetchOptions | undefined;
361
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<never, {
362
+ code?: string | undefined;
363
+ message?: string | undefined;
364
+ }, FetchOptions["throw"] extends true ? true : false>>;
365
+ };
366
+ } & {
367
+ listSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/client/plugins").Prettify<{
1250
368
  query?: Record<string, any> | undefined;
1251
369
  fetchOptions?: FetchOptions | undefined;
1252
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<import("better-auth").Prettify<{
370
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<import("better-auth/client/plugins").Prettify<{
1253
371
  id: string;
1254
372
  createdAt: Date;
1255
373
  updatedAt: Date;
@@ -1259,270 +377,44 @@ export declare function initAuth(config: {
1259
377
  ipAddress?: string | null | undefined | undefined;
1260
378
  userAgent?: string | null | undefined | undefined;
1261
379
  }>[], {
1262
- code?: string;
1263
- message?: string;
380
+ code?: string | undefined;
381
+ message?: string | undefined;
1264
382
  }, FetchOptions["throw"] extends true ? true : false>>;
1265
383
  } & {
1266
- revokeSession: <FetchOptions extends {
1267
- method?: string | undefined;
1268
- headers?: (HeadersInit & (HeadersInit | {
1269
- accept: "application/json" | "text/plain" | "application/octet-stream";
1270
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1271
- authorization: "Bearer" | "Basic";
1272
- })) | undefined;
1273
- cache?: RequestCache | undefined;
1274
- credentials?: RequestCredentials | undefined;
1275
- integrity?: string | undefined;
1276
- keepalive?: boolean | undefined;
1277
- mode?: RequestMode | undefined;
1278
- priority?: RequestPriority | undefined;
1279
- redirect?: RequestRedirect | undefined;
1280
- referrer?: string | undefined;
1281
- referrerPolicy?: ReferrerPolicy | undefined;
1282
- signal?: (AbortSignal | null) | undefined;
1283
- window?: null | undefined;
1284
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1285
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1286
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1287
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1288
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1289
- hookOptions?: {
1290
- cloneResponse?: boolean;
1291
- } | undefined;
1292
- timeout?: number | undefined;
1293
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1294
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1295
- baseURL?: string | undefined;
1296
- throw?: boolean | undefined;
1297
- auth?: ({
1298
- type: "Bearer";
1299
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1300
- } | {
1301
- type: "Basic";
1302
- username: string | (() => string | undefined) | undefined;
1303
- password: string | (() => string | undefined) | undefined;
1304
- } | {
1305
- type: "Custom";
1306
- prefix: string | (() => string | undefined) | undefined;
1307
- value: string | (() => string | undefined) | undefined;
1308
- }) | undefined;
1309
- body?: (Partial<{
1310
- token: string;
1311
- }> & Record<string, any>) | undefined;
1312
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1313
- params?: Record<string, any> | undefined;
1314
- duplex?: "full" | "half" | undefined;
1315
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1316
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1317
- retryAttempt?: number | undefined;
1318
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1319
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1320
- disableValidation?: boolean | undefined;
1321
- }>(data_0: import("better-auth").Prettify<{
384
+ revokeSession: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
385
+ token: string;
386
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
1322
387
  token: string;
1323
388
  } & {
1324
389
  fetchOptions?: FetchOptions | undefined;
1325
390
  }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
1326
391
  status: boolean;
1327
392
  }, {
1328
- code?: string;
1329
- message?: string;
393
+ code?: string | undefined;
394
+ message?: string | undefined;
1330
395
  }, FetchOptions["throw"] extends true ? true : false>>;
1331
396
  } & {
1332
- revokeSessions: <FetchOptions extends {
1333
- method?: string | undefined;
1334
- headers?: (HeadersInit & (HeadersInit | {
1335
- accept: "application/json" | "text/plain" | "application/octet-stream";
1336
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1337
- authorization: "Bearer" | "Basic";
1338
- })) | undefined;
1339
- cache?: RequestCache | undefined;
1340
- credentials?: RequestCredentials | undefined;
1341
- integrity?: string | undefined;
1342
- keepalive?: boolean | undefined;
1343
- mode?: RequestMode | undefined;
1344
- priority?: RequestPriority | undefined;
1345
- redirect?: RequestRedirect | undefined;
1346
- referrer?: string | undefined;
1347
- referrerPolicy?: ReferrerPolicy | undefined;
1348
- signal?: (AbortSignal | null) | undefined;
1349
- window?: null | undefined;
1350
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1351
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1352
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1353
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1354
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1355
- hookOptions?: {
1356
- cloneResponse?: boolean;
1357
- } | undefined;
1358
- timeout?: number | undefined;
1359
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1360
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1361
- baseURL?: string | undefined;
1362
- throw?: boolean | undefined;
1363
- auth?: ({
1364
- type: "Bearer";
1365
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1366
- } | {
1367
- type: "Basic";
1368
- username: string | (() => string | undefined) | undefined;
1369
- password: string | (() => string | undefined) | undefined;
1370
- } | {
1371
- type: "Custom";
1372
- prefix: string | (() => string | undefined) | undefined;
1373
- value: string | (() => string | undefined) | undefined;
1374
- }) | undefined;
1375
- body?: undefined;
1376
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1377
- params?: Record<string, any> | undefined;
1378
- duplex?: "full" | "half" | undefined;
1379
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1380
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1381
- retryAttempt?: number | undefined;
1382
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1383
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1384
- disableValidation?: boolean | undefined;
1385
- }>(data_0?: import("better-auth").Prettify<{
397
+ revokeSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/client/plugins").Prettify<{
1386
398
  query?: Record<string, any> | undefined;
1387
399
  fetchOptions?: FetchOptions | undefined;
1388
400
  }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
1389
401
  status: boolean;
1390
402
  }, {
1391
- code?: string;
1392
- message?: string;
403
+ code?: string | undefined;
404
+ message?: string | undefined;
1393
405
  }, FetchOptions["throw"] extends true ? true : false>>;
1394
406
  } & {
1395
- revokeOtherSessions: <FetchOptions extends {
1396
- method?: string | undefined;
1397
- headers?: (HeadersInit & (HeadersInit | {
1398
- accept: "application/json" | "text/plain" | "application/octet-stream";
1399
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1400
- authorization: "Bearer" | "Basic";
1401
- })) | undefined;
1402
- cache?: RequestCache | undefined;
1403
- credentials?: RequestCredentials | undefined;
1404
- integrity?: string | undefined;
1405
- keepalive?: boolean | undefined;
1406
- mode?: RequestMode | undefined;
1407
- priority?: RequestPriority | undefined;
1408
- redirect?: RequestRedirect | undefined;
1409
- referrer?: string | undefined;
1410
- referrerPolicy?: ReferrerPolicy | undefined;
1411
- signal?: (AbortSignal | null) | undefined;
1412
- window?: null | undefined;
1413
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1414
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1415
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1416
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1417
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1418
- hookOptions?: {
1419
- cloneResponse?: boolean;
1420
- } | undefined;
1421
- timeout?: number | undefined;
1422
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1423
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1424
- baseURL?: string | undefined;
1425
- throw?: boolean | undefined;
1426
- auth?: ({
1427
- type: "Bearer";
1428
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1429
- } | {
1430
- type: "Basic";
1431
- username: string | (() => string | undefined) | undefined;
1432
- password: string | (() => string | undefined) | undefined;
1433
- } | {
1434
- type: "Custom";
1435
- prefix: string | (() => string | undefined) | undefined;
1436
- value: string | (() => string | undefined) | undefined;
1437
- }) | undefined;
1438
- body?: undefined;
1439
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1440
- params?: Record<string, any> | undefined;
1441
- duplex?: "full" | "half" | undefined;
1442
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1443
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1444
- retryAttempt?: number | undefined;
1445
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1446
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1447
- disableValidation?: boolean | undefined;
1448
- }>(data_0?: import("better-auth").Prettify<{
407
+ revokeOtherSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/client/plugins").Prettify<{
1449
408
  query?: Record<string, any> | undefined;
1450
409
  fetchOptions?: FetchOptions | undefined;
1451
410
  }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
1452
411
  status: boolean;
1453
412
  }, {
1454
- code?: string;
1455
- message?: string;
413
+ code?: string | undefined;
414
+ message?: string | undefined;
1456
415
  }, FetchOptions["throw"] extends true ? true : false>>;
1457
416
  } & {
1458
- linkSocial: <FetchOptions extends {
1459
- method?: string | undefined;
1460
- headers?: (HeadersInit & (HeadersInit | {
1461
- accept: "application/json" | "text/plain" | "application/octet-stream";
1462
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1463
- authorization: "Bearer" | "Basic";
1464
- })) | undefined;
1465
- cache?: RequestCache | undefined;
1466
- credentials?: RequestCredentials | undefined;
1467
- integrity?: string | undefined;
1468
- keepalive?: boolean | undefined;
1469
- mode?: RequestMode | undefined;
1470
- priority?: RequestPriority | undefined;
1471
- redirect?: RequestRedirect | undefined;
1472
- referrer?: string | undefined;
1473
- referrerPolicy?: ReferrerPolicy | undefined;
1474
- signal?: (AbortSignal | null) | undefined;
1475
- window?: null | undefined;
1476
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1477
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1478
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1479
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1480
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1481
- hookOptions?: {
1482
- cloneResponse?: boolean;
1483
- } | undefined;
1484
- timeout?: number | undefined;
1485
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1486
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1487
- baseURL?: string | undefined;
1488
- throw?: boolean | undefined;
1489
- auth?: ({
1490
- type: "Bearer";
1491
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1492
- } | {
1493
- type: "Basic";
1494
- username: string | (() => string | undefined) | undefined;
1495
- password: string | (() => string | undefined) | undefined;
1496
- } | {
1497
- type: "Custom";
1498
- prefix: string | (() => string | undefined) | undefined;
1499
- value: string | (() => string | undefined) | undefined;
1500
- }) | undefined;
1501
- body?: (Partial<{
1502
- provider: unknown;
1503
- callbackURL?: string | undefined;
1504
- idToken?: {
1505
- token: string;
1506
- nonce?: string | undefined;
1507
- accessToken?: string | undefined;
1508
- refreshToken?: string | undefined;
1509
- scopes?: string[] | undefined;
1510
- } | undefined;
1511
- requestSignUp?: boolean | undefined;
1512
- scopes?: string[] | undefined;
1513
- errorCallbackURL?: string | undefined;
1514
- disableRedirect?: boolean | undefined;
1515
- }> & Record<string, any>) | undefined;
1516
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1517
- params?: Record<string, any> | undefined;
1518
- duplex?: "full" | "half" | undefined;
1519
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1520
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1521
- retryAttempt?: number | undefined;
1522
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1523
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1524
- disableValidation?: boolean | undefined;
1525
- }>(data_0: import("better-auth").Prettify<{
417
+ linkSocial: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
1526
418
  provider: unknown;
1527
419
  callbackURL?: string | undefined;
1528
420
  idToken?: {
@@ -1536,70 +428,33 @@ export declare function initAuth(config: {
1536
428
  scopes?: string[] | undefined;
1537
429
  errorCallbackURL?: string | undefined;
1538
430
  disableRedirect?: boolean | undefined;
1539
- } & {
1540
- fetchOptions?: FetchOptions | undefined;
1541
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
1542
- url: string;
1543
- redirect: boolean;
1544
- }, {
1545
- code?: string;
1546
- message?: string;
1547
- }, FetchOptions["throw"] extends true ? true : false>>;
1548
- } & {
1549
- listAccounts: <FetchOptions extends {
1550
- method?: string | undefined;
1551
- headers?: (HeadersInit & (HeadersInit | {
1552
- accept: "application/json" | "text/plain" | "application/octet-stream";
1553
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1554
- authorization: "Bearer" | "Basic";
1555
- })) | undefined;
1556
- cache?: RequestCache | undefined;
1557
- credentials?: RequestCredentials | undefined;
1558
- integrity?: string | undefined;
1559
- keepalive?: boolean | undefined;
1560
- mode?: RequestMode | undefined;
1561
- priority?: RequestPriority | undefined;
1562
- redirect?: RequestRedirect | undefined;
1563
- referrer?: string | undefined;
1564
- referrerPolicy?: ReferrerPolicy | undefined;
1565
- signal?: (AbortSignal | null) | undefined;
1566
- window?: null | undefined;
1567
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1568
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1569
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1570
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1571
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1572
- hookOptions?: {
1573
- cloneResponse?: boolean;
1574
- } | undefined;
1575
- timeout?: number | undefined;
1576
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1577
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1578
- baseURL?: string | undefined;
1579
- throw?: boolean | undefined;
1580
- auth?: ({
1581
- type: "Bearer";
1582
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1583
- } | {
1584
- type: "Basic";
1585
- username: string | (() => string | undefined) | undefined;
1586
- password: string | (() => string | undefined) | undefined;
1587
- } | {
1588
- type: "Custom";
1589
- prefix: string | (() => string | undefined) | undefined;
1590
- value: string | (() => string | undefined) | undefined;
1591
- }) | undefined;
1592
- body?: undefined;
1593
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1594
- params?: Record<string, any> | undefined;
1595
- duplex?: "full" | "half" | undefined;
1596
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1597
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1598
- retryAttempt?: number | undefined;
1599
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1600
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1601
- disableValidation?: boolean | undefined;
1602
- }>(data_0?: import("better-auth").Prettify<{
431
+ additionalData?: Record<string, any> | undefined;
432
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
433
+ provider: unknown;
434
+ callbackURL?: string | undefined;
435
+ idToken?: {
436
+ token: string;
437
+ nonce?: string | undefined;
438
+ accessToken?: string | undefined;
439
+ refreshToken?: string | undefined;
440
+ scopes?: string[] | undefined;
441
+ } | undefined;
442
+ requestSignUp?: boolean | undefined;
443
+ scopes?: string[] | undefined;
444
+ errorCallbackURL?: string | undefined;
445
+ disableRedirect?: boolean | undefined;
446
+ additionalData?: Record<string, any> | undefined;
447
+ } & {
448
+ fetchOptions?: FetchOptions | undefined;
449
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
450
+ url: string;
451
+ redirect: boolean;
452
+ }, {
453
+ code?: string | undefined;
454
+ message?: string | undefined;
455
+ }, FetchOptions["throw"] extends true ? true : false>>;
456
+ } & {
457
+ listAccounts: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/client/plugins").Prettify<{
1603
458
  query?: Record<string, any> | undefined;
1604
459
  fetchOptions?: FetchOptions | undefined;
1605
460
  }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
@@ -1608,70 +463,18 @@ export declare function initAuth(config: {
1608
463
  createdAt: Date;
1609
464
  updatedAt: Date;
1610
465
  accountId: string;
466
+ userId: string;
1611
467
  scopes: string[];
1612
468
  }[], {
1613
- code?: string;
1614
- message?: string;
469
+ code?: string | undefined;
470
+ message?: string | undefined;
1615
471
  }, FetchOptions["throw"] extends true ? true : false>>;
1616
472
  } & {
1617
473
  deleteUser: {
1618
- callback: <FetchOptions extends {
1619
- method?: string | undefined;
1620
- headers?: (HeadersInit & (HeadersInit | {
1621
- accept: "application/json" | "text/plain" | "application/octet-stream";
1622
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1623
- authorization: "Bearer" | "Basic";
1624
- })) | undefined;
1625
- cache?: RequestCache | undefined;
1626
- credentials?: RequestCredentials | undefined;
1627
- integrity?: string | undefined;
1628
- keepalive?: boolean | undefined;
1629
- mode?: RequestMode | undefined;
1630
- priority?: RequestPriority | undefined;
1631
- redirect?: RequestRedirect | undefined;
1632
- referrer?: string | undefined;
1633
- referrerPolicy?: ReferrerPolicy | undefined;
1634
- signal?: (AbortSignal | null) | undefined;
1635
- window?: null | undefined;
1636
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1637
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1638
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1639
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1640
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1641
- hookOptions?: {
1642
- cloneResponse?: boolean;
1643
- } | undefined;
1644
- timeout?: number | undefined;
1645
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1646
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1647
- baseURL?: string | undefined;
1648
- throw?: boolean | undefined;
1649
- auth?: ({
1650
- type: "Bearer";
1651
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1652
- } | {
1653
- type: "Basic";
1654
- username: string | (() => string | undefined) | undefined;
1655
- password: string | (() => string | undefined) | undefined;
1656
- } | {
1657
- type: "Custom";
1658
- prefix: string | (() => string | undefined) | undefined;
1659
- value: string | (() => string | undefined) | undefined;
1660
- }) | undefined;
1661
- body?: undefined;
1662
- query?: (Partial<{
1663
- token: string;
1664
- callbackURL?: string | undefined;
1665
- }> & Record<string, any>) | undefined;
1666
- params?: Record<string, any> | undefined;
1667
- duplex?: "full" | "half" | undefined;
1668
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1669
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1670
- retryAttempt?: number | undefined;
1671
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1672
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1673
- disableValidation?: boolean | undefined;
1674
- }>(data_0: import("better-auth").Prettify<{
474
+ callback: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
475
+ token: string;
476
+ callbackURL?: string | undefined;
477
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
1675
478
  query: {
1676
479
  token: string;
1677
480
  callbackURL?: string | undefined;
@@ -1681,68 +484,15 @@ export declare function initAuth(config: {
1681
484
  success: boolean;
1682
485
  message: string;
1683
486
  }, {
1684
- code?: string;
1685
- message?: string;
487
+ code?: string | undefined;
488
+ message?: string | undefined;
1686
489
  }, FetchOptions["throw"] extends true ? true : false>>;
1687
490
  };
1688
491
  } & {
1689
- unlinkAccount: <FetchOptions extends {
1690
- method?: string | undefined;
1691
- headers?: (HeadersInit & (HeadersInit | {
1692
- accept: "application/json" | "text/plain" | "application/octet-stream";
1693
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1694
- authorization: "Bearer" | "Basic";
1695
- })) | undefined;
1696
- cache?: RequestCache | undefined;
1697
- credentials?: RequestCredentials | undefined;
1698
- integrity?: string | undefined;
1699
- keepalive?: boolean | undefined;
1700
- mode?: RequestMode | undefined;
1701
- priority?: RequestPriority | undefined;
1702
- redirect?: RequestRedirect | undefined;
1703
- referrer?: string | undefined;
1704
- referrerPolicy?: ReferrerPolicy | undefined;
1705
- signal?: (AbortSignal | null) | undefined;
1706
- window?: null | undefined;
1707
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1708
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1709
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1710
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1711
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1712
- hookOptions?: {
1713
- cloneResponse?: boolean;
1714
- } | undefined;
1715
- timeout?: number | undefined;
1716
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1717
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1718
- baseURL?: string | undefined;
1719
- throw?: boolean | undefined;
1720
- auth?: ({
1721
- type: "Bearer";
1722
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1723
- } | {
1724
- type: "Basic";
1725
- username: string | (() => string | undefined) | undefined;
1726
- password: string | (() => string | undefined) | undefined;
1727
- } | {
1728
- type: "Custom";
1729
- prefix: string | (() => string | undefined) | undefined;
1730
- value: string | (() => string | undefined) | undefined;
1731
- }) | undefined;
1732
- body?: (Partial<{
1733
- providerId: string;
1734
- accountId?: string | undefined;
1735
- }> & Record<string, any>) | undefined;
1736
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1737
- params?: Record<string, any> | undefined;
1738
- duplex?: "full" | "half" | undefined;
1739
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1740
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1741
- retryAttempt?: number | undefined;
1742
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1743
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1744
- disableValidation?: boolean | undefined;
1745
- }>(data_0: import("better-auth").Prettify<{
492
+ unlinkAccount: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
493
+ providerId: string;
494
+ accountId?: string | undefined;
495
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
1746
496
  providerId: string;
1747
497
  accountId?: string | undefined;
1748
498
  } & {
@@ -1750,136 +500,39 @@ export declare function initAuth(config: {
1750
500
  }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
1751
501
  status: boolean;
1752
502
  }, {
1753
- code?: string;
1754
- message?: string;
503
+ code?: string | undefined;
504
+ message?: string | undefined;
1755
505
  }, FetchOptions["throw"] extends true ? true : false>>;
1756
506
  } & {
1757
- refreshToken: <FetchOptions extends {
1758
- method?: string | undefined;
1759
- headers?: (HeadersInit & (HeadersInit | {
1760
- accept: "application/json" | "text/plain" | "application/octet-stream";
1761
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1762
- authorization: "Bearer" | "Basic";
1763
- })) | undefined;
1764
- cache?: RequestCache | undefined;
1765
- credentials?: RequestCredentials | undefined;
1766
- integrity?: string | undefined;
1767
- keepalive?: boolean | undefined;
1768
- mode?: RequestMode | undefined;
1769
- priority?: RequestPriority | undefined;
1770
- redirect?: RequestRedirect | undefined;
1771
- referrer?: string | undefined;
1772
- referrerPolicy?: ReferrerPolicy | undefined;
1773
- signal?: (AbortSignal | null) | undefined;
1774
- window?: null | undefined;
1775
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1776
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1777
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1778
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1779
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1780
- hookOptions?: {
1781
- cloneResponse?: boolean;
1782
- } | undefined;
1783
- timeout?: number | undefined;
1784
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1785
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1786
- baseURL?: string | undefined;
1787
- throw?: boolean | undefined;
1788
- auth?: ({
1789
- type: "Bearer";
1790
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1791
- } | {
1792
- type: "Basic";
1793
- username: string | (() => string | undefined) | undefined;
1794
- password: string | (() => string | undefined) | undefined;
1795
- } | {
1796
- type: "Custom";
1797
- prefix: string | (() => string | undefined) | undefined;
1798
- value: string | (() => string | undefined) | undefined;
1799
- }) | undefined;
1800
- body?: (Partial<{
1801
- providerId: string;
1802
- accountId?: string | undefined;
1803
- userId?: string | undefined;
1804
- }> & Record<string, any>) | undefined;
1805
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1806
- params?: Record<string, any> | undefined;
1807
- duplex?: "full" | "half" | undefined;
1808
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1809
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1810
- retryAttempt?: number | undefined;
1811
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1812
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1813
- disableValidation?: boolean | undefined;
1814
- }>(data_0: import("better-auth").Prettify<{
507
+ refreshToken: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
508
+ providerId: string;
509
+ accountId?: string | undefined;
510
+ userId?: string | undefined;
511
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
1815
512
  providerId: string;
1816
513
  accountId?: string | undefined;
1817
514
  userId?: string | undefined;
1818
515
  } & {
1819
516
  fetchOptions?: FetchOptions | undefined;
1820
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<any, {
1821
- code?: string;
1822
- message?: string;
517
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
518
+ accessToken: string | undefined;
519
+ refreshToken: string | undefined;
520
+ accessTokenExpiresAt: Date | undefined;
521
+ refreshTokenExpiresAt: Date | undefined;
522
+ scope: string | null | undefined;
523
+ idToken: string | null | undefined;
524
+ providerId: string;
525
+ accountId: string;
526
+ }, {
527
+ code?: string | undefined;
528
+ message?: string | undefined;
1823
529
  }, FetchOptions["throw"] extends true ? true : false>>;
1824
530
  } & {
1825
- getAccessToken: <FetchOptions extends {
1826
- method?: string | undefined;
1827
- headers?: (HeadersInit & (HeadersInit | {
1828
- accept: "application/json" | "text/plain" | "application/octet-stream";
1829
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1830
- authorization: "Bearer" | "Basic";
1831
- })) | undefined;
1832
- cache?: RequestCache | undefined;
1833
- credentials?: RequestCredentials | undefined;
1834
- integrity?: string | undefined;
1835
- keepalive?: boolean | undefined;
1836
- mode?: RequestMode | undefined;
1837
- priority?: RequestPriority | undefined;
1838
- redirect?: RequestRedirect | undefined;
1839
- referrer?: string | undefined;
1840
- referrerPolicy?: ReferrerPolicy | undefined;
1841
- signal?: (AbortSignal | null) | undefined;
1842
- window?: null | undefined;
1843
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1844
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1845
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1846
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1847
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1848
- hookOptions?: {
1849
- cloneResponse?: boolean;
1850
- } | undefined;
1851
- timeout?: number | undefined;
1852
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1853
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1854
- baseURL?: string | undefined;
1855
- throw?: boolean | undefined;
1856
- auth?: ({
1857
- type: "Bearer";
1858
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1859
- } | {
1860
- type: "Basic";
1861
- username: string | (() => string | undefined) | undefined;
1862
- password: string | (() => string | undefined) | undefined;
1863
- } | {
1864
- type: "Custom";
1865
- prefix: string | (() => string | undefined) | undefined;
1866
- value: string | (() => string | undefined) | undefined;
1867
- }) | undefined;
1868
- body?: (Partial<{
1869
- providerId: string;
1870
- accountId?: string | undefined;
1871
- userId?: string | undefined;
1872
- }> & Record<string, any>) | undefined;
1873
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1874
- params?: Record<string, any> | undefined;
1875
- duplex?: "full" | "half" | undefined;
1876
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1877
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1878
- retryAttempt?: number | undefined;
1879
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1880
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1881
- disableValidation?: boolean | undefined;
1882
- }>(data_0: import("better-auth").Prettify<{
531
+ getAccessToken: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
532
+ providerId: string;
533
+ accountId?: string | undefined;
534
+ userId?: string | undefined;
535
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/client/plugins").Prettify<{
1883
536
  providerId: string;
1884
537
  accountId?: string | undefined;
1885
538
  userId?: string | undefined;
@@ -1891,134 +544,29 @@ export declare function initAuth(config: {
1891
544
  scopes: string[];
1892
545
  idToken: string | undefined;
1893
546
  }, {
1894
- code?: string;
1895
- message?: string;
547
+ code?: string | undefined;
548
+ message?: string | undefined;
1896
549
  }, FetchOptions["throw"] extends true ? true : false>>;
1897
550
  } & {
1898
- accountInfo: <FetchOptions extends {
1899
- method?: string | undefined;
1900
- headers?: (HeadersInit & (HeadersInit | {
1901
- accept: "application/json" | "text/plain" | "application/octet-stream";
1902
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1903
- authorization: "Bearer" | "Basic";
1904
- })) | undefined;
1905
- cache?: RequestCache | undefined;
1906
- credentials?: RequestCredentials | undefined;
1907
- integrity?: string | undefined;
1908
- keepalive?: boolean | undefined;
1909
- mode?: RequestMode | undefined;
1910
- priority?: RequestPriority | undefined;
1911
- redirect?: RequestRedirect | undefined;
1912
- referrer?: string | undefined;
1913
- referrerPolicy?: ReferrerPolicy | undefined;
1914
- signal?: (AbortSignal | null) | undefined;
1915
- window?: null | undefined;
1916
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1917
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1918
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1919
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1920
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1921
- hookOptions?: {
1922
- cloneResponse?: boolean;
551
+ accountInfo: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
552
+ accountId?: string | undefined;
553
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/client/plugins").Prettify<{
554
+ query?: {
555
+ accountId?: string | undefined;
1923
556
  } | undefined;
1924
- timeout?: number | undefined;
1925
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1926
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1927
- baseURL?: string | undefined;
1928
- throw?: boolean | undefined;
1929
- auth?: ({
1930
- type: "Bearer";
1931
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1932
- } | {
1933
- type: "Basic";
1934
- username: string | (() => string | undefined) | undefined;
1935
- password: string | (() => string | undefined) | undefined;
1936
- } | {
1937
- type: "Custom";
1938
- prefix: string | (() => string | undefined) | undefined;
1939
- value: string | (() => string | undefined) | undefined;
1940
- }) | undefined;
1941
- body?: (Partial<{
1942
- accountId: string;
1943
- }> & Record<string, any>) | undefined;
1944
- query?: (Partial<Record<string, any>> & Record<string, any>) | undefined;
1945
- params?: Record<string, any> | undefined;
1946
- duplex?: "full" | "half" | undefined;
1947
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
1948
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
1949
- retryAttempt?: number | undefined;
1950
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
1951
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
1952
- disableValidation?: boolean | undefined;
1953
- }>(data_0: import("better-auth").Prettify<{
1954
- accountId: string;
1955
- } & {
1956
557
  fetchOptions?: FetchOptions | undefined;
1957
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
1958
- user: packages_core_dist_oauth2.OAuth2UserInfo;
558
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
559
+ user: import("better-auth").OAuth2UserInfo;
1959
560
  data: Record<string, any>;
1960
561
  }, {
1961
- code?: string;
1962
- message?: string;
562
+ code?: string | undefined;
563
+ message?: string | undefined;
1963
564
  }, FetchOptions["throw"] extends true ? true : false>>;
1964
565
  } & {
1965
- getSession: <FetchOptions extends {
1966
- method?: string | undefined;
1967
- headers?: (HeadersInit & (HeadersInit | {
1968
- accept: "application/json" | "text/plain" | "application/octet-stream";
1969
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
1970
- authorization: "Bearer" | "Basic";
1971
- })) | undefined;
1972
- cache?: RequestCache | undefined;
1973
- credentials?: RequestCredentials | undefined;
1974
- integrity?: string | undefined;
1975
- keepalive?: boolean | undefined;
1976
- mode?: RequestMode | undefined;
1977
- priority?: RequestPriority | undefined;
1978
- redirect?: RequestRedirect | undefined;
1979
- referrer?: string | undefined;
1980
- referrerPolicy?: ReferrerPolicy | undefined;
1981
- signal?: (AbortSignal | null) | undefined;
1982
- window?: null | undefined;
1983
- onRequest?: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
1984
- onResponse?: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
1985
- onSuccess?: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
1986
- onError?: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
1987
- onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
1988
- hookOptions?: {
1989
- cloneResponse?: boolean;
1990
- } | undefined;
1991
- timeout?: number | undefined;
1992
- customFetchImpl?: import("@better-fetch/fetch").FetchEsque | undefined;
1993
- plugins?: import("@better-fetch/fetch").BetterFetchPlugin[] | undefined;
1994
- baseURL?: string | undefined;
1995
- throw?: boolean | undefined;
1996
- auth?: ({
1997
- type: "Bearer";
1998
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
1999
- } | {
2000
- type: "Basic";
2001
- username: string | (() => string | undefined) | undefined;
2002
- password: string | (() => string | undefined) | undefined;
2003
- } | {
2004
- type: "Custom";
2005
- prefix: string | (() => string | undefined) | undefined;
2006
- value: string | (() => string | undefined) | undefined;
2007
- }) | undefined;
2008
- body?: undefined;
2009
- query?: (Partial<{
2010
- disableCookieCache?: unknown;
2011
- disableRefresh?: unknown;
2012
- }> & Record<string, any>) | undefined;
2013
- params?: Record<string, any> | undefined;
2014
- duplex?: "full" | "half" | undefined;
2015
- jsonParser?: ((text: string) => Promise<any> | any) | undefined;
2016
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
2017
- retryAttempt?: number | undefined;
2018
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
2019
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
2020
- disableValidation?: boolean | undefined;
2021
- }>(data_0?: import("better-auth").Prettify<{
566
+ getSession: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
567
+ disableCookieCache?: unknown;
568
+ disableRefresh?: unknown;
569
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/client/plugins").Prettify<{
2022
570
  query?: {
2023
571
  disableCookieCache?: unknown;
2024
572
  disableRefresh?: unknown;
@@ -2045,8 +593,8 @@ export declare function initAuth(config: {
2045
593
  userAgent?: string | null | undefined;
2046
594
  };
2047
595
  } | null, {
2048
- code?: string;
2049
- message?: string;
596
+ code?: string | undefined;
597
+ message?: string | undefined;
2050
598
  }, FetchOptions["throw"] extends true ? true : false>>;
2051
599
  } & {
2052
600
  useSession: () => {
@@ -2076,7 +624,7 @@ export declare function initAuth(config: {
2076
624
  error: import("@better-fetch/fetch").BetterFetchError | null;
2077
625
  refetch: (queryParams?: {
2078
626
  query?: import("better-auth").SessionQueryParams;
2079
- }) => void;
627
+ } | undefined) => Promise<void>;
2080
628
  };
2081
629
  $Infer: {
2082
630
  Session: {
@@ -2106,18 +654,25 @@ export declare function initAuth(config: {
2106
654
  id: string;
2107
655
  name: string;
2108
656
  hooks: {
2109
- onSuccess: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
2110
- onError: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
2111
- onRequest: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
2112
- onResponse: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
657
+ onSuccess(context: import("@better-fetch/fetch").SuccessContext<any>): void;
2113
658
  };
2114
659
  } | {
2115
660
  id: string;
2116
661
  name: string;
2117
662
  hooks: {
2118
- onSuccess(context: import("@better-fetch/fetch").SuccessContext<any>): void;
663
+ onRequest<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>): void;
664
+ };
665
+ } | {
666
+ id: string;
667
+ name: string;
668
+ hooks: {
669
+ onSuccess: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
670
+ onError: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
671
+ onRequest: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
672
+ onResponse: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
2119
673
  };
2120
674
  })[];
675
+ cache?: RequestCache | undefined;
2121
676
  method: string;
2122
677
  headers?: (HeadersInit & (HeadersInit | {
2123
678
  accept: "application/json" | "text/plain" | "application/octet-stream";
@@ -2125,7 +680,6 @@ export declare function initAuth(config: {
2125
680
  authorization: "Bearer" | "Basic";
2126
681
  })) | undefined;
2127
682
  redirect?: RequestRedirect | undefined;
2128
- cache?: RequestCache | undefined;
2129
683
  credentials?: RequestCredentials;
2130
684
  integrity?: string | undefined;
2131
685
  keepalive?: boolean | undefined;
@@ -2165,9 +719,10 @@ export declare function initAuth(config: {
2165
719
  output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
2166
720
  errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
2167
721
  disableValidation?: boolean | undefined;
722
+ disableSignal?: boolean | undefined;
2168
723
  }, unknown, unknown, {}>;
2169
724
  $store: {
2170
- notify: (signal?: Omit<string, "$sessionSignal"> | "$sessionSignal") => void;
725
+ notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
2171
726
  listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
2172
727
  atoms: Record<string, import("nanostores").WritableAtom<any>>;
2173
728
  };