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