@1sat/connect 0.0.14 → 0.0.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.
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Sigma OAuth — PKCE flow helpers for Sigma Identity provider.
3
- *
4
- * These are standard OAuth 2.0 + PKCE utilities. No dependency on
5
- * @sigma-auth/better-auth-plugin — the consuming app's server-side
6
- * callback route handles the token exchange.
2
+ * Sigma OAuth — wraps @sigma-auth/better-auth-plugin/client for the
3
+ * standard Sigma Identity OAuth flow (PKCE, redirect, callback).
7
4
  */
5
+ import { type SigmaSignInOptions, sigmaClient } from '@sigma-auth/better-auth-plugin/client';
8
6
  /** Sigma Identity server URL */
9
7
  export declare const SIGMA_URL = "https://auth.sigmaidentity.com";
10
8
  export interface SigmaOAuthConfig {
@@ -12,8 +10,6 @@ export interface SigmaOAuthConfig {
12
10
  clientId: string;
13
11
  /** Local callback URL path (default: /auth/sigma/callback) */
14
12
  callbackURL?: string;
15
- /** Scopes to request (default: ['openid', 'profile']) */
16
- scopes?: string[];
17
13
  }
18
14
  export interface SigmaOAuthResult {
19
15
  /** BAP ID returned from the callback */
@@ -25,28 +21,970 @@ export interface SigmaOAuthResult {
25
21
  /** Access token */
26
22
  accessToken: string;
27
23
  }
24
+ type SigmaPluginActions = ReturnType<ReturnType<typeof sigmaClient>['getActions']>;
25
+ type SigmaAugmentedClient = {
26
+ sigma: SigmaPluginActions['sigma'];
27
+ signIn: {
28
+ sigma: SigmaPluginActions['signIn']['sigma'];
29
+ };
30
+ };
31
+ declare const baseAuthClient: {
32
+ signIn: {
33
+ social: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
34
+ 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";
35
+ callbackURL?: string | undefined;
36
+ newUserCallbackURL?: string | undefined;
37
+ errorCallbackURL?: string | undefined;
38
+ disableRedirect?: boolean | undefined;
39
+ idToken?: {
40
+ token: string;
41
+ nonce?: string | undefined;
42
+ accessToken?: string | undefined;
43
+ refreshToken?: string | undefined;
44
+ expiresAt?: number | undefined;
45
+ user?: {
46
+ name?: {
47
+ firstName?: string | undefined;
48
+ lastName?: string | undefined;
49
+ } | undefined;
50
+ email?: string | undefined;
51
+ } | undefined;
52
+ } | undefined;
53
+ scopes?: string[] | undefined;
54
+ requestSignUp?: boolean | undefined;
55
+ loginHint?: string | undefined;
56
+ additionalData?: Record<string, any> | undefined;
57
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
58
+ 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";
59
+ callbackURL?: string | undefined;
60
+ newUserCallbackURL?: string | undefined;
61
+ errorCallbackURL?: string | undefined;
62
+ disableRedirect?: boolean | undefined;
63
+ idToken?: {
64
+ token: string;
65
+ nonce?: string | undefined;
66
+ accessToken?: string | undefined;
67
+ refreshToken?: string | undefined;
68
+ expiresAt?: number | undefined;
69
+ user?: {
70
+ name?: {
71
+ firstName?: string | undefined;
72
+ lastName?: string | undefined;
73
+ } | undefined;
74
+ email?: string | undefined;
75
+ } | undefined;
76
+ } | undefined;
77
+ scopes?: string[] | undefined;
78
+ requestSignUp?: boolean | undefined;
79
+ loginHint?: string | undefined;
80
+ additionalData?: Record<string, any> | undefined;
81
+ } & {
82
+ fetchOptions?: FetchOptions | undefined;
83
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
84
+ redirect: boolean;
85
+ url: string;
86
+ } | (Omit<{
87
+ redirect: boolean;
88
+ token: string;
89
+ url: undefined;
90
+ user: {
91
+ id: string;
92
+ createdAt: Date;
93
+ updatedAt: Date;
94
+ email: string;
95
+ emailVerified: boolean;
96
+ name: string;
97
+ image?: string | null | undefined | undefined;
98
+ };
99
+ }, "user"> & {
100
+ user: import("better-auth").StripEmptyObjects<{
101
+ id: string;
102
+ createdAt: Date;
103
+ updatedAt: Date;
104
+ email: string;
105
+ emailVerified: boolean;
106
+ name: string;
107
+ image?: string | null | undefined;
108
+ }>;
109
+ }), {
110
+ code?: string | undefined;
111
+ message?: string | undefined;
112
+ }, FetchOptions["throw"] extends true ? true : false>>;
113
+ };
114
+ } & {
115
+ 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<{
116
+ query?: Record<string, any> | undefined;
117
+ fetchOptions?: FetchOptions | undefined;
118
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
119
+ success: boolean;
120
+ }, {
121
+ code?: string | undefined;
122
+ message?: string | undefined;
123
+ }, FetchOptions["throw"] extends true ? true : false>>;
124
+ } & {
125
+ signUp: {
126
+ email: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
127
+ name: string;
128
+ email: string;
129
+ password: string;
130
+ image?: string | undefined;
131
+ callbackURL?: string | undefined;
132
+ rememberMe?: boolean | undefined;
133
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
134
+ email: string;
135
+ name: string;
136
+ password: string;
137
+ image?: string | undefined;
138
+ callbackURL?: string | undefined;
139
+ fetchOptions?: FetchOptions | undefined;
140
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<(Omit<{
141
+ token: null;
142
+ user: {
143
+ id: string;
144
+ createdAt: Date;
145
+ updatedAt: Date;
146
+ email: string;
147
+ emailVerified: boolean;
148
+ name: string;
149
+ image?: string | null | undefined | undefined;
150
+ };
151
+ }, "user"> & {
152
+ user: import("better-auth").StripEmptyObjects<{
153
+ id: string;
154
+ createdAt: Date;
155
+ updatedAt: Date;
156
+ email: string;
157
+ emailVerified: boolean;
158
+ name: string;
159
+ image?: string | null | undefined;
160
+ }>;
161
+ }) | (Omit<{
162
+ token: string;
163
+ user: {
164
+ id: string;
165
+ createdAt: Date;
166
+ updatedAt: Date;
167
+ email: string;
168
+ emailVerified: boolean;
169
+ name: string;
170
+ image?: string | null | undefined | undefined;
171
+ };
172
+ }, "user"> & {
173
+ user: import("better-auth").StripEmptyObjects<{
174
+ id: string;
175
+ createdAt: Date;
176
+ updatedAt: Date;
177
+ email: string;
178
+ emailVerified: boolean;
179
+ name: string;
180
+ image?: string | null | undefined;
181
+ }>;
182
+ }), {
183
+ code?: string | undefined;
184
+ message?: string | undefined;
185
+ }, FetchOptions["throw"] extends true ? true : false>>;
186
+ };
187
+ } & {
188
+ signIn: {
189
+ email: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
190
+ email: string;
191
+ password: string;
192
+ callbackURL?: string | undefined;
193
+ rememberMe?: boolean | undefined;
194
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
195
+ email: string;
196
+ password: string;
197
+ callbackURL?: string | undefined;
198
+ rememberMe?: boolean | undefined;
199
+ } & {
200
+ fetchOptions?: FetchOptions | undefined;
201
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<Omit<{
202
+ redirect: boolean;
203
+ token: string;
204
+ url?: string | undefined;
205
+ user: {
206
+ id: string;
207
+ createdAt: Date;
208
+ updatedAt: Date;
209
+ email: string;
210
+ emailVerified: boolean;
211
+ name: string;
212
+ image?: string | null | undefined | undefined;
213
+ };
214
+ }, "user"> & {
215
+ user: import("better-auth").StripEmptyObjects<{
216
+ id: string;
217
+ createdAt: Date;
218
+ updatedAt: Date;
219
+ email: string;
220
+ emailVerified: boolean;
221
+ name: string;
222
+ image?: string | null | undefined;
223
+ }>;
224
+ }, {
225
+ code?: string | undefined;
226
+ message?: string | undefined;
227
+ }, FetchOptions["throw"] extends true ? true : false>>;
228
+ };
229
+ } & {
230
+ resetPassword: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
231
+ newPassword: string;
232
+ token?: string | undefined;
233
+ }> & Record<string, any>, Partial<{
234
+ token?: string | undefined;
235
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
236
+ newPassword: string;
237
+ token?: string | undefined;
238
+ } & {
239
+ fetchOptions?: FetchOptions | undefined;
240
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
241
+ status: boolean;
242
+ }, {
243
+ code?: string | undefined;
244
+ message?: string | undefined;
245
+ }, FetchOptions["throw"] extends true ? true : false>>;
246
+ } & {
247
+ verifyEmail: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
248
+ token: string;
249
+ callbackURL?: string | undefined;
250
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
251
+ query: {
252
+ token: string;
253
+ callbackURL?: string | undefined;
254
+ };
255
+ fetchOptions?: FetchOptions | undefined;
256
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<NonNullable<void | {
257
+ status: boolean;
258
+ }>, {
259
+ code?: string | undefined;
260
+ message?: string | undefined;
261
+ }, FetchOptions["throw"] extends true ? true : false>>;
262
+ } & {
263
+ sendVerificationEmail: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
264
+ email: string;
265
+ callbackURL?: string | undefined;
266
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
267
+ email: string;
268
+ callbackURL?: string | undefined;
269
+ } & {
270
+ fetchOptions?: FetchOptions | undefined;
271
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
272
+ status: boolean;
273
+ }, {
274
+ code?: string | undefined;
275
+ message?: string | undefined;
276
+ }, FetchOptions["throw"] extends true ? true : false>>;
277
+ } & {
278
+ changeEmail: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
279
+ newEmail: string;
280
+ callbackURL?: string | undefined;
281
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
282
+ newEmail: string;
283
+ callbackURL?: string | undefined;
284
+ } & {
285
+ fetchOptions?: FetchOptions | undefined;
286
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
287
+ status: boolean;
288
+ }, {
289
+ code?: string | undefined;
290
+ message?: string | undefined;
291
+ }, FetchOptions["throw"] extends true ? true : false>>;
292
+ } & {
293
+ changePassword: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
294
+ newPassword: string;
295
+ currentPassword: string;
296
+ revokeOtherSessions?: boolean | undefined;
297
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
298
+ newPassword: string;
299
+ currentPassword: string;
300
+ revokeOtherSessions?: boolean | undefined;
301
+ } & {
302
+ fetchOptions?: FetchOptions | undefined;
303
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<Omit<{
304
+ token: string | null;
305
+ user: {
306
+ id: string;
307
+ createdAt: Date;
308
+ updatedAt: Date;
309
+ email: string;
310
+ emailVerified: boolean;
311
+ name: string;
312
+ image?: string | null | undefined;
313
+ } & Record<string, any> & {
314
+ id: string;
315
+ createdAt: Date;
316
+ updatedAt: Date;
317
+ email: string;
318
+ emailVerified: boolean;
319
+ name: string;
320
+ image?: string | null | undefined;
321
+ };
322
+ }, "user"> & {
323
+ user: import("better-auth").StripEmptyObjects<{
324
+ id: string;
325
+ createdAt: Date;
326
+ updatedAt: Date;
327
+ email: string;
328
+ emailVerified: boolean;
329
+ name: string;
330
+ image?: string | null | undefined;
331
+ }>;
332
+ }, {
333
+ code?: string | undefined;
334
+ message?: string | undefined;
335
+ }, FetchOptions["throw"] extends true ? true : false>>;
336
+ } & {
337
+ 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<{}> & {
338
+ fetchOptions?: FetchOptions | undefined;
339
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
340
+ session: {
341
+ id: string;
342
+ createdAt: Date;
343
+ updatedAt: Date;
344
+ userId: string;
345
+ expiresAt: Date;
346
+ token: string;
347
+ ipAddress?: string | null | undefined;
348
+ userAgent?: string | null | undefined;
349
+ };
350
+ }, {
351
+ code?: string | undefined;
352
+ message?: string | undefined;
353
+ }, FetchOptions["throw"] extends true ? true : false>>;
354
+ } & {
355
+ updateUser: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<Partial<{}> & {
356
+ name?: string | undefined;
357
+ image?: string | undefined | null;
358
+ }> & 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<{
359
+ baseURL: string;
360
+ plugins: import("better-auth").BetterAuthClientPlugin[];
361
+ }, FetchOptions>> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
362
+ status: boolean;
363
+ }, {
364
+ code?: string | undefined;
365
+ message?: string | undefined;
366
+ }, FetchOptions["throw"] extends true ? true : false>>;
367
+ } & {
368
+ deleteUser: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
369
+ callbackURL?: string | undefined;
370
+ password?: string | undefined;
371
+ token?: string | undefined;
372
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
373
+ callbackURL?: string | undefined;
374
+ password?: string | undefined;
375
+ token?: string | undefined;
376
+ } & {
377
+ fetchOptions?: FetchOptions | undefined;
378
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
379
+ success: boolean;
380
+ message: string;
381
+ }, {
382
+ code?: string | undefined;
383
+ message?: string | undefined;
384
+ }, FetchOptions["throw"] extends true ? true : false>>;
385
+ } & {
386
+ requestPasswordReset: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
387
+ email: string;
388
+ redirectTo?: string | undefined;
389
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
390
+ email: string;
391
+ redirectTo?: string | undefined;
392
+ } & {
393
+ fetchOptions?: FetchOptions | undefined;
394
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
395
+ status: boolean;
396
+ message: string;
397
+ }, {
398
+ code?: string | undefined;
399
+ message?: string | undefined;
400
+ }, FetchOptions["throw"] extends true ? true : false>>;
401
+ } & {
402
+ resetPassword: {
403
+ ":token": <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
404
+ callbackURL: string;
405
+ }> & Record<string, any>, {
406
+ token: string;
407
+ }>>(data_0: import("better-auth").Prettify<{
408
+ query: {
409
+ callbackURL: string;
410
+ };
411
+ fetchOptions?: FetchOptions | undefined;
412
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<never, {
413
+ code?: string | undefined;
414
+ message?: string | undefined;
415
+ }, FetchOptions["throw"] extends true ? true : false>>;
416
+ };
417
+ } & {
418
+ 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<{
419
+ query?: Record<string, any> | undefined;
420
+ fetchOptions?: FetchOptions | undefined;
421
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<import("better-auth").Prettify<{
422
+ id: string;
423
+ createdAt: Date;
424
+ updatedAt: Date;
425
+ userId: string;
426
+ expiresAt: Date;
427
+ token: string;
428
+ ipAddress?: string | null | undefined | undefined;
429
+ userAgent?: string | null | undefined | undefined;
430
+ }>[], {
431
+ code?: string | undefined;
432
+ message?: string | undefined;
433
+ }, FetchOptions["throw"] extends true ? true : false>>;
434
+ } & {
435
+ revokeSession: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
436
+ token: string;
437
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
438
+ token: string;
439
+ } & {
440
+ fetchOptions?: FetchOptions | undefined;
441
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
442
+ status: boolean;
443
+ }, {
444
+ code?: string | undefined;
445
+ message?: string | undefined;
446
+ }, FetchOptions["throw"] extends true ? true : false>>;
447
+ } & {
448
+ 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<{
449
+ query?: Record<string, any> | undefined;
450
+ fetchOptions?: FetchOptions | undefined;
451
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
452
+ status: boolean;
453
+ }, {
454
+ code?: string | undefined;
455
+ message?: string | undefined;
456
+ }, FetchOptions["throw"] extends true ? true : false>>;
457
+ } & {
458
+ 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<{
459
+ query?: Record<string, any> | undefined;
460
+ fetchOptions?: FetchOptions | undefined;
461
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
462
+ status: boolean;
463
+ }, {
464
+ code?: string | undefined;
465
+ message?: string | undefined;
466
+ }, FetchOptions["throw"] extends true ? true : false>>;
467
+ } & {
468
+ linkSocial: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
469
+ provider: unknown;
470
+ callbackURL?: string | undefined;
471
+ idToken?: {
472
+ token: string;
473
+ nonce?: string | undefined;
474
+ accessToken?: string | undefined;
475
+ refreshToken?: string | undefined;
476
+ scopes?: string[] | undefined;
477
+ } | undefined;
478
+ requestSignUp?: boolean | undefined;
479
+ scopes?: string[] | undefined;
480
+ errorCallbackURL?: string | undefined;
481
+ disableRedirect?: boolean | undefined;
482
+ additionalData?: Record<string, any> | undefined;
483
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
484
+ provider: unknown;
485
+ callbackURL?: string | undefined;
486
+ idToken?: {
487
+ token: string;
488
+ nonce?: string | undefined;
489
+ accessToken?: string | undefined;
490
+ refreshToken?: string | undefined;
491
+ scopes?: string[] | undefined;
492
+ } | undefined;
493
+ requestSignUp?: boolean | undefined;
494
+ scopes?: string[] | undefined;
495
+ errorCallbackURL?: string | undefined;
496
+ disableRedirect?: boolean | undefined;
497
+ additionalData?: Record<string, any> | undefined;
498
+ } & {
499
+ fetchOptions?: FetchOptions | undefined;
500
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
501
+ url: string;
502
+ redirect: boolean;
503
+ }, {
504
+ code?: string | undefined;
505
+ message?: string | undefined;
506
+ }, FetchOptions["throw"] extends true ? true : false>>;
507
+ } & {
508
+ 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<{
509
+ query?: Record<string, any> | undefined;
510
+ fetchOptions?: FetchOptions | undefined;
511
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
512
+ scopes: string[];
513
+ id: string;
514
+ createdAt: Date;
515
+ updatedAt: Date;
516
+ userId: string;
517
+ providerId: string;
518
+ accountId: string;
519
+ }[], {
520
+ code?: string | undefined;
521
+ message?: string | undefined;
522
+ }, FetchOptions["throw"] extends true ? true : false>>;
523
+ } & {
524
+ deleteUser: {
525
+ callback: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
526
+ token: string;
527
+ callbackURL?: string | undefined;
528
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
529
+ query: {
530
+ token: string;
531
+ callbackURL?: string | undefined;
532
+ };
533
+ fetchOptions?: FetchOptions | undefined;
534
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
535
+ success: boolean;
536
+ message: string;
537
+ }, {
538
+ code?: string | undefined;
539
+ message?: string | undefined;
540
+ }, FetchOptions["throw"] extends true ? true : false>>;
541
+ };
542
+ } & {
543
+ unlinkAccount: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
544
+ providerId: string;
545
+ accountId?: string | undefined;
546
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
547
+ providerId: string;
548
+ accountId?: string | undefined;
549
+ } & {
550
+ fetchOptions?: FetchOptions | undefined;
551
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
552
+ status: boolean;
553
+ }, {
554
+ code?: string | undefined;
555
+ message?: string | undefined;
556
+ }, FetchOptions["throw"] extends true ? true : false>>;
557
+ } & {
558
+ refreshToken: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
559
+ providerId: string;
560
+ accountId?: string | undefined;
561
+ userId?: string | undefined;
562
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
563
+ providerId: string;
564
+ accountId?: string | undefined;
565
+ userId?: string | undefined;
566
+ } & {
567
+ fetchOptions?: FetchOptions | undefined;
568
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
569
+ accessToken: string | undefined;
570
+ refreshToken: string;
571
+ accessTokenExpiresAt: Date | undefined;
572
+ refreshTokenExpiresAt: Date | null | undefined;
573
+ scope: string | null | undefined;
574
+ idToken: string | null | undefined;
575
+ providerId: string;
576
+ accountId: string;
577
+ }, {
578
+ code?: string | undefined;
579
+ message?: string | undefined;
580
+ }, FetchOptions["throw"] extends true ? true : false>>;
581
+ } & {
582
+ getAccessToken: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
583
+ providerId: string;
584
+ accountId?: string | undefined;
585
+ userId?: string | undefined;
586
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
587
+ providerId: string;
588
+ accountId?: string | undefined;
589
+ userId?: string | undefined;
590
+ } & {
591
+ fetchOptions?: FetchOptions | undefined;
592
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
593
+ accessToken: string;
594
+ accessTokenExpiresAt: Date | undefined;
595
+ scopes: string[];
596
+ idToken: string | undefined;
597
+ }, {
598
+ code?: string | undefined;
599
+ message?: string | undefined;
600
+ }, FetchOptions["throw"] extends true ? true : false>>;
601
+ } & {
602
+ accountInfo: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
603
+ accountId?: string | undefined;
604
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
605
+ query?: {
606
+ accountId?: string | undefined;
607
+ } | undefined;
608
+ fetchOptions?: FetchOptions | undefined;
609
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
610
+ user: import("better-auth").OAuth2UserInfo;
611
+ data: Record<string, any>;
612
+ }, {
613
+ code?: string | undefined;
614
+ message?: string | undefined;
615
+ }, FetchOptions["throw"] extends true ? true : false>>;
616
+ } & {
617
+ getSession: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
618
+ disableCookieCache?: unknown;
619
+ disableRefresh?: unknown;
620
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
621
+ query?: {
622
+ disableCookieCache?: unknown;
623
+ disableRefresh?: unknown;
624
+ } | undefined;
625
+ fetchOptions?: FetchOptions | undefined;
626
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
627
+ user: import("better-auth").StripEmptyObjects<{
628
+ id: string;
629
+ createdAt: Date;
630
+ updatedAt: Date;
631
+ email: string;
632
+ emailVerified: boolean;
633
+ name: string;
634
+ image?: string | null | undefined;
635
+ }>;
636
+ session: import("better-auth").StripEmptyObjects<{
637
+ id: string;
638
+ createdAt: Date;
639
+ updatedAt: Date;
640
+ userId: string;
641
+ expiresAt: Date;
642
+ token: string;
643
+ ipAddress?: string | null | undefined;
644
+ userAgent?: string | null | undefined;
645
+ }>;
646
+ } | null, {
647
+ code?: string | undefined;
648
+ message?: string | undefined;
649
+ }, FetchOptions["throw"] extends true ? true : false>>;
650
+ } & {
651
+ useSession: import("nanostores").Atom<{
652
+ data: {
653
+ user: import("better-auth").StripEmptyObjects<{
654
+ id: string;
655
+ createdAt: Date;
656
+ updatedAt: Date;
657
+ email: string;
658
+ emailVerified: boolean;
659
+ name: string;
660
+ image?: string | null | undefined;
661
+ }>;
662
+ session: import("better-auth").StripEmptyObjects<{
663
+ id: string;
664
+ createdAt: Date;
665
+ updatedAt: Date;
666
+ userId: string;
667
+ expiresAt: Date;
668
+ token: string;
669
+ ipAddress?: string | null | undefined;
670
+ userAgent?: string | null | undefined;
671
+ }>;
672
+ } | null;
673
+ error: import("@better-fetch/fetch").BetterFetchError | null;
674
+ isPending: boolean;
675
+ isRefetching: boolean;
676
+ refetch: (queryParams?: {
677
+ query?: import("better-auth").SessionQueryParams;
678
+ } | undefined) => Promise<void>;
679
+ }>;
680
+ $fetch: import("@better-fetch/fetch").BetterFetch<{
681
+ plugins: (import("@better-fetch/fetch").BetterFetchPlugin<Record<string, any>> | {
682
+ id: string;
683
+ name: string;
684
+ hooks: {
685
+ onSuccess(context: import("@better-fetch/fetch").SuccessContext<any>): void;
686
+ };
687
+ } | {
688
+ id: string;
689
+ name: string;
690
+ hooks: {
691
+ onSuccess: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
692
+ onError: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
693
+ 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;
694
+ onResponse: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
695
+ };
696
+ })[];
697
+ cache?: RequestCache | undefined;
698
+ priority?: RequestPriority | undefined;
699
+ credentials?: RequestCredentials;
700
+ headers?: (HeadersInit & (HeadersInit | {
701
+ accept: "application/json" | "text/plain" | "application/octet-stream";
702
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
703
+ authorization: "Bearer" | "Basic";
704
+ })) | undefined;
705
+ integrity?: string | undefined;
706
+ keepalive?: boolean | undefined;
707
+ method: string;
708
+ mode?: RequestMode | undefined;
709
+ redirect?: RequestRedirect | undefined;
710
+ referrer?: string | undefined;
711
+ referrerPolicy?: ReferrerPolicy | undefined;
712
+ signal?: (AbortSignal | null) | undefined;
713
+ window?: null | undefined;
714
+ onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
715
+ hookOptions?: {
716
+ cloneResponse?: boolean;
717
+ } | undefined;
718
+ timeout?: number | undefined;
719
+ customFetchImpl: import("@better-fetch/fetch").FetchEsque;
720
+ baseURL: string;
721
+ throw?: boolean | undefined;
722
+ auth?: ({
723
+ type: "Bearer";
724
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
725
+ } | {
726
+ type: "Basic";
727
+ username: string | (() => string | undefined) | undefined;
728
+ password: string | (() => string | undefined) | undefined;
729
+ } | {
730
+ type: "Custom";
731
+ prefix: string | (() => string | undefined) | undefined;
732
+ value: string | (() => string | undefined) | undefined;
733
+ }) | undefined;
734
+ body?: any;
735
+ query?: any;
736
+ params?: any;
737
+ duplex?: "full" | "half" | undefined;
738
+ jsonParser: (text: string) => Promise<any> | any;
739
+ retry?: import("@better-fetch/fetch").RetryOptions | undefined;
740
+ retryAttempt?: number | undefined;
741
+ output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
742
+ errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
743
+ disableValidation?: boolean | undefined;
744
+ disableSignal?: boolean | undefined;
745
+ }, unknown, unknown, {}>;
746
+ $store: {
747
+ notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
748
+ listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
749
+ atoms: Record<string, import("nanostores").WritableAtom<any>>;
750
+ };
751
+ $Infer: {
752
+ Session: {
753
+ user: import("better-auth").StripEmptyObjects<{
754
+ id: string;
755
+ createdAt: Date;
756
+ updatedAt: Date;
757
+ email: string;
758
+ emailVerified: boolean;
759
+ name: string;
760
+ image?: string | null | undefined;
761
+ }>;
762
+ session: import("better-auth").StripEmptyObjects<{
763
+ id: string;
764
+ createdAt: Date;
765
+ updatedAt: Date;
766
+ userId: string;
767
+ expiresAt: Date;
768
+ token: string;
769
+ ipAddress?: string | null | undefined;
770
+ userAgent?: string | null | undefined;
771
+ }>;
772
+ };
773
+ };
774
+ $ERROR_CODES: {
775
+ USER_NOT_FOUND: {
776
+ readonly code: "USER_NOT_FOUND";
777
+ message: string;
778
+ };
779
+ FAILED_TO_CREATE_USER: {
780
+ readonly code: "FAILED_TO_CREATE_USER";
781
+ message: string;
782
+ };
783
+ FAILED_TO_CREATE_SESSION: {
784
+ readonly code: "FAILED_TO_CREATE_SESSION";
785
+ message: string;
786
+ };
787
+ FAILED_TO_UPDATE_USER: {
788
+ readonly code: "FAILED_TO_UPDATE_USER";
789
+ message: string;
790
+ };
791
+ FAILED_TO_GET_SESSION: {
792
+ readonly code: "FAILED_TO_GET_SESSION";
793
+ message: string;
794
+ };
795
+ INVALID_PASSWORD: {
796
+ readonly code: "INVALID_PASSWORD";
797
+ message: string;
798
+ };
799
+ INVALID_EMAIL: {
800
+ readonly code: "INVALID_EMAIL";
801
+ message: string;
802
+ };
803
+ INVALID_EMAIL_OR_PASSWORD: {
804
+ readonly code: "INVALID_EMAIL_OR_PASSWORD";
805
+ message: string;
806
+ };
807
+ INVALID_USER: {
808
+ readonly code: "INVALID_USER";
809
+ message: string;
810
+ };
811
+ SOCIAL_ACCOUNT_ALREADY_LINKED: {
812
+ readonly code: "SOCIAL_ACCOUNT_ALREADY_LINKED";
813
+ message: string;
814
+ };
815
+ PROVIDER_NOT_FOUND: {
816
+ readonly code: "PROVIDER_NOT_FOUND";
817
+ message: string;
818
+ };
819
+ INVALID_TOKEN: {
820
+ readonly code: "INVALID_TOKEN";
821
+ message: string;
822
+ };
823
+ TOKEN_EXPIRED: {
824
+ readonly code: "TOKEN_EXPIRED";
825
+ message: string;
826
+ };
827
+ ID_TOKEN_NOT_SUPPORTED: {
828
+ readonly code: "ID_TOKEN_NOT_SUPPORTED";
829
+ message: string;
830
+ };
831
+ FAILED_TO_GET_USER_INFO: {
832
+ readonly code: "FAILED_TO_GET_USER_INFO";
833
+ message: string;
834
+ };
835
+ USER_EMAIL_NOT_FOUND: {
836
+ readonly code: "USER_EMAIL_NOT_FOUND";
837
+ message: string;
838
+ };
839
+ EMAIL_NOT_VERIFIED: {
840
+ readonly code: "EMAIL_NOT_VERIFIED";
841
+ message: string;
842
+ };
843
+ PASSWORD_TOO_SHORT: {
844
+ readonly code: "PASSWORD_TOO_SHORT";
845
+ message: string;
846
+ };
847
+ PASSWORD_TOO_LONG: {
848
+ readonly code: "PASSWORD_TOO_LONG";
849
+ message: string;
850
+ };
851
+ USER_ALREADY_EXISTS: {
852
+ readonly code: "USER_ALREADY_EXISTS";
853
+ message: string;
854
+ };
855
+ USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: {
856
+ readonly code: "USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL";
857
+ message: string;
858
+ };
859
+ EMAIL_CAN_NOT_BE_UPDATED: {
860
+ readonly code: "EMAIL_CAN_NOT_BE_UPDATED";
861
+ message: string;
862
+ };
863
+ CREDENTIAL_ACCOUNT_NOT_FOUND: {
864
+ readonly code: "CREDENTIAL_ACCOUNT_NOT_FOUND";
865
+ message: string;
866
+ };
867
+ ACCOUNT_NOT_FOUND: {
868
+ readonly code: "ACCOUNT_NOT_FOUND";
869
+ message: string;
870
+ };
871
+ SESSION_EXPIRED: {
872
+ readonly code: "SESSION_EXPIRED";
873
+ message: string;
874
+ };
875
+ FAILED_TO_UNLINK_LAST_ACCOUNT: {
876
+ readonly code: "FAILED_TO_UNLINK_LAST_ACCOUNT";
877
+ message: string;
878
+ };
879
+ USER_ALREADY_HAS_PASSWORD: {
880
+ readonly code: "USER_ALREADY_HAS_PASSWORD";
881
+ message: string;
882
+ };
883
+ CROSS_SITE_NAVIGATION_LOGIN_BLOCKED: {
884
+ readonly code: "CROSS_SITE_NAVIGATION_LOGIN_BLOCKED";
885
+ message: string;
886
+ };
887
+ VERIFICATION_EMAIL_NOT_ENABLED: {
888
+ readonly code: "VERIFICATION_EMAIL_NOT_ENABLED";
889
+ message: string;
890
+ };
891
+ EMAIL_ALREADY_VERIFIED: {
892
+ readonly code: "EMAIL_ALREADY_VERIFIED";
893
+ message: string;
894
+ };
895
+ EMAIL_MISMATCH: {
896
+ readonly code: "EMAIL_MISMATCH";
897
+ message: string;
898
+ };
899
+ SESSION_NOT_FRESH: {
900
+ readonly code: "SESSION_NOT_FRESH";
901
+ message: string;
902
+ };
903
+ LINKED_ACCOUNT_ALREADY_EXISTS: {
904
+ readonly code: "LINKED_ACCOUNT_ALREADY_EXISTS";
905
+ message: string;
906
+ };
907
+ INVALID_ORIGIN: {
908
+ readonly code: "INVALID_ORIGIN";
909
+ message: string;
910
+ };
911
+ INVALID_CALLBACK_URL: {
912
+ readonly code: "INVALID_CALLBACK_URL";
913
+ message: string;
914
+ };
915
+ INVALID_REDIRECT_URL: {
916
+ readonly code: "INVALID_REDIRECT_URL";
917
+ message: string;
918
+ };
919
+ INVALID_ERROR_CALLBACK_URL: {
920
+ readonly code: "INVALID_ERROR_CALLBACK_URL";
921
+ message: string;
922
+ };
923
+ INVALID_NEW_USER_CALLBACK_URL: {
924
+ readonly code: "INVALID_NEW_USER_CALLBACK_URL";
925
+ message: string;
926
+ };
927
+ MISSING_OR_NULL_ORIGIN: {
928
+ readonly code: "MISSING_OR_NULL_ORIGIN";
929
+ message: string;
930
+ };
931
+ CALLBACK_URL_REQUIRED: {
932
+ readonly code: "CALLBACK_URL_REQUIRED";
933
+ message: string;
934
+ };
935
+ FAILED_TO_CREATE_VERIFICATION: {
936
+ readonly code: "FAILED_TO_CREATE_VERIFICATION";
937
+ message: string;
938
+ };
939
+ FIELD_NOT_ALLOWED: {
940
+ readonly code: "FIELD_NOT_ALLOWED";
941
+ message: string;
942
+ };
943
+ ASYNC_VALIDATION_NOT_SUPPORTED: {
944
+ readonly code: "ASYNC_VALIDATION_NOT_SUPPORTED";
945
+ message: string;
946
+ };
947
+ VALIDATION_ERROR: {
948
+ readonly code: "VALIDATION_ERROR";
949
+ message: string;
950
+ };
951
+ MISSING_FIELD: {
952
+ readonly code: "MISSING_FIELD";
953
+ message: string;
954
+ };
955
+ METHOD_NOT_ALLOWED_DEFER_SESSION_REQUIRED: {
956
+ readonly code: "METHOD_NOT_ALLOWED_DEFER_SESSION_REQUIRED";
957
+ message: string;
958
+ };
959
+ BODY_MUST_BE_AN_OBJECT: {
960
+ readonly code: "BODY_MUST_BE_AN_OBJECT";
961
+ message: string;
962
+ };
963
+ PASSWORD_ALREADY_SET: {
964
+ readonly code: "PASSWORD_ALREADY_SET";
965
+ message: string;
966
+ };
967
+ };
968
+ };
969
+ export declare const sigmaAuthClient: typeof baseAuthClient & SigmaAugmentedClient;
28
970
  /**
29
- * Initiate Sigma OAuth by redirecting the browser to the authorize endpoint.
971
+ * Initiate Sigma OAuth by redirecting to the authorize endpoint.
972
+ * Uses the better-auth-plugin's signIn.sigma() which handles PKCE,
973
+ * sessionStorage, wallet-check gate, and redirect.
30
974
  *
31
- * Generates PKCE verifier/challenge, stores state in sessionStorage,
32
- * and navigates the browser away. Returns a never-resolving Promise
33
- * since the page navigates.
975
+ * Returns a never-resolving Promise since the page navigates away.
34
976
  */
