@choiceform/shared-auth 0.1.13 → 0.1.15

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