@multiplatform.one/keycloak 6.4.3 → 6.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/keycloak",
3
- "version": "6.4.3",
3
+ "version": "6.7.0",
4
4
  "description": "keycloak client for multiplatform.one ecosystem",
5
5
  "keywords": [
6
6
  "auth",
@@ -54,8 +54,8 @@
54
54
  "@better-auth/expo": "^1.6.9",
55
55
  "better-auth": "^1.6.9",
56
56
  "jwt-decode": "^4.0.0",
57
- "@multiplatform.one/keycloak-js": "6.4.3",
58
- "@multiplatform.one/store": "6.4.3"
57
+ "@multiplatform.one/keycloak-js": "6.7.0",
58
+ "@multiplatform.one/store": "6.7.0"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@tamagui/build": "2.0.0-rc.41",
@@ -70,15 +70,15 @@
70
70
  "react": "19.2.5",
71
71
  "typescript": "~5.9.3",
72
72
  "vitest": "^4.1.5",
73
- "@multiplatform.one/config": "6.4.3",
74
- "@multiplatform.one/platform": "6.4.3",
75
- "@multiplatform.one/logger": "6.4.3",
76
- "@multiplatform.one/test-utils": "6.4.3"
73
+ "@multiplatform.one/config": "6.7.0",
74
+ "@multiplatform.one/platform": "6.7.0",
75
+ "@multiplatform.one/logger": "6.7.0",
76
+ "@multiplatform.one/test-utils": "6.7.0"
77
77
  },
78
78
  "peerDependencies": {
79
79
  "react": "^19.1.0",
80
- "@multiplatform.one/logger": "^6.4.3",
81
- "@multiplatform.one/platform": "^6.4.3"
80
+ "@multiplatform.one/logger": "^6.7.0",
81
+ "@multiplatform.one/platform": "^6.7.0"
82
82
  },
83
83
  "optionalDependencies": {
84
84
  "expo-linking": "^55.0.15",
@@ -90,7 +90,7 @@
90
90
  },
91
91
  "module:jsx": "dist/jsx",
92
92
  "scripts": {
93
- "typecheck": "tsc --noEmit",
93
+ "typecheck": "tsgo --noEmit",
94
94
  "build": "rm -rf dist types 2>/dev/null && node scripts/build.mjs && tsc -p tsconfig.build.json",
95
95
  "test": "vitest run --coverage --coverage.provider=v8 --coverage.reporter=text --coverage.reporter=lcov --coverage.reporter=html"
96
96
  }
@@ -10,7 +10,9 @@ import { isWeb } from "@multiplatform.one/platform";
10
10
 
11
11
  let _client: ReturnType<typeof createAuthClient> | undefined;
12
12
 