35
- export declare function initiateSigmaOAuth(config: SigmaOAuthConfig): Promise<never>;
977
+ export declare function initiateSigmaOAuth(config: SigmaOAuthConfig, options?: Omit<SigmaSignInOptions, 'clientId' | 'callbackURL'>): Promise<never>;
36
978
  /**
37
- * Check if the current URL has Sigma OAuth callback parameters
38
- * that match a pending OAuth flow.
979
+ * Complete Sigma OAuth callback. Uses the better-auth-plugin's
980
+ * handleCallback() which verifies state, exchanges code via the
981
+ * server-side callback route, and returns user data.
39
982
  */
40
- export declare function isSigmaCallback(searchParams: URLSearchParams): boolean;
983
+ export declare function completeSigmaOAuth(searchParams: URLSearchParams): Promise<SigmaOAuthResult>;
41
984
  /**
42
- * Complete Sigma OAuth by exchanging the authorization code.
43
- *
44
- * Validates state from sessionStorage, POSTs the code + verifier to the
45
- * app's server-side callback route, and returns the user info.
46
- *
47
- * @param searchParams - URL search params from the callback
48
- * @param serverCallbackUrl - Server-side route that exchanges code for tokens
49
- * (default: /api/auth/sigma/callback)
985
+ * Set the active Sigma identity on the auth client.
986
+ * Must be called after OAuth to enable iframe signing.
50
987
  */
51
- export declare function completeSigmaOAuth(searchParams: URLSearchParams, serverCallbackUrl?: string): Promise<SigmaOAuthResult>;
988
+ export declare function setSigmaIdentity(bapId: string): void;
989
+ export {};
52
990
  //# sourceMappingURL=sigma-oauth.d.ts.map