13
- export function getAuthClient(baseURL?: string) {
13
+ // Explicit return type: tsgo (TS7) rejects the inferred type as
14
+ // non-portable (it references better-auth's deep dist internals).
15
+ export function getAuthClient(baseURL?: string): ReturnType<typeof createAuthClient> {
14
16
  if (_client) return _client;
15
17
  _client = createAuthClient({
16
18
  baseURL: baseURL || (isWeb && typeof window !== "undefined" ? window.location.origin : ""),
@@ -3,796 +3,7 @@
3
3
  * Used by AuthProvider and useKeycloak on web platform.
4
4
  * Base URL is set at runtime via KeycloakProvider props (or defaults to same origin).
5
5
  */
6
- export declare function getAuthClient(baseURL?: string): {
7
- refreshToken: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
8
- providerId: string;
9
- accountId?: string | undefined;
10
- userId?: string | undefined;
11
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
12
- providerId: string;
13
- accountId?: string | undefined;
14
- userId?: string | undefined;
15
- } & {
16
- fetchOptions?: FetchOptions | undefined;
17
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
18
- accessToken: string | undefined;
19
- refreshToken: string;
20
- accessTokenExpiresAt: Date | undefined;
21
- refreshTokenExpiresAt: Date | null | undefined;
22
- scope: string | null | undefined;
23
- idToken: string | null | undefined;
24
- providerId: string;
25
- accountId: string;
26
- }, {
27
- code?: string | undefined;
28
- message?: string | undefined;
29
- }, FetchOptions["throw"] extends true ? true : false>>;
30
- } & {
31
- signIn: {
32
- social: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
33
- provider: (string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
34
- callbackURL?: string | undefined;
35
- newUserCallbackURL?: string | undefined;
36
- errorCallbackURL?: string | undefined;
37
- disableRedirect?: boolean | undefined;
38
- idToken?: {
39
- token: string;
40
- nonce?: string | undefined;
41
- accessToken?: string | undefined;
42
- refreshToken?: string | undefined;
43
- expiresAt?: number | undefined;
44
- user?: {
45
- name?: {
46
- firstName?: string | undefined;
47
- lastName?: string | undefined;
48
- } | undefined;
49
- email?: string | undefined;
50
- } | undefined;
51
- } | undefined;
52
- scopes?: string[] | undefined;
53
- requestSignUp?: boolean | undefined;
54
- loginHint?: string | undefined;
55
- additionalData?: Record<string, any> | undefined;
56
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
57
- provider: (string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
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;
68
- user?: {
69
- name?: {
70
- firstName?: string | undefined;
71
- lastName?: string | undefined;
72
- } | undefined;
73
- email?: string | undefined;
74
- } | undefined;
75
- } | undefined;
76
- scopes?: string[] | undefined;
77
- requestSignUp?: boolean | undefined;
78
- loginHint?: string | undefined;
79
- additionalData?: Record<string, any> | undefined;
80
- } & {
81
- fetchOptions?: FetchOptions | undefined;
82
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
83
- redirect: boolean;
84
- url: string;
85
- } | (Omit<{
86
- redirect: boolean;
87
- token: string;
88
- url: undefined;
89
- user: {
90
- id: string;
91
- createdAt: Date;
92
- updatedAt: Date;
93
- email: string;
94
- emailVerified: boolean;
95
- name: string;
96
- image?: string | null | undefined | undefined;
97
- };
98
- }, "user"> & {
99
- user: import("better-auth").StripEmptyObjects<{
100
- id: string;
101
- createdAt: Date;
102
- updatedAt: Date;
103
- email: string;
104
- emailVerified: boolean;
105
- name: string;
106
- image?: string | null | undefined;
107
- }>;
108
- }), {
109
- code?: string | undefined;
110
- message?: string | undefined;
111
- }, FetchOptions["throw"] extends true ? true : false>>;
112
- };
113
- } & {
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").Prettify<{
115
- query?: Record<string, any> | undefined;
116
- fetchOptions?: FetchOptions | undefined;
117
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
118
- success: boolean;
119
- }, {
120
- code?: string | undefined;
121
- message?: string | undefined;
122
- }, FetchOptions["throw"] extends true ? true : false>>;
123
- } & {
124
- signUp: {
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").Prettify<{
133
- email: string;
134
- name: string;
135
- password: string;
136
- image?: string | undefined;
137
- callbackURL?: string | undefined;
138
- fetchOptions?: FetchOptions | undefined;
139
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<(Omit<{
140
- token: null;
141
- user: {
142
- id: string;
143
- createdAt: Date;
144
- updatedAt: Date;
145
- email: string;
146
- emailVerified: boolean;
147
- name: string;
148
- image?: string | null | undefined | undefined;
149
- };
150
- }, "user"> & {
151
- user: import("better-auth").StripEmptyObjects<{
152
- id: string;
153
- createdAt: Date;
154
- updatedAt: Date;
155
- email: string;
156
- emailVerified: boolean;
157
- name: string;
158
- image?: string | null | undefined;
159
- }>;
160
- }) | (Omit<{
161
- token: string;
162
- user: {
163
- id: string;
164
- createdAt: Date;
165
- updatedAt: Date;
166
- email: string;
167
- emailVerified: boolean;
168
- name: string;
169
- image?: string | null | undefined | undefined;
170
- };
171
- }, "user"> & {
172
- user: import("better-auth").StripEmptyObjects<{
173
- id: string;
174
- createdAt: Date;
175
- updatedAt: Date;
176
- email: string;
177
- emailVerified: boolean;
178
- name: string;
179
- image?: string | null | undefined;
180
- }>;
181
- }), {
182
- code?: string | undefined;
183
- message?: string | undefined;
184
- }, FetchOptions["throw"] extends true ? true : false>>;
185
- };
186
- } & {
187
- signIn: {
188
- email: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
189
- email: string;
190
- password: string;
191
- callbackURL?: string | undefined;
192
- rememberMe?: boolean | undefined;
193
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
194
- email: string;
195
- password: string;
196
- callbackURL?: string | undefined;
197
- rememberMe?: boolean | undefined;
198
- } & {
199
- fetchOptions?: FetchOptions | undefined;
200
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<Omit<{
201
- redirect: boolean;
202
- token: string;
203
- url?: string | undefined;
204
- user: {
205
- id: string;
206
- createdAt: Date;
207
- updatedAt: Date;
208
- email: string;
209
- emailVerified: boolean;
210
- name: string;
211
- image?: string | null | undefined | undefined;
212
- };
213
- }, "user"> & {
214
- user: import("better-auth").StripEmptyObjects<{
215
- id: string;
216
- createdAt: Date;
217
- updatedAt: Date;
218
- email: string;
219
- emailVerified: boolean;
220
- name: string;
221
- image?: string | null | undefined;
222
- }>;
223
- }, {
224
- code?: string | undefined;
225
- message?: string | undefined;
226
- }, FetchOptions["throw"] extends true ? true : false>>;
227
- };
228
- } & {
229
- resetPassword: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
230
- newPassword: string;
231
- token?: string | undefined;
232
- }> & Record<string, any>, Partial<{
233
- token?: string | undefined;
234
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
235
- newPassword: string;
236
- token?: string | undefined;
237
- } & {
238
- fetchOptions?: FetchOptions | undefined;
239
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
240
- status: boolean;
241
- }, {
242
- code?: string | undefined;
243
- message?: string | undefined;
244
- }, FetchOptions["throw"] extends true ? true : false>>;
245
- } & {
246
- verifyEmail: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
247
- token: string;
248
- callbackURL?: string | undefined;
249
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
250
- query: {
251
- token: string;
252
- callbackURL?: string | undefined;
253
- };
254
- fetchOptions?: FetchOptions | undefined;
255
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<NonNullable<void | {
256
- status: boolean;
257
- }>, {
258
- code?: string | undefined;
259
- message?: string | undefined;
260
- }, FetchOptions["throw"] extends true ? true : false>>;
261
- } & {
262
- sendVerificationEmail: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
263
- email: string;
264
- callbackURL?: string | undefined;
265
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
266
- email: string;
267
- callbackURL?: string | undefined;
268
- } & {
269
- fetchOptions?: FetchOptions | undefined;
270
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
271
- status: boolean;
272
- }, {
273
- code?: string | undefined;
274
- message?: string | undefined;
275
- }, FetchOptions["throw"] extends true ? true : false>>;
276
- } & {
277
- changeEmail: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
278
- newEmail: string;
279
- callbackURL?: string | undefined;
280
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
281
- newEmail: string;
282
- callbackURL?: string | undefined;
283
- } & {
284
- fetchOptions?: FetchOptions | undefined;
285
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
286
- status: boolean;
287
- }, {
288
- code?: string | undefined;
289
- message?: string | undefined;
290
- }, FetchOptions["throw"] extends true ? true : false>>;
291
- } & {
292
- changePassword: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
293
- newPassword: string;
294
- currentPassword: string;
295
- revokeOtherSessions?: boolean | undefined;
296
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
297
- newPassword: string;
298
- currentPassword: string;
299
- revokeOtherSessions?: boolean | undefined;
300
- } & {
301
- fetchOptions?: FetchOptions | undefined;
302
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<Omit<{
303
- token: string | null;
304
- user: {
305
- id: string;
306
- createdAt: Date;
307
- updatedAt: Date;
308
- email: string;
309
- emailVerified: boolean;
310
- name: string;
311
- image?: string | null | undefined;
312
- } & Record<string, any> & {
313
- id: string;
314
- createdAt: Date;
315
- updatedAt: Date;
316
- email: string;
317
- emailVerified: boolean;
318
- name: string;
319
- image?: string | null | undefined;
320
- };
321
- }, "user"> & {
322
- user: import("better-auth").StripEmptyObjects<{
323
- id: string;
324
- createdAt: Date;
325
- updatedAt: Date;
326
- email: string;
327
- emailVerified: boolean;
328
- name: string;
329
- image?: string | null | undefined;
330
- }>;
331
- }, {
332
- code?: string | undefined;
333
- message?: string | undefined;
334
- }, FetchOptions["throw"] extends true ? true : false>>;
335
- } & {
336
- updateSession: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<Partial<{}>> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<Partial<{}> & {
337
- fetchOptions?: FetchOptions | undefined;
338
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
339
- session: {
340
- id: string;
341
- createdAt: Date;
342
- updatedAt: Date;
343
- userId: string;
344
- expiresAt: Date;
345
- token: string;
346
- ipAddress?: string | null | undefined;
347
- userAgent?: string | null | undefined;
348
- };
349
- }, {
350
- code?: string | undefined;
351
- message?: string | undefined;
352
- }, FetchOptions["throw"] extends true ? true : false>>;
353
- } & {
354
- updateUser: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<Partial<{}> & {
355
- name?: string | undefined;
356
- image?: string | undefined | null;
357
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<import("better-auth/client").InferUserUpdateCtx<import("better-auth").BetterAuthClientOptions, FetchOptions>> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
358
- status: boolean;
359
- }, {
360
- code?: string | undefined;
361
- message?: string | undefined;
362
- }, FetchOptions["throw"] extends true ? true : false>>;
363
- } & {
364
- deleteUser: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
365
- callbackURL?: string | undefined;
366
- password?: string | undefined;
367
- token?: string | undefined;
368
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
369
- callbackURL?: string | undefined;
370
- password?: string | undefined;
371
- token?: string | undefined;
372
- } & {
373
- fetchOptions?: FetchOptions | undefined;
374
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
375
- success: boolean;
376
- message: string;
377
- }, {
378
- code?: string | undefined;
379
- message?: string | undefined;
380
- }, FetchOptions["throw"] extends true ? true : false>>;
381
- } & {
382
- requestPasswordReset: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
383
- email: string;
384
- redirectTo?: string | undefined;
385
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
386
- email: string;
387
- redirectTo?: string | undefined;
388
- } & {
389
- fetchOptions?: FetchOptions | undefined;
390
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
391
- status: boolean;
392
- message: string;
393
- }, {
394
- code?: string | undefined;
395
- message?: string | undefined;
396
- }, FetchOptions["throw"] extends true ? true : false>>;
397
- } & {
398
- resetPassword: {
399
- ":token": <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
400
- callbackURL: string;
401
- }> & Record<string, any>, {
402
- token: string;
403
- }>>(data_0: import("better-auth").Prettify<{
404
- query: {
405
- callbackURL: string;
406
- };
407
- fetchOptions?: FetchOptions | undefined;
408
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<never, {
409
- code?: string | undefined;
410
- message?: string | undefined;
411
- }, FetchOptions["throw"] extends true ? true : false>>;
412
- };
413
- } & {
414
- listSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
415
- query?: Record<string, any> | undefined;
416
- fetchOptions?: FetchOptions | undefined;
417
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<import("better-auth").Prettify<{
418
- id: string;
419
- createdAt: Date;
420
- updatedAt: Date;
421
- userId: string;
422
- expiresAt: Date;
423
- token: string;
424
- ipAddress?: string | null | undefined | undefined;
425
- userAgent?: string | null | undefined | undefined;
426
- }>[], {
427
- code?: string | undefined;
428
- message?: string | undefined;
429
- }, FetchOptions["throw"] extends true ? true : false>>;
430
- } & {
431
- revokeSession: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
432
- token: string;
433
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
434
- token: string;
435
- } & {
436
- fetchOptions?: FetchOptions | undefined;
437
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
438
- status: boolean;
439
- }, {
440
- code?: string | undefined;
441
- message?: string | undefined;
442
- }, FetchOptions["throw"] extends true ? true : false>>;
443
- } & {
444
- revokeSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
445
- query?: Record<string, any> | undefined;
446
- fetchOptions?: FetchOptions | undefined;
447
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
448
- status: boolean;
449
- }, {
450
- code?: string | undefined;
451
- message?: string | undefined;
452
- }, FetchOptions["throw"] extends true ? true : false>>;
453
- } & {
454
- revokeOtherSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
455
- query?: Record<string, any> | undefined;
456
- fetchOptions?: FetchOptions | undefined;
457
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
458
- status: boolean;
459
- }, {
460
- code?: string | undefined;
461
- message?: string | undefined;
462
- }, FetchOptions["throw"] extends true ? true : false>>;
463
- } & {
464
- linkSocial: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
465
- provider: unknown;
466
- callbackURL?: string | undefined;
467
- idToken?: {
468
- token: string;
469
- nonce?: string | undefined;
470
- accessToken?: string | undefined;
471
- refreshToken?: string | undefined;
472
- scopes?: string[] | undefined;
473
- } | undefined;
474
- requestSignUp?: boolean | undefined;
475
- scopes?: string[] | undefined;
476
- errorCallbackURL?: string | undefined;
477
- disableRedirect?: boolean | undefined;
478
- additionalData?: Record<string, any> | undefined;
479
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
480
- provider: unknown;
481
- callbackURL?: string | undefined;
482
- idToken?: {
483
- token: string;
484
- nonce?: string | undefined;
485
- accessToken?: string | undefined;
486
- refreshToken?: string | undefined;
487
- scopes?: string[] | undefined;
488
- } | undefined;
489
- requestSignUp?: boolean | undefined;
490
- scopes?: string[] | undefined;
491
- errorCallbackURL?: string | undefined;
492
- disableRedirect?: boolean | undefined;
493
- additionalData?: Record<string, any> | undefined;
494
- } & {
495
- fetchOptions?: FetchOptions | undefined;
496
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
497
- url: string;
498
- redirect: boolean;
499
- }, {
500
- code?: string | undefined;
501
- message?: string | undefined;
502
- }, FetchOptions["throw"] extends true ? true : false>>;
503
- } & {
504
- listAccounts: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
505
- query?: Record<string, any> | undefined;
506
- fetchOptions?: FetchOptions | undefined;
507
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
508
- scopes: string[];
509
- id: string;
510
- createdAt: Date;
511
- updatedAt: Date;
512
- userId: string;
513
- providerId: string;
514
- accountId: string;
515
- }[], {
516
- code?: string | undefined;
517
- message?: string | undefined;
518
- }, FetchOptions["throw"] extends true ? true : false>>;
519
- } & {
520
- deleteUser: {
521
- callback: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
522
- token: string;
523
- callbackURL?: string | undefined;
524
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
525
- query: {
526
- token: string;
527
- callbackURL?: string | undefined;
528
- };
529
- fetchOptions?: FetchOptions | undefined;
530
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
531
- success: boolean;
532
- message: string;
533
- }, {
534
- code?: string | undefined;
535
- message?: string | undefined;
536
- }, FetchOptions["throw"] extends true ? true : false>>;
537
- };
538
- } & {
539
- unlinkAccount: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
540
- providerId: string;
541
- accountId?: string | undefined;
542
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
543
- providerId: string;
544
- accountId?: string | undefined;
545
- } & {
546
- fetchOptions?: FetchOptions | undefined;
547
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
548
- status: boolean;
549
- }, {
550
- code?: string | undefined;
551
- message?: string | undefined;
552
- }, FetchOptions["throw"] extends true ? true : false>>;
553
- } & {
554
- getAccessToken: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
555
- providerId: string;
556
- accountId?: string | undefined;
557
- userId?: string | undefined;
558
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
559
- providerId: string;
560
- accountId?: string | undefined;
561
- userId?: string | undefined;
562
- } & {
563
- fetchOptions?: FetchOptions | undefined;
564
- }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
565
- accessToken: string;
566
- accessTokenExpiresAt: Date | undefined;
567
- scopes: string[];
568
- idToken: string | undefined;
569
- }, {
570
- code?: string | undefined;
571
- message?: string | undefined;
572
- }, FetchOptions["throw"] extends true ? true : false>>;
573
- } & {
574
- accountInfo: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
575
- accountId?: string | undefined;
576
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
577
- query?: {
578
- accountId?: string | undefined;
579
- } | undefined;
580
- fetchOptions?: FetchOptions | undefined;
581
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
582
- user: import("better-auth").OAuth2UserInfo;
583
- data: Record<string, any>;
584
- }, {
585
- code?: string | undefined;
586
- message?: string | undefined;
587
- }, FetchOptions["throw"] extends true ? true : false>>;
588
- } & {
589
- getSession: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
590
- disableCookieCache?: unknown;
591
- disableRefresh?: unknown;
592
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
593
- query?: {
594
- disableCookieCache?: unknown;
595
- disableRefresh?: unknown;
596
- } | undefined;
597
- fetchOptions?: FetchOptions | undefined;
598
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
599
- user: import("better-auth").StripEmptyObjects<{
600
- id: string;
601
- createdAt: Date;
602
- updatedAt: Date;
603
- email: string;
604
- emailVerified: boolean;
605
- name: string;
606
- image?: string | null | undefined;
607
- }>;
608
- session: import("better-auth").StripEmptyObjects<{
609
- id: string;
610
- createdAt: Date;
611
- updatedAt: Date;
612
- userId: string;
613
- expiresAt: Date;
614
- token: string;
615
- ipAddress?: string | null | undefined;
616
- userAgent?: string | null | undefined;
617
- }>;
618
- } | null, {
619
- code?: string | undefined;
620
- message?: string | undefined;
621
- }, FetchOptions["throw"] extends true ? true : false>>;
622
- } & {
623
- useSession: () => {
624
- data: {
625
- user: import("better-auth").StripEmptyObjects<{
626
- id: string;
627
- createdAt: Date;
628
- updatedAt: Date;
629
- email: string;
630
- emailVerified: boolean;
631
- name: string;
632
- image?: string | null | undefined;
633
- }>;
634
- session: import("better-auth").StripEmptyObjects<{
635
- id: string;
636
- createdAt: Date;
637
- updatedAt: Date;
638
- userId: string;
639
- expiresAt: Date;
640
- token: string;
641
- ipAddress?: string | null | undefined;
642
- userAgent?: string | null | undefined;
643
- }>;
644
- } | null;
645
- isPending: boolean;
646
- isRefetching: boolean;
647
- error: import("@better-fetch/fetch").BetterFetchError | null;
648
- refetch: (queryParams?: {
649
- query?: import("better-auth").SessionQueryParams;
650
- } | undefined) => Promise<void>;
651
- };
652
- $Infer: {
653
- Session: {
654
- user: import("better-auth").StripEmptyObjects<{
655
- id: string;
656
- createdAt: Date;
657
- updatedAt: Date;
658
- email: string;
659
- emailVerified: boolean;
660
- name: string;
661
- image?: string | null | undefined;
662
- }>;
663
- session: import("better-auth").StripEmptyObjects<{
664
- id: string;
665
- createdAt: Date;
666
- updatedAt: Date;
667
- userId: string;
668
- expiresAt: Date;
669
- token: string;
670
- ipAddress?: string | null | undefined;
671
- userAgent?: string | null | undefined;
672
- }>;
673
- };
674
- };
675
- $fetch: import("@better-fetch/fetch").BetterFetch<{
676
- plugins: (import("@better-fetch/fetch").BetterFetchPlugin<Record<string, any>> | {
677
- id: string;
678
- name: string;
679
- hooks: {
680
- onSuccess(context: import("@better-fetch/fetch").SuccessContext<any>): void;
681
- };
682
- } | {
683
- id: string;
684
- name: string;
685
- hooks: {
686
- onSuccess: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
687
- onError: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
688
- 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;
689
- onResponse: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
690
- };
691
- })[];
692
- priority?: RequestPriority | undefined;
693
- cache?: RequestCache | undefined;
694
- credentials?: RequestCredentials;
695
- headers?: (HeadersInit & (HeadersInit | {
696
- accept: "application/json" | "text/plain" | "application/octet-stream";
697
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
698
- authorization: "Bearer" | "Basic";
699
- })) | undefined;
700
- integrity?: string | undefined;
701
- keepalive?: boolean | undefined;
702
- method: string;
703
- mode?: RequestMode | undefined;
704
- redirect?: RequestRedirect | undefined;
705
- referrer?: string | undefined;
706
- referrerPolicy?: ReferrerPolicy | undefined;
707
- signal?: (AbortSignal | null) | undefined;
708
- window?: null | 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;
715
- baseURL: string;
716
- throw?: boolean | undefined;
717
- auth?: ({
718
- type: "Bearer";
719
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
720
- } | {
721
- type: "Basic";
722
- username: string | (() => string | undefined) | undefined;
723
- password: string | (() => string | undefined) | undefined;
724
- } | {
725
- type: "Custom";
726
- prefix: string | (() => string | undefined) | undefined;
727
- value: string | (() => string | undefined) | undefined;
728
- }) | undefined;
729
- body?: any;
730
- query?: any;
731
- params?: any;
732
- duplex?: "full" | "half" | undefined;
733
- jsonParser: (text: string) => Promise<any> | any;
734
- retry?: import("@better-fetch/fetch").RetryOptions | undefined;
735
- retryAttempt?: number | undefined;
736
- output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
737
- errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
738
- disableValidation?: boolean | undefined;
739
- disableSignal?: boolean | undefined;
740
- }, unknown, unknown, {}>;
741
- $store: {
742
- notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
743
- listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
744
- atoms: Record<string, import("nanostores").WritableAtom<any>>;
745
- };
746
- $ERROR_CODES: {
747
- USER_NOT_FOUND: import("better-auth").RawError<"USER_NOT_FOUND">;
748
- FAILED_TO_CREATE_USER: import("better-auth").RawError<"FAILED_TO_CREATE_USER">;
749
- FAILED_TO_CREATE_SESSION: import("better-auth").RawError<"FAILED_TO_CREATE_SESSION">;
750
- FAILED_TO_UPDATE_USER: import("better-auth").RawError<"FAILED_TO_UPDATE_USER">;
751
- FAILED_TO_GET_SESSION: import("better-auth").RawError<"FAILED_TO_GET_SESSION">;
752
- INVALID_PASSWORD: import("better-auth").RawError<"INVALID_PASSWORD">;
753
- INVALID_EMAIL: import("better-auth").RawError<"INVALID_EMAIL">;
754
- INVALID_EMAIL_OR_PASSWORD: import("better-auth").RawError<"INVALID_EMAIL_OR_PASSWORD">;
755
- INVALID_USER: import("better-auth").RawError<"INVALID_USER">;
756
- SOCIAL_ACCOUNT_ALREADY_LINKED: import("better-auth").RawError<"SOCIAL_ACCOUNT_ALREADY_LINKED">;
757
- PROVIDER_NOT_FOUND: import("better-auth").RawError<"PROVIDER_NOT_FOUND">;
758
- INVALID_TOKEN: import("better-auth").RawError<"INVALID_TOKEN">;
759
- TOKEN_EXPIRED: import("better-auth").RawError<"TOKEN_EXPIRED">;
760
- ID_TOKEN_NOT_SUPPORTED: import("better-auth").RawError<"ID_TOKEN_NOT_SUPPORTED">;
761
- FAILED_TO_GET_USER_INFO: import("better-auth").RawError<"FAILED_TO_GET_USER_INFO">;
762
- USER_EMAIL_NOT_FOUND: import("better-auth").RawError<"USER_EMAIL_NOT_FOUND">;
763
- EMAIL_NOT_VERIFIED: import("better-auth").RawError<"EMAIL_NOT_VERIFIED">;
764
- PASSWORD_TOO_SHORT: import("better-auth").RawError<"PASSWORD_TOO_SHORT">;
765
- PASSWORD_TOO_LONG: import("better-auth").RawError<"PASSWORD_TOO_LONG">;
766
- USER_ALREADY_EXISTS: import("better-auth").RawError<"USER_ALREADY_EXISTS">;
767
- USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: import("better-auth").RawError<"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL">;
768
- EMAIL_CAN_NOT_BE_UPDATED: import("better-auth").RawError<"EMAIL_CAN_NOT_BE_UPDATED">;
769
- CREDENTIAL_ACCOUNT_NOT_FOUND: import("better-auth").RawError<"CREDENTIAL_ACCOUNT_NOT_FOUND">;
770
- ACCOUNT_NOT_FOUND: import("better-auth").RawError<"ACCOUNT_NOT_FOUND">;
771
- SESSION_EXPIRED: import("better-auth").RawError<"SESSION_EXPIRED">;
772
- FAILED_TO_UNLINK_LAST_ACCOUNT: import("better-auth").RawError<"FAILED_TO_UNLINK_LAST_ACCOUNT">;
773
- USER_ALREADY_HAS_PASSWORD: import("better-auth").RawError<"USER_ALREADY_HAS_PASSWORD">;
774
- CROSS_SITE_NAVIGATION_LOGIN_BLOCKED: import("better-auth").RawError<"CROSS_SITE_NAVIGATION_LOGIN_BLOCKED">;
775
- VERIFICATION_EMAIL_NOT_ENABLED: import("better-auth").RawError<"VERIFICATION_EMAIL_NOT_ENABLED">;
776
- EMAIL_ALREADY_VERIFIED: import("better-auth").RawError<"EMAIL_ALREADY_VERIFIED">;
777
- EMAIL_MISMATCH: import("better-auth").RawError<"EMAIL_MISMATCH">;
778
- SESSION_NOT_FRESH: import("better-auth").RawError<"SESSION_NOT_FRESH">;
779
- LINKED_ACCOUNT_ALREADY_EXISTS: import("better-auth").RawError<"LINKED_ACCOUNT_ALREADY_EXISTS">;
780
- INVALID_ORIGIN: import("better-auth").RawError<"INVALID_ORIGIN">;
781
- INVALID_CALLBACK_URL: import("better-auth").RawError<"INVALID_CALLBACK_URL">;
782
- INVALID_REDIRECT_URL: import("better-auth").RawError<"INVALID_REDIRECT_URL">;
783
- INVALID_ERROR_CALLBACK_URL: import("better-auth").RawError<"INVALID_ERROR_CALLBACK_URL">;
784
- INVALID_NEW_USER_CALLBACK_URL: import("better-auth").RawError<"INVALID_NEW_USER_CALLBACK_URL">;
785
- MISSING_OR_NULL_ORIGIN: import("better-auth").RawError<"MISSING_OR_NULL_ORIGIN">;
786
- CALLBACK_URL_REQUIRED: import("better-auth").RawError<"CALLBACK_URL_REQUIRED">;
787
- FAILED_TO_CREATE_VERIFICATION: import("better-auth").RawError<"FAILED_TO_CREATE_VERIFICATION">;
788
- FIELD_NOT_ALLOWED: import("better-auth").RawError<"FIELD_NOT_ALLOWED">;
789
- ASYNC_VALIDATION_NOT_SUPPORTED: import("better-auth").RawError<"ASYNC_VALIDATION_NOT_SUPPORTED">;
790
- VALIDATION_ERROR: import("better-auth").RawError<"VALIDATION_ERROR">;
791
- MISSING_FIELD: import("better-auth").RawError<"MISSING_FIELD">;
792
- METHOD_NOT_ALLOWED_DEFER_SESSION_REQUIRED: import("better-auth").RawError<"METHOD_NOT_ALLOWED_DEFER_SESSION_REQUIRED">;
793
- BODY_MUST_BE_AN_OBJECT: import("better-auth").RawError<"BODY_MUST_BE_AN_OBJECT">;
794
- PASSWORD_ALREADY_SET: import("better-auth").RawError<"PASSWORD_ALREADY_SET">;
795
- };
796
- };
6
+ import { createAuthClient } from "better-auth/react";
7
+ export declare function getAuthClient(baseURL?: string): ReturnType<typeof createAuthClient>;
797
8
  export type AuthClient = ReturnType<typeof getAuthClient>;
798
9
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/betterAuth/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAU6hC,CAAC;iBAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAAy3C,CAAC;aAAwC,CAAC;mBAA2C,CAAC;eAAiC,CAAC;;;;;iBAA+U,CAAC;iBAAmC,CAAC;;YAAmD,CAAC;gBAAuC,CAAC;gBAA2C,CAAC;sBAAwC,CAAC;cAAwC,CAAC;cAA8C,CAAC;eAA+B,CAAC;mBAAyG,CAAC;yBAAuB,CAAC;;eAAyC,CAAC;;;aAA0G,CAAC;YAA+B,CAAC;;;;;;;;;;;;YAA+e,CAAC;aAAgB,CAAC;cAAiB,CAAC;cAAiB,CAAC;;aAA8F,CAAC;oBAAiE,CAAC;cAAgC,CAAC;mBAAkG,CAAC;yBAA0E,CAAC;qBAAwC,CAAC;;;uBAAkF,CAAC;+GAAuL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAHzuJ;AAED,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/betterAuth/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAQrD,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAOnF;AAED,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC"}