@meistrari/auth-core 1.20.1 → 1.22.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/dist/index.d.ts CHANGED
@@ -2,13 +2,94 @@ import * as better_auth_plugins from 'better-auth/plugins';
2
2
  import * as better_auth from 'better-auth';
3
3
  import { JWTPayload as JWTPayload$1 } from 'better-auth';
4
4
  export { APIError } from 'better-auth';
5
- import z$1, { z } from 'zod';
5
+ import z, { z as z$1 } from 'zod';
6
6
  import * as better_auth_client from 'better-auth/client';
7
7
  import { BetterFetchOption } from 'better-auth/client';
8
8
  import * as jose from 'jose';
9
- import * as _better_auth_sso from '@better-auth/sso';
10
9
  import { ApiKey as ApiKey$1 } from '@better-auth/api-key';
11
10
 
11
+ declare const AMRBrand: unique symbol;
12
+ declare const AALBrand: unique symbol;
13
+ declare const ACRBrand: unique symbol;
14
+ declare const AuthMethodBrand: unique symbol;
15
+ declare const AMRs: {
16
+ readonly Pwd: ("pwd" & z.core.$brand<typeof AMRBrand>) | ("otp" & z.core.$brand<typeof AMRBrand>) | ("oauth" & z.core.$brand<typeof AMRBrand>) | ("sso" & z.core.$brand<typeof AMRBrand>) | ("saml" & z.core.$brand<typeof AMRBrand>);
17
+ readonly Otp: ("pwd" & z.core.$brand<typeof AMRBrand>) | ("otp" & z.core.$brand<typeof AMRBrand>) | ("oauth" & z.core.$brand<typeof AMRBrand>) | ("sso" & z.core.$brand<typeof AMRBrand>) | ("saml" & z.core.$brand<typeof AMRBrand>);
18
+ readonly Oauth: ("pwd" & z.core.$brand<typeof AMRBrand>) | ("otp" & z.core.$brand<typeof AMRBrand>) | ("oauth" & z.core.$brand<typeof AMRBrand>) | ("sso" & z.core.$brand<typeof AMRBrand>) | ("saml" & z.core.$brand<typeof AMRBrand>);
19
+ readonly Sso: ("pwd" & z.core.$brand<typeof AMRBrand>) | ("otp" & z.core.$brand<typeof AMRBrand>) | ("oauth" & z.core.$brand<typeof AMRBrand>) | ("sso" & z.core.$brand<typeof AMRBrand>) | ("saml" & z.core.$brand<typeof AMRBrand>);
20
+ readonly Saml: ("pwd" & z.core.$brand<typeof AMRBrand>) | ("otp" & z.core.$brand<typeof AMRBrand>) | ("oauth" & z.core.$brand<typeof AMRBrand>) | ("sso" & z.core.$brand<typeof AMRBrand>) | ("saml" & z.core.$brand<typeof AMRBrand>);
21
+ };
22
+ declare const AALs: {
23
+ readonly Aal1: ("aal1" & z.core.$brand<typeof AALBrand>) | ("aal2" & z.core.$brand<typeof AALBrand>) | ("aal3" & z.core.$brand<typeof AALBrand>);
24
+ readonly Aal2: ("aal1" & z.core.$brand<typeof AALBrand>) | ("aal2" & z.core.$brand<typeof AALBrand>) | ("aal3" & z.core.$brand<typeof AALBrand>);
25
+ readonly Aal3: ("aal1" & z.core.$brand<typeof AALBrand>) | ("aal2" & z.core.$brand<typeof AALBrand>) | ("aal3" & z.core.$brand<typeof AALBrand>);
26
+ };
27
+ declare const ACRs: {
28
+ readonly Unspecified: "urn:tela:auth:unspecified" & z.core.$brand<typeof ACRBrand>;
29
+ };
30
+ declare const AuthMethods: {
31
+ readonly Password: ("oauth" & z.core.$brand<typeof AuthMethodBrand>) | ("saml" & z.core.$brand<typeof AuthMethodBrand>) | ("password" & z.core.$brand<typeof AuthMethodBrand>) | ("email_otp" & z.core.$brand<typeof AuthMethodBrand>) | ("unknown" & z.core.$brand<typeof AuthMethodBrand>);
32
+ readonly EmailOTP: ("oauth" & z.core.$brand<typeof AuthMethodBrand>) | ("saml" & z.core.$brand<typeof AuthMethodBrand>) | ("password" & z.core.$brand<typeof AuthMethodBrand>) | ("email_otp" & z.core.$brand<typeof AuthMethodBrand>) | ("unknown" & z.core.$brand<typeof AuthMethodBrand>);
33
+ readonly OAuth: ("oauth" & z.core.$brand<typeof AuthMethodBrand>) | ("saml" & z.core.$brand<typeof AuthMethodBrand>) | ("password" & z.core.$brand<typeof AuthMethodBrand>) | ("email_otp" & z.core.$brand<typeof AuthMethodBrand>) | ("unknown" & z.core.$brand<typeof AuthMethodBrand>);
34
+ readonly SAML: ("oauth" & z.core.$brand<typeof AuthMethodBrand>) | ("saml" & z.core.$brand<typeof AuthMethodBrand>) | ("password" & z.core.$brand<typeof AuthMethodBrand>) | ("email_otp" & z.core.$brand<typeof AuthMethodBrand>) | ("unknown" & z.core.$brand<typeof AuthMethodBrand>);
35
+ readonly Unknown: ("oauth" & z.core.$brand<typeof AuthMethodBrand>) | ("saml" & z.core.$brand<typeof AuthMethodBrand>) | ("password" & z.core.$brand<typeof AuthMethodBrand>) | ("email_otp" & z.core.$brand<typeof AuthMethodBrand>) | ("unknown" & z.core.$brand<typeof AuthMethodBrand>);
36
+ };
37
+ declare const AMR: z.core.$ZodBranded<z.ZodEnum<{
38
+ readonly Pwd: "pwd";
39
+ readonly Otp: "otp";
40
+ readonly Oauth: "oauth";
41
+ readonly Sso: "sso";
42
+ readonly Saml: "saml";
43
+ }>, typeof AMRBrand, "out">;
44
+ type AMR = z.infer<typeof AMR>;
45
+ declare const AAL: z.core.$ZodBranded<z.ZodEnum<{
46
+ readonly Aal1: "aal1";
47
+ readonly Aal2: "aal2";
48
+ readonly Aal3: "aal3";
49
+ }>, typeof AALBrand, "out">;
50
+ type AAL = z.infer<typeof AAL>;
51
+ declare const ACR: z.core.$ZodBranded<z.ZodEnum<{
52
+ readonly Unspecified: "urn:tela:auth:unspecified";
53
+ }>, typeof ACRBrand, "out">;
54
+ type ACR = z.infer<typeof ACR>;
55
+ declare const AuthMethod: z.core.$ZodBranded<z.ZodEnum<{
56
+ readonly Password: "password";
57
+ readonly EmailOTP: "email_otp";
58
+ readonly OAuth: "oauth";
59
+ readonly SAML: "saml";
60
+ readonly Unknown: "unknown";
61
+ }>, typeof AuthMethodBrand, "out">;
62
+ type AuthMethod = z.infer<typeof AuthMethod>;
63
+ declare const assuranceFields: {
64
+ authMethod: {
65
+ type: "string";
66
+ required: true;
67
+ };
68
+ amr: {
69
+ type: "json";
70
+ required: true;
71
+ };
72
+ aal: {
73
+ type: "string";
74
+ required: true;
75
+ };
76
+ acr: {
77
+ type: "string";
78
+ required: true;
79
+ };
80
+ assuredAt: {
81
+ type: "date";
82
+ required: true;
83
+ };
84
+ };
85
+ type AssuranceFields = {
86
+ authMethod: AuthMethod;
87
+ amr: AMR[];
88
+ aal: AAL;
89
+ acr: ACR;
90
+ assuredAt: Date;
91
+ };
92
+
12
93
  declare const ac: {
13
94
  newRole<K extends "member" | "access" | "organization" | "invitation" | "team" | "ac">(statements: better_auth_plugins.Subset<K, {
14
95
  access: string[];
@@ -224,2490 +305,756 @@ declare const invitationAdditionalFields: {
224
305
  /**
225
306
  * Zod schema and type for the `user` claim within a JWT payload.
226
307
  */
227
- declare const JWTPayloadUser: z.ZodObject<{
228
- id: z.ZodString;
229
- name: z.ZodString;
230
- image: z.ZodOptional<z.ZodNullable<z.ZodString>>;
231
- role: z.ZodNullable<z.ZodString>;
232
- }, z.core.$strip>;
233
- type JWTPayloadUser = z.infer<typeof JWTPayloadUser>;
308
+ declare const JWTPayloadUser: z$1.ZodObject<{
309
+ id: z$1.ZodString;
310
+ name: z$1.ZodString;
311
+ image: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
312
+ role: z$1.ZodNullable<z$1.ZodString>;
313
+ }, z$1.core.$strip>;
314
+ type JWTPayloadUser = z$1.infer<typeof JWTPayloadUser>;
234
315
  /**
235
316
  * Zod schema and type for the `workspace` claim within a JWT payload.
236
317
  */
237
- declare const JWTPayloadWorkspace: z.ZodObject<{
238
- id: z.ZodString;
239
- title: z.ZodString;
240
- }, z.core.$strip>;
241
- type JWTPayloadWorkspace = z.infer<typeof JWTPayloadWorkspace>;
318
+ declare const JWTPayloadWorkspace: z$1.ZodObject<{
319
+ id: z$1.ZodString;
320
+ title: z$1.ZodString;
321
+ }, z$1.core.$strip>;
322
+ type JWTPayloadWorkspace = z$1.infer<typeof JWTPayloadWorkspace>;
323
+ type JWTPayloadAssurance = {
324
+ authMethod: AuthMethod;
325
+ amr: AMR[];
326
+ aal: AAL;
327
+ acr: ACR;
328
+ assuredAt: string;
329
+ };
330
+ declare const JWTPayloadAssurance: z$1.ZodType<JWTPayloadAssurance>;
331
+ declare const DEFAULT_JWT_ASSURANCE: JWTPayloadAssurance;
332
+ type JWTPayloadData = {
333
+ email: string;
334
+ user: JWTPayloadUser;
335
+ workspace: JWTPayloadWorkspace;
336
+ sessionKey: string;
337
+ assurance: JWTPayloadAssurance;
338
+ };
242
339
  /**
243
340
  * Zod schema and type for the full JWT payload issued by the auth API.
244
341
  *
245
342
  * Includes `email`, `user`, `workspace`, and `sessionKey` claims
246
343
  * on top of the standard Better Auth JWT fields (`sub`, `iss`, `exp`, etc.).
247
344
  */
248
- declare const JWTPayload: z.ZodObject<{
249
- email: z.ZodString;
250
- user: z.ZodObject<{
251
- id: z.ZodString;
252
- name: z.ZodString;
253
- image: z.ZodOptional<z.ZodNullable<z.ZodString>>;
254
- role: z.ZodNullable<z.ZodString>;
255
- }, z.core.$strip>;
256
- workspace: z.ZodObject<{
257
- id: z.ZodString;
258
- title: z.ZodString;
259
- }, z.core.$strip>;
260
- sessionKey: z.ZodString;
345
+ declare const JWTPayload: z$1.ZodType<JWTPayloadData>;
346
+ type JWTPayload = JWTPayload$1 & JWTPayloadData;
347
+
348
+ declare const OAuthStepUpProvider: z.ZodEnum<{
349
+ google: "google";
350
+ microsoft: "microsoft";
351
+ }>;
352
+ type OAuthStepUpProvider = z.infer<typeof OAuthStepUpProvider>;
353
+ type StepUpOption = {
354
+ method: typeof AMRs.Pwd;
355
+ } | {
356
+ method: typeof AMRs.Otp;
357
+ } | {
358
+ method: typeof AMRs.Oauth;
359
+ providers: OAuthStepUpProvider[];
360
+ };
361
+ declare const StepUpOption: z.ZodType<StepUpOption>;
362
+ type SessionAssurancePolicy = {
363
+ minAal: typeof AALs.Aal1 | typeof AALs.Aal2 | typeof AALs.Aal3;
364
+ acceptedAmr: AMR[];
365
+ };
366
+ declare const SessionAssurancePolicy: z.ZodType<SessionAssurancePolicy>;
367
+ declare const SENSITIVE_ACTION_ASSURANCE_POLICY: SessionAssurancePolicy;
368
+ declare function getAalRank(aal: JWTPayload['assurance']['aal']): number;
369
+ declare function isAssuranceSufficientForPolicy(assurance: JWTPayload['assurance'] | null | undefined, policy: SessionAssurancePolicy): boolean;
370
+ declare function canStepUpWithAmr(assurance: JWTPayload['assurance'], amr: AMR): boolean;
371
+ declare function mergeStepUpAssurance(assurance: JWTPayload['assurance'], amr: AMR, now?: Date): JWTPayload['assurance'];
372
+
373
+ /**
374
+ * Base error class for all SDK errors.
375
+ *
376
+ * Extends the native `Error` with a machine-readable `code` property
377
+ * that can be used for programmatic error handling.
378
+ */
379
+ declare class BaseError extends Error {
380
+ /** Machine-readable error code (e.g. `"INVALID_SOCIAL_PROVIDER"`). */
381
+ code: string;
382
+ /**
383
+ * @param code - A machine-readable error code
384
+ * @param message - A human-readable error message
385
+ * @param options - Standard `ErrorOptions` (e.g. `cause`)
386
+ */
387
+ constructor(code: string, message: string, options?: ErrorOptions);
388
+ }
389
+
390
+ declare const SessionAssuranceRequiredPayload: z.ZodObject<{
391
+ code: z.ZodEnum<{
392
+ session_assurance_required: "session_assurance_required";
393
+ application_session_assurance_not_met: "application_session_assurance_not_met";
394
+ }>;
395
+ currentAssurance: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodType<JWTPayloadAssurance, unknown, z.core.$ZodTypeInternals<JWTPayloadAssurance, unknown>>>;
396
+ requiredAssurance: z.ZodType<SessionAssurancePolicy, unknown, z.core.$ZodTypeInternals<SessionAssurancePolicy, unknown>>;
397
+ validStepUps: z.ZodArray<z.ZodType<StepUpOption, unknown, z.core.$ZodTypeInternals<StepUpOption, unknown>>>;
261
398
  }, z.core.$strip>;
262
- type JWTPayload = JWTPayload$1 & z.infer<typeof JWTPayload>;
399
+ type SessionAssuranceRequiredPayload = z.infer<typeof SessionAssuranceRequiredPayload>;
400
+ declare function parseSessionAssuranceRequiredPayload(error: unknown): {
401
+ code: "session_assurance_required" | "application_session_assurance_not_met";
402
+ currentAssurance: JWTPayloadAssurance;
403
+ requiredAssurance: SessionAssurancePolicy;
404
+ validStepUps: StepUpOption[];
405
+ } | null;
406
+ declare class SessionAssuranceRequiredError extends BaseError {
407
+ readonly payload: SessionAssuranceRequiredPayload;
408
+ readonly currentAssurance: SessionAssuranceRequiredPayload['currentAssurance'];
409
+ readonly requiredAssurance: SessionAssuranceRequiredPayload['requiredAssurance'];
410
+ readonly validStepUps: SessionAssuranceRequiredPayload['validStepUps'];
411
+ constructor(payload: SessionAssuranceRequiredPayload, options?: ErrorOptions);
412
+ }
263
413
 
264
- declare const ApiKeyMetadata: z$1.ZodObject<{
265
- user: z$1.ZodObject<{
266
- id: z$1.ZodString;
267
- email: z$1.ZodString;
268
- }, z$1.core.$strip>;
269
- workspace: z$1.ZodObject<{
270
- id: z$1.ZodString;
271
- title: z$1.ZodString;
272
- }, z$1.core.$strip>;
273
- application: z$1.ZodNullable<z$1.ZodOptional<z$1.ZodObject<{
274
- id: z$1.ZodString;
275
- name: z$1.ZodString;
276
- }, z$1.core.$strip>>>;
277
- }, z$1.core.$strip>;
414
+ declare function sessionAssurancePluginClient(): {
415
+ id: "session-assurance";
416
+ getActions: ($fetch: better_auth_client.BetterFetch) => {
417
+ sessionAssurance: {
418
+ getSessionAssurance: () => Promise<{
419
+ data: null;
420
+ error: {
421
+ message?: string | undefined;
422
+ status: number;
423
+ statusText: string;
424
+ };
425
+ } | {
426
+ data: unknown;
427
+ error: null;
428
+ }>;
429
+ stepUpWithPassword: (body: {
430
+ password: string;
431
+ }) => Promise<{
432
+ data: null;
433
+ error: {
434
+ message?: string | undefined;
435
+ status: number;
436
+ statusText: string;
437
+ };
438
+ } | {
439
+ data: unknown;
440
+ error: null;
441
+ }>;
442
+ sendOtp: () => Promise<{
443
+ data: null;
444
+ error: {
445
+ message?: string | undefined;
446
+ status: number;
447
+ statusText: string;
448
+ };
449
+ } | {
450
+ data: unknown;
451
+ error: null;
452
+ }>;
453
+ verifyOtp: (body: {
454
+ otp: string;
455
+ }) => Promise<{
456
+ data: null;
457
+ error: {
458
+ message?: string | undefined;
459
+ status: number;
460
+ statusText: string;
461
+ };
462
+ } | {
463
+ data: unknown;
464
+ error: null;
465
+ }>;
466
+ beginOAuthStepUp: (body: {
467
+ provider: OAuthStepUpProvider;
468
+ returnUrl?: string;
469
+ }) => Promise<{
470
+ data: null;
471
+ error: {
472
+ message?: string | undefined;
473
+ status: number;
474
+ statusText: string;
475
+ };
476
+ } | {
477
+ data: unknown;
478
+ error: null;
479
+ }>;
480
+ completeOAuthStepUp: (body: {
481
+ stepUpToken: string;
482
+ }) => Promise<{
483
+ data: null;
484
+ error: {
485
+ message?: string | undefined;
486
+ status: number;
487
+ statusText: string;
488
+ };
489
+ } | {
490
+ data: unknown;
491
+ error: null;
492
+ }>;
493
+ };
494
+ };
495
+ };
496
+ type SessionAssuranceActions = ReturnType<ReturnType<typeof sessionAssurancePluginClient>['getActions']>['sessionAssurance'];
497
+
498
+ type BeginOAuthStepUpParams = {
499
+ provider: OAuthStepUpProvider;
500
+ returnUrl?: string;
501
+ };
502
+ declare const SessionAssuranceResponse: z.ZodObject<{
503
+ assurance: z.ZodType<AssuranceFields, unknown, z.core.$ZodTypeInternals<AssuranceFields, unknown>>;
504
+ validStepUps: z.ZodArray<z.ZodType<StepUpOption, unknown, z.core.$ZodTypeInternals<StepUpOption, unknown>>>;
505
+ }, z.core.$strip>;
506
+ type SessionAssuranceResponse = z.infer<typeof SessionAssuranceResponse>;
507
+ declare const OAuthBeginStepUpResponse: z.ZodObject<{
508
+ stepUpToken: z.ZodString;
509
+ callbackURL: z.ZodString;
510
+ }, z.core.$strip>;
511
+ type OAuthBeginStepUpResponse = z.infer<typeof OAuthBeginStepUpResponse>;
512
+ declare const OAuthCompleteStepUpResponse: z.ZodObject<{
513
+ assurance: z.ZodType<AssuranceFields, unknown, z.core.$ZodTypeInternals<AssuranceFields, unknown>>;
514
+ validStepUps: z.ZodArray<z.ZodType<StepUpOption, unknown, z.core.$ZodTypeInternals<StepUpOption, unknown>>>;
515
+ returnPath: z.ZodString;
516
+ }, z.core.$strip>;
517
+ type OAuthCompleteStepUpResponse = z.infer<typeof OAuthCompleteStepUpResponse>;
518
+ declare const SendOtpResponse: z.ZodObject<{
519
+ success: z.ZodBoolean;
520
+ }, z.core.$strip>;
521
+ type SendOtpResponse = z.infer<typeof SendOtpResponse>;
522
+ declare class SessionAssuranceService {
523
+ private readonly client;
524
+ constructor(client: APIClient);
525
+ get(): Promise<SessionAssuranceResponse>;
526
+ stepUpWithPassword(password: string): Promise<SessionAssuranceResponse>;
527
+ sendOtp(): Promise<SendOtpResponse>;
528
+ verifyOtp(otp: string): Promise<SessionAssuranceResponse>;
529
+ beginOAuthStepUp(params: BeginOAuthStepUpParams): Promise<OAuthBeginStepUpResponse>;
530
+ completeOAuthStepUp(stepUpToken: string): Promise<OAuthCompleteStepUpResponse>;
531
+ }
532
+
533
+ declare const DEFAULT_SESSION_ASSURANCE_CONFIG: ApplicationSessionAssuranceConfig;
534
+ declare const DEFAULT_APPLICATION_CONFIG: {
535
+ version: 1;
536
+ sessionAssurance: ApplicationSessionAssuranceConfig;
537
+ };
538
+ type ApplicationSessionAssuranceConfig = {
539
+ acceptedAmr: AMR[];
540
+ minAal: AAL;
541
+ };
542
+ declare const ApplicationSessionAssuranceConfig: z.ZodType<ApplicationSessionAssuranceConfig>;
543
+ type ApplicationConfig = {
544
+ version: 1;
545
+ sessionAssurance: ApplicationSessionAssuranceConfig;
546
+ };
547
+ declare const ApplicationConfig: z.ZodType<ApplicationConfig>;
278
548
  /**
279
- * Metadata attached to an API key, identifying the owning user and workspace.
549
+ * Keys of the organization's related collections that can be optionally
550
+ * included in the "who am I" response.
280
551
  */
281
- type ApiKeyMetadata = z$1.infer<typeof ApiKeyMetadata> & Record<string, unknown>;
552
+ type WhoAmIInclude = 'members' | 'teams' | 'invitations';
282
553
  /**
283
- * A full API key including the secret key value.
284
- *
285
- * The secret `key` field is only returned once at creation time.
554
+ * Represents a registered OAuth application.
286
555
  */
287
- type ApiKey = Omit<ApiKey$1, 'metadata' | 'name'> & {
288
- /** Display name of the API key. */
556
+ type Application = {
557
+ /** Unique application identifier. */
558
+ id: string;
559
+ /** Display name of the application. */
289
560
  name: string;
290
- /** Metadata identifying the key's owner and workspace. */
291
- metadata: ApiKeyMetadata;
561
+ /** Human-readable description of the application. */
562
+ description: string;
563
+ /** Allowed OAuth redirect URIs for this application. */
564
+ redirectUris: string[];
565
+ /** Additional configuration for this application. */
566
+ config?: ApplicationConfig;
292
567
  };
293
568
  /**
294
- * An API key with the secret key value omitted.
569
+ * Response returned when listing candidate organizations for an application.
570
+ */
571
+ type ListCandidateOrganizationsResponse = FullOrganization[];
572
+ /**
573
+ * Public application context used to preserve continuity during auth redirects.
574
+ */
575
+ type ApplicationAuthContextResponse = {
576
+ /** Minimal application identity shown in the hosted auth flow. */
577
+ application: Pick<Application, 'id' | 'name' | 'config'>;
578
+ };
579
+ /**
580
+ * Response returned when starting an authorization flow.
581
+ */
582
+ type StartAuthorizationFlowResponse = {
583
+ /** The authorization code to exchange for tokens. */
584
+ code: string;
585
+ };
586
+ /**
587
+ * Response returned when completing an authorization flow or refreshing tokens.
588
+ */
589
+ type CompleteAuthorizationFlowResponse = {
590
+ /** Short-lived JWT access token. */
591
+ accessToken: string;
592
+ /** Long-lived refresh token for obtaining new access tokens. */
593
+ refreshToken: string;
594
+ /** The authenticated user. */
595
+ user: User;
596
+ /** The organization the tokens are scoped to. */
597
+ organization: FullOrganization;
598
+ /** Assurance context embedded in the issued access token. */
599
+ assurance: JWTPayload['assurance'];
600
+ };
601
+ /**
602
+ * Response returned by the "who am I" endpoint.
295
603
  *
296
- * Used in list and get operations where the secret should not be exposed.
604
+ * By default, the `organization` only contains the base organization fields.
605
+ * The `members`, `teams`, and `invitations` collections are only populated
606
+ * when explicitly requested via the `include` query parameter.
297
607
  */
298
- type ApiKeyWithoutSecret = Omit<ApiKey, 'key'>;
608
+ type WhoAmIResponse = {
609
+ /** The authenticated user. */
610
+ user: User;
611
+ /** The user's active organization. */
612
+ organization: WhoAmIOrganization;
613
+ /** Assurance context embedded in the verified access token. */
614
+ assurance: JWTPayload['assurance'];
615
+ };
299
616
  /**
300
- * Payload for creating a new API key.
617
+ * Options accepted by the "who am I" client method.
301
618
  */
302
- type CreateApiKeyPayload = {
303
- /** Display name for the API key. */
304
- name: string;
305
- /** Time in milliseconds until the key expires. Omit for a non-expiring key. */
306
- expiresIn?: number;
307
- /** Optional prefix prepended to the generated key for identification. */
308
- prefix?: string;
309
- /** Optional metadata to attach to the key. */
310
- metadata?: ApiKeyMetadata;
619
+ type WhoAmIOptions = {
620
+ /**
621
+ * Collections to include in the returned organization. When omitted or
622
+ * empty, only the base organization fields are returned.
623
+ */
624
+ include?: WhoAmIInclude[];
311
625
  };
312
626
  /**
313
- * Payload for updating an existing API key.
627
+ * Response returned when starting a device authorization flow (RFC 8628).
314
628
  */
315
- type UpdateApiKeyPayload = {
316
- /** The ID of the API key to update. */
629
+ type DeviceAuthorizationResponse = {
630
+ /** The device verification code for polling. */
631
+ device_code: string;
632
+ /** The user-facing code to enter on the verification page. */
633
+ user_code: string;
634
+ /** The URI the user should visit to authorize the device. */
635
+ verification_uri: string;
636
+ /** A complete URI including the user code for convenience. */
637
+ verification_uri_complete: string;
638
+ /** Number of seconds until the device code expires. */
639
+ expires_in: number;
640
+ /** Minimum polling interval in seconds. */
641
+ interval: number;
642
+ };
643
+ /**
644
+ * Minimal application info shown in device authorization context.
645
+ *
646
+ * @internal
647
+ */
648
+ type DeviceContextApplication = {
649
+ /** Unique application identifier. */
317
650
  id: string;
318
- /** The new display name for the API key. */
651
+ /** Display name of the application. */
319
652
  name: string;
653
+ /** Human-readable description, or `null` if not set. */
654
+ description: string | null;
320
655
  };
321
-
322
656
  /**
323
- * Removes index signatures from a type
324
- * @template T - The type to remove index signatures from
325
- * @example
326
- * ```typescript
327
- * type MyType = {
328
- * foo: string
329
- * bar: number
330
- * [key: string]: any
331
- * }
332
- *
333
- * type StrictMyType = Strict<MyType> // { foo: string; bar: number; }
334
- * ```
657
+ * Context information for a pending device authorization request.
335
658
  */
336
- type Strict<T> = {
337
- [K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];
659
+ type DeviceAuthorizationContextResponse = {
660
+ /** The application that initiated the device flow, with verification status. */
661
+ requester: DeviceContextApplication & {
662
+ isVerified: boolean;
663
+ };
664
+ /** The target application the requester wants access to. */
665
+ target: DeviceContextApplication;
666
+ /** Organizations the user can authorize the device for. */
667
+ organizations: FullOrganization[];
668
+ /** Organization pre-selected by the requester, if any. */
669
+ preselectedOrganizationId: string | null;
670
+ /** Current status of the device authorization request. */
671
+ status: 'pending' | 'approved' | 'denied';
672
+ /** Seconds remaining before the device code expires. */
673
+ expiresIn: number;
338
674
  };
339
675
  /**
340
- * Creates a configured Better Auth API client with all required plugins.
676
+ * Response returned when approving or denying a device authorization request.
677
+ */
678
+ type DeviceAuthorizationActionResponse = {
679
+ /** Whether the action was performed successfully. */
680
+ success: boolean;
681
+ };
682
+
683
+ /**
684
+ * Generic error thrown by the `ApplicationService`.
341
685
  *
342
- * @param apiUrl - The base URL of the authentication API
343
- * @param fetchOptions - Custom fetch options to include in all API requests
344
- * @returns A fully-configured Better Auth client instance
686
+ * All application-specific errors extend this class, so you can catch
687
+ * `ApplicationError` to handle any application-related failure.
688
+ */
689
+ declare class ApplicationError extends BaseError {
690
+ constructor(message: string, options?: ErrorOptions);
691
+ }
692
+ /**
693
+ * Thrown when a refresh token has expired or been revoked.
345
694
  *
346
- * @internal
695
+ * The client should discard its stored tokens and prompt the user
696
+ * to re-authenticate.
347
697
  */
348
- declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOption): {
349
- useActiveOrganization: better_auth_client.AuthQueryAtom<better_auth.Prettify<{
350
- id: string;
351
- name: string;
352
- slug: string;
353
- createdAt: Date;
354
- logo?: string | null | undefined | undefined;
355
- metadata?: any;
356
- } & {
357
- members: {
358
- id: string;
359
- organizationId: string;
360
- role: "org:admin" | "org:member" | "org:reviewer";
361
- createdAt: Date;
362
- userId: string;
363
- teamId?: string | undefined | undefined;
364
- user: {
365
- id: string;
366
- email: string;
367
- name: string;
368
- image?: string | undefined;
369
- };
370
- }[];
371
- invitations: {
372
- id: string;
373
- organizationId: string;
374
- email: string;
375
- role: "org:admin" | "org:member" | "org:reviewer";
376
- status: better_auth_plugins.InvitationStatus;
377
- inviterId: string;
378
- expiresAt: Date;
379
- createdAt: Date;
380
- teamId?: string | undefined | undefined;
381
- }[];
382
- }>>;
383
- useListOrganizations: better_auth_client.AuthQueryAtom<{
384
- id: string;
385
- name: string;
386
- slug: string;
387
- createdAt: Date;
388
- logo?: string | null | undefined | undefined;
389
- metadata?: any;
390
- }[]>;
391
- useActiveMember: better_auth_client.AuthQueryAtom<{
392
- id: string;
393
- organizationId: string;
394
- userId: string;
395
- role: string;
396
- createdAt: Date;
397
- }>;
398
- useActiveMemberRole: better_auth_client.AuthQueryAtom<{
399
- role: string;
400
- }>;
401
- } & {
402
- customEndpoints: {
403
- teams: {
404
- ":id": {
405
- members: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, {
406
- id: string;
407
- }>>(data_0?: better_auth.Prettify<{
408
- query?: Record<string, any> | undefined;
409
- fetchOptions?: FetchOptions | undefined;
410
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
411
- teamMembers: {
412
- id: string;
413
- teamId: string;
414
- userId: string;
415
- createdAt: Date;
416
- }[];
417
- }, {
418
- code?: string | undefined;
419
- message?: string | undefined;
420
- }, FetchOptions["throw"] extends true ? true : true>>;
421
- };
422
- };
423
- };
424
- } & {
425
- customEndpoints: {
426
- organizations: {
427
- apiKeys: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
428
- query?: Record<string, any> | undefined;
429
- fetchOptions?: FetchOptions | undefined;
430
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
431
- id: string;
432
- name: string;
433
- start: string | null;
434
- prefix: string | null;
435
- referenceId: string;
436
- configId: string;
437
- refillInterval: number | null;
438
- refillAmount: number | null;
439
- lastRefillAt: Date | null;
440
- enabled: boolean;
441
- rateLimitEnabled: boolean;
442
- rateLimitTimeWindow: number | null;
443
- rateLimitMax: number | null;
444
- requestCount: number;
445
- remaining: number | null;
446
- lastRequest: Date | null;
447
- expiresAt: Date | null;
448
- createdAt: Date;
449
- updatedAt: Date;
450
- permissions: string | null;
451
- metadata: any;
452
- }[], {
453
- code?: string | undefined;
454
- message?: string | undefined;
455
- }, FetchOptions["throw"] extends true ? true : true>>;
456
- };
457
- };
458
- } & {
459
- handshake: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
460
- origin: string;
461
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
462
- query: {
463
- origin: string;
464
- };
465
- fetchOptions?: FetchOptions | undefined;
466
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
467
- status: ("OK" | "CREATED" | "ACCEPTED" | "NO_CONTENT" | "MULTIPLE_CHOICES" | "MOVED_PERMANENTLY" | "FOUND" | "SEE_OTHER" | "NOT_MODIFIED" | "TEMPORARY_REDIRECT" | "BAD_REQUEST" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "METHOD_NOT_ALLOWED" | "NOT_ACCEPTABLE" | "PROXY_AUTHENTICATION_REQUIRED" | "REQUEST_TIMEOUT" | "CONFLICT" | "GONE" | "LENGTH_REQUIRED" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "URI_TOO_LONG" | "UNSUPPORTED_MEDIA_TYPE" | "RANGE_NOT_SATISFIABLE" | "EXPECTATION_FAILED" | "I'M_A_TEAPOT" | "MISDIRECTED_REQUEST" | "UNPROCESSABLE_ENTITY" | "LOCKED" | "FAILED_DEPENDENCY" | "TOO_EARLY" | "UPGRADE_REQUIRED" | "PRECONDITION_REQUIRED" | "TOO_MANY_REQUESTS" | "REQUEST_HEADER_FIELDS_TOO_LARGE" | "UNAVAILABLE_FOR_LEGAL_REASONS" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "HTTP_VERSION_NOT_SUPPORTED" | "VARIANT_ALSO_NEGOTIATES" | "INSUFFICIENT_STORAGE" | "LOOP_DETECTED" | "NOT_EXTENDED" | "NETWORK_AUTHENTICATION_REQUIRED") | better_auth.Status;
468
- body: ({
469
- message?: string;
470
- code?: string;
471
- cause?: unknown;
472
- } & Record<string, any>) | undefined;
473
- headers: HeadersInit;
474
- statusCode: number;
475
- name: string;
476
- message: string;
477
- stack?: string;
478
- cause?: unknown;
479
- }, {
480
- code?: string | undefined;
481
- message?: string | undefined;
482
- }, FetchOptions["throw"] extends true ? true : true>>;
483
- } & {
484
- handshake: {
485
- noncePayload: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
486
- nonce: string;
487
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
488
- query: {
489
- nonce: string;
490
- };
491
- fetchOptions?: FetchOptions | undefined;
492
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
493
- token: string;
494
- }, {
495
- code?: string | undefined;
496
- message?: string | undefined;
497
- }, FetchOptions["throw"] extends true ? true : true>>;
498
- };
499
- } & {
500
- organization: {
501
- create: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
502
- name: string;
503
- slug: string;
504
- userId?: string | undefined;
505
- logo?: string | undefined;
506
- metadata?: Record<string, any> | undefined;
507
- keepCurrentActiveOrganization?: boolean | undefined;
508
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
509
- name: string;
510
- slug: string;
511
- userId?: string | undefined;
512
- logo?: string | undefined;
513
- metadata?: Record<string, any> | undefined;
514
- keepCurrentActiveOrganization?: boolean | undefined;
515
- } & {
516
- fetchOptions?: FetchOptions | undefined;
517
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<NonNullable<{
518
- id: string;
519
- name: string;
520
- slug: string;
521
- createdAt: Date;
522
- logo?: string | null | undefined | undefined;
523
- metadata?: any;
524
- } & {
525
- metadata: any;
526
- members: ({
527
- id: string;
528
- organizationId: string;
529
- userId: string;
530
- role: string;
531
- createdAt: Date;
532
- } | undefined)[];
533
- }>, {
534
- code?: string | undefined;
535
- message?: string | undefined;
536
- }, FetchOptions["throw"] extends true ? true : true>>;
537
- };
538
- } & {
539
- organization: {
540
- update: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
541
- data: {
542
- name?: string | undefined;
543
- slug?: string | undefined;
544
- logo?: string | undefined;
545
- metadata?: Record<string, any> | undefined;
546
- } & Partial<{}>;
547
- organizationId?: string | undefined;
548
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
549
- data: {
550
- name?: string | undefined;
551
- slug?: string | undefined;
552
- logo?: string | undefined;
553
- metadata?: Record<string, any> | undefined;
554
- } & Partial<{}>;
555
- organizationId?: string | undefined;
556
- } & {
557
- fetchOptions?: FetchOptions | undefined;
558
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
559
- id: string;
560
- name: string;
561
- slug: string;
562
- createdAt: Date;
563
- logo?: string | null | undefined | undefined;
564
- metadata?: any;
565
- }, {
566
- code?: string | undefined;
567
- message?: string | undefined;
568
- }, FetchOptions["throw"] extends true ? true : true>>;
569
- };
570
- } & {
571
- organization: {
572
- delete: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
573
- organizationId: string;
574
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
575
- organizationId: string;
576
- } & {
577
- fetchOptions?: FetchOptions | undefined;
578
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
579
- id: string;
580
- name: string;
581
- slug: string;
582
- createdAt: Date;
583
- logo?: string | null | undefined | undefined;
584
- metadata?: any;
585
- }, {
586
- code?: string | undefined;
587
- message?: string | undefined;
588
- }, FetchOptions["throw"] extends true ? true : true>>;
589
- };
590
- } & {
591
- organization: {
592
- setActive: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
593
- organizationId?: string | null | undefined;
594
- organizationSlug?: string | undefined;
595
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
596
- organizationId?: string | null | undefined;
597
- organizationSlug?: string | undefined;
598
- } & {
599
- fetchOptions?: FetchOptions | undefined;
600
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
601
- members: {
602
- id: string;
603
- organizationId: string;
604
- role: "org:admin" | "org:member" | "org:reviewer";
605
- createdAt: Date;
606
- userId: string;
607
- teamId?: string | undefined | undefined;
608
- user: {
609
- id: string;
610
- email: string;
611
- name: string;
612
- image?: string | undefined;
613
- };
614
- }[];
615
- invitations: {
616
- id: string;
617
- organizationId: string;
618
- email: string;
619
- role: "org:admin" | "org:member" | "org:reviewer";
620
- status: better_auth_plugins.InvitationStatus;
621
- inviterId: string;
622
- expiresAt: Date;
623
- createdAt: Date;
624
- teamId?: string | undefined | undefined;
625
- }[];
626
- teams: {
627
- id: string;
628
- name: string;
629
- organizationId: string;
630
- createdAt: Date;
631
- updatedAt?: Date | undefined;
632
- }[];
633
- } & {
634
- id: string;
635
- name: string;
636
- slug: string;
637
- createdAt: Date;
638
- logo?: string | null | undefined | undefined;
639
- metadata?: any;
640
- }, {
641
- code?: string | undefined;
642
- message?: string | undefined;
643
- }, FetchOptions["throw"] extends true ? true : true>>;
644
- };
645
- } & {
646
- organization: {
647
- getFullOrganization: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
648
- organizationId?: string | undefined;
649
- organizationSlug?: string | undefined;
650
- membersLimit?: string | number | undefined;
651
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
652
- query?: {
653
- organizationId?: string | undefined;
654
- organizationSlug?: string | undefined;
655
- membersLimit?: string | number | undefined;
656
- } | undefined;
657
- fetchOptions?: FetchOptions | undefined;
658
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
659
- members: {
660
- id: string;
661
- organizationId: string;
662
- role: "org:admin" | "org:member" | "org:reviewer";
663
- createdAt: Date;
664
- userId: string;
665
- teamId?: string | undefined | undefined;
666
- user: {
667
- id: string;
668
- email: string;
669
- name: string;
670
- image?: string | undefined;
671
- };
672
- }[];
673
- invitations: {
674
- id: string;
675
- organizationId: string;
676
- email: string;
677
- role: "org:admin" | "org:member" | "org:reviewer";
678
- status: better_auth_plugins.InvitationStatus;
679
- inviterId: string;
680
- expiresAt: Date;
681
- createdAt: Date;
682
- teamId?: string | undefined | undefined;
683
- }[];
684
- teams: {
685
- id: string;
686
- name: string;
687
- organizationId: string;
688
- createdAt: Date;
689
- updatedAt?: Date | undefined;
690
- }[];
691
- } & {
692
- id: string;
693
- name: string;
694
- slug: string;
695
- createdAt: Date;
696
- logo?: string | null | undefined | undefined;
697
- metadata?: any;
698
- }, {
699
- code?: string | undefined;
700
- message?: string | undefined;
701
- }, FetchOptions["throw"] extends true ? true : true>>;
702
- };
703
- } & {
704
- organization: {
705
- list: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
706
- query?: Record<string, any> | undefined;
707
- fetchOptions?: FetchOptions | undefined;
708
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
709
- id: string;
710
- name: string;
711
- slug: string;
712
- createdAt: Date;
713
- logo?: string | null | undefined | undefined;
714
- metadata?: any;
715
- }[], {
716
- code?: string | undefined;
717
- message?: string | undefined;
718
- }, FetchOptions["throw"] extends true ? true : true>>;
719
- };
720
- } & {
721
- organization: {
722
- inviteMember: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
723
- email: string;
724
- role: "org:admin" | "org:member" | "org:reviewer" | ("org:admin" | "org:member" | "org:reviewer")[];
725
- organizationId?: string | undefined;
726
- resend?: boolean | undefined;
727
- } & {
728
- teamId?: (string | string[]) | undefined;
729
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
730
- email: string;
731
- role: "org:admin" | "org:member" | "org:reviewer" | ("org:admin" | "org:member" | "org:reviewer")[];
732
- organizationId?: string | undefined;
733
- resend?: boolean | undefined;
734
- } & {
735
- teamId?: (string | string[]) | undefined;
736
- } & {
737
- fetchOptions?: FetchOptions | undefined;
738
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<NonNullable<{
739
- id: string;
740
- organizationId: string;
741
- email: string;
742
- role: "org:admin" | "org:member" | "org:reviewer";
743
- status: better_auth_plugins.InvitationStatus;
744
- inviterId: string;
745
- expiresAt: Date;
746
- createdAt: Date;
747
- teamId?: string | undefined | undefined;
748
- } | {
749
- id: string;
750
- organizationId: string;
751
- email: string;
752
- role: "org:admin" | "org:member" | "org:reviewer";
753
- status: better_auth_plugins.InvitationStatus;
754
- inviterId: string;
755
- expiresAt: Date;
756
- createdAt: Date;
757
- teamId?: string | undefined | undefined;
758
- }>, {
759
- code?: string | undefined;
760
- message?: string | undefined;
761
- }, FetchOptions["throw"] extends true ? true : true>>;
762
- };
763
- } & {
764
- organization: {
765
- cancelInvitation: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
766
- invitationId: string;
767
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
768
- invitationId: string;
769
- } & {
770
- fetchOptions?: FetchOptions | undefined;
771
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
772
- id: string;
773
- organizationId: string;
774
- email: string;
775
- role: "org:admin" | "org:member" | "org:reviewer";
776
- status: better_auth_plugins.InvitationStatus;
777
- inviterId: string;
778
- expiresAt: Date;
779
- createdAt: Date;
780
- teamId?: string | undefined | undefined;
781
- }, {
782
- code?: string | undefined;
783
- message?: string | undefined;
784
- }, FetchOptions["throw"] extends true ? true : true>>;
785
- };
786
- } & {
787
- organization: {
788
- acceptInvitation: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
789
- invitationId: string;
790
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
791
- invitationId: string;
792
- } & {
793
- fetchOptions?: FetchOptions | undefined;
794
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
795
- invitation: {
796
- id: string;
797
- organizationId: string;
798
- email: string;
799
- role: "org:admin" | "org:member" | "org:reviewer";
800
- status: better_auth_plugins.InvitationStatus;
801
- inviterId: string;
802
- expiresAt: Date;
803
- createdAt: Date;
804
- teamId?: string | undefined | undefined;
805
- };
806
- member: {
807
- id: string;
808
- organizationId: string;
809
- userId: string;
810
- role: string;
811
- createdAt: Date;
812
- };
813
- }, {
814
- code?: string | undefined;
815
- message?: string | undefined;
816
- }, FetchOptions["throw"] extends true ? true : true>>;
817
- };
818
- } & {
819
- organization: {
820
- getInvitation: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
821
- id: string;
822
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
823
- query: {
824
- id: string;
825
- };
826
- fetchOptions?: FetchOptions | undefined;
827
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<NonNullable<{
828
- id: string;
829
- organizationId: string;
830
- email: string;
831
- role: "org:admin" | "org:member" | "org:reviewer";
832
- status: better_auth_plugins.InvitationStatus;
833
- inviterId: string;
834
- expiresAt: Date;
835
- createdAt: Date;
836
- teamId?: string | undefined | undefined;
837
- } & {
838
- organizationName: string;
839
- organizationSlug: string;
840
- inviterEmail: string;
841
- }>, {
842
- code?: string | undefined;
843
- message?: string | undefined;
844
- }, FetchOptions["throw"] extends true ? true : true>>;
845
- };
846
- } & {
847
- organization: {
848
- rejectInvitation: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
849
- invitationId: string;
850
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
851
- invitationId: string;
852
- } & {
853
- fetchOptions?: FetchOptions | undefined;
854
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
855
- invitation: {
856
- id: string;
857
- organizationId: string;
858
- email: string;
859
- role: "admin" | "member" | "owner";
860
- status: better_auth_plugins.InvitationStatus;
861
- inviterId: string;
862
- expiresAt: Date;
863
- createdAt: Date;
864
- } | null;
865
- member: null;
866
- }, {
867
- code?: string | undefined;
868
- message?: string | undefined;
869
- }, FetchOptions["throw"] extends true ? true : true>>;
870
- };
871
- } & {
872
- organization: {
873
- listInvitations: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
874
- organizationId?: string | undefined;
875
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
876
- query?: {
877
- organizationId?: string | undefined;
878
- } | undefined;
879
- fetchOptions?: FetchOptions | undefined;
880
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
881
- id: string;
882
- organizationId: string;
883
- email: string;
884
- role: "org:admin" | "org:member" | "org:reviewer";
885
- status: better_auth_plugins.InvitationStatus;
886
- inviterId: string;
887
- expiresAt: Date;
888
- createdAt: Date;
889
- teamId?: string | undefined | undefined;
890
- }[], {
891
- code?: string | undefined;
892
- message?: string | undefined;
893
- }, FetchOptions["throw"] extends true ? true : true>>;
894
- };
895
- } & {
896
- organization: {
897
- getActiveMember: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
898
- query?: Record<string, any> | undefined;
899
- fetchOptions?: FetchOptions | undefined;
900
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<NonNullable<Omit<{
901
- id: string;
902
- organizationId: string;
903
- role: "org:admin" | "org:member" | "org:reviewer";
904
- createdAt: Date;
905
- userId: string;
906
- teamId?: string | undefined | undefined;
907
- user: {
908
- id: string;
909
- email: string;
910
- name: string;
911
- image?: string | undefined;
912
- };
913
- } & {
914
- user: {
915
- id: string;
916
- createdAt: Date;
917
- updatedAt: Date;
918
- email: string;
919
- emailVerified: boolean;
920
- name: string;
921
- image?: string | null | undefined;
922
- };
923
- }, "user"> & {
924
- user: {
925
- id: string;
926
- name: string;
927
- email: string;
928
- image: string | undefined;
929
- };
930
- }>, {
931
- code?: string | undefined;
932
- message?: string | undefined;
933
- }, FetchOptions["throw"] extends true ? true : true>>;
934
- };
935
- } & {
936
- organization: {
937
- checkSlug: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
938
- slug: string;
939
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
940
- slug: string;
941
- } & {
942
- fetchOptions?: FetchOptions | undefined;
943
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
944
- status: boolean;
945
- }, {
946
- code?: string | undefined;
947
- message?: string | undefined;
948
- }, FetchOptions["throw"] extends true ? true : true>>;
949
- };
950
- } & {
951
- organization: {
952
- removeMember: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
953
- memberIdOrEmail: string;
954
- organizationId?: string | undefined;
955
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
956
- memberIdOrEmail: string;
957
- organizationId?: string | undefined;
958
- } & {
959
- fetchOptions?: FetchOptions | undefined;
960
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
961
- member: {
962
- id: string;
963
- organizationId: string;
964
- role: "org:admin" | "org:member" | "org:reviewer";
965
- createdAt: Date;
966
- userId: string;
967
- teamId?: string | undefined | undefined;
968
- user: {
969
- id: string;
970
- email: string;
971
- name: string;
972
- image?: string | undefined;
973
- };
974
- };
975
- }, {
976
- code?: string | undefined;
977
- message?: string | undefined;
978
- }, FetchOptions["throw"] extends true ? true : true>>;
979
- };
980
- } & {
981
- organization: {
982
- updateMemberRole: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
983
- role: better_auth.LiteralString | "org:admin" | "org:member" | "org:reviewer" | better_auth.LiteralString[] | ("org:admin" | "org:member" | "org:reviewer")[];
984
- memberId: string;
985
- organizationId?: string | undefined;
986
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
987
- role: better_auth.LiteralString | "org:admin" | "org:member" | "org:reviewer" | better_auth.LiteralString[] | ("org:admin" | "org:member" | "org:reviewer")[];
988
- memberId: string;
989
- organizationId?: string | undefined;
990
- } & {
991
- fetchOptions?: FetchOptions | undefined;
992
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
993
- id: string;
994
- organizationId: string;
995
- role: "admin" | "member" | "owner";
996
- createdAt: Date;
997
- userId: string;
998
- user: {
999
- id: string;
1000
- email: string;
1001
- name: string;
1002
- image?: string | undefined;
1003
- };
1004
- }, {
1005
- code?: string | undefined;
1006
- message?: string | undefined;
1007
- }, FetchOptions["throw"] extends true ? true : true>>;
1008
- };
1009
- } & {
1010
- organization: {
1011
- leave: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1012
- organizationId: string;
1013
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1014
- organizationId: string;
1015
- } & {
1016
- fetchOptions?: FetchOptions | undefined;
1017
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<NonNullable<Omit<{
1018
- id: string;
1019
- organizationId: string;
1020
- role: "org:admin" | "org:member" | "org:reviewer";
1021
- createdAt: Date;
1022
- userId: string;
1023
- teamId?: string | undefined | undefined;
1024
- user: {
1025
- id: string;
1026
- email: string;
1027
- name: string;
1028
- image?: string | undefined;
1029
- };
1030
- } & {
1031
- user: {
1032
- id: string;
1033
- createdAt: Date;
1034
- updatedAt: Date;
1035
- email: string;
1036
- emailVerified: boolean;
1037
- name: string;
1038
- image?: string | null | undefined;
1039
- };
1040
- }, "user"> & {
1041
- user: {
1042
- id: string;
1043
- name: string;
1044
- email: string;
1045
- image: string | undefined;
1046
- };
1047
- }>, {
1048
- code?: string | undefined;
1049
- message?: string | undefined;
1050
- }, FetchOptions["throw"] extends true ? true : true>>;
1051
- };
1052
- } & {
1053
- organization: {
1054
- listUserInvitations: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1055
- email?: string | undefined;
1056
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1057
- query?: {
1058
- email?: string | undefined;
1059
- } | undefined;
1060
- fetchOptions?: FetchOptions | undefined;
1061
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<(Omit<{
1062
- id: string;
1063
- organizationId: string;
1064
- email: string;
1065
- role: "org:admin" | "org:member" | "org:reviewer";
1066
- status: better_auth_plugins.InvitationStatus;
1067
- inviterId: string;
1068
- expiresAt: Date;
1069
- createdAt: Date;
1070
- teamId?: string | undefined | undefined;
1071
- } & {
1072
- organization: {
1073
- id: string;
1074
- name: string;
1075
- slug: string;
1076
- createdAt: Date;
1077
- logo?: string | null | undefined | undefined;
1078
- metadata?: any;
1079
- };
1080
- }, "organization"> & {
1081
- organizationName: string;
1082
- })[], {
1083
- code?: string | undefined;
1084
- message?: string | undefined;
1085
- }, FetchOptions["throw"] extends true ? true : true>>;
1086
- };
1087
- } & {
1088
- organization: {
1089
- listMembers: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1090
- limit?: string | number | undefined;
1091
- offset?: string | number | undefined;
1092
- sortBy?: string | undefined;
1093
- sortDirection?: "asc" | "desc" | undefined;
1094
- filterField?: string | undefined;
1095
- filterValue?: string | number | boolean | string[] | number[] | undefined;
1096
- filterOperator?: "in" | "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
1097
- organizationId?: string | undefined;
1098
- organizationSlug?: string | undefined;
1099
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1100
- query?: {
1101
- limit?: string | number | undefined;
1102
- offset?: string | number | undefined;
1103
- sortBy?: string | undefined;
1104
- sortDirection?: "asc" | "desc" | undefined;
1105
- filterField?: string | undefined;
1106
- filterValue?: string | number | boolean | string[] | number[] | undefined;
1107
- filterOperator?: "in" | "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
1108
- organizationId?: string | undefined;
1109
- organizationSlug?: string | undefined;
1110
- } | undefined;
1111
- fetchOptions?: FetchOptions | undefined;
1112
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1113
- members: ({
1114
- id: string;
1115
- organizationId: string;
1116
- role: "org:admin" | "org:member" | "org:reviewer";
1117
- createdAt: Date;
1118
- userId: string;
1119
- teamId?: string | undefined | undefined;
1120
- user: {
1121
- id: string;
1122
- email: string;
1123
- name: string;
1124
- image?: string | undefined;
1125
- };
1126
- } & {
1127
- user: {
1128
- id: string;
1129
- name: string;
1130
- email: string;
1131
- image: string | null | undefined;
1132
- };
1133
- })[];
1134
- total: number;
1135
- }, {
1136
- code?: string | undefined;
1137
- message?: string | undefined;
1138
- }, FetchOptions["throw"] extends true ? true : true>>;
1139
- };
1140
- } & {
1141
- organization: {
1142
- getActiveMemberRole: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1143
- userId?: string | undefined;
1144
- organizationId?: string | undefined;
1145
- organizationSlug?: string | undefined;
1146
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1147
- query?: {
1148
- userId?: string | undefined;
1149
- organizationId?: string | undefined;
1150
- organizationSlug?: string | undefined;
1151
- } | undefined;
1152
- fetchOptions?: FetchOptions | undefined;
1153
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1154
- role: "org:admin" | "org:member" | "org:reviewer";
1155
- }, {
1156
- code?: string | undefined;
1157
- message?: string | undefined;
1158
- }, FetchOptions["throw"] extends true ? true : true>>;
1159
- };
1160
- } & {
1161
- organization: {
1162
- hasPermission: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1163
- permissions: {
1164
- access?: string[] | undefined;
1165
- organization?: ("update" | "delete")[] | undefined;
1166
- member?: ("update" | "delete" | "create")[] | undefined;
1167
- invitation?: ("create" | "cancel")[] | undefined;
1168
- team?: ("update" | "delete" | "create")[] | undefined;
1169
- ac?: ("update" | "delete" | "create" | "read")[] | undefined;
1170
- };
1171
- } & {
1172
- organizationId?: string | undefined;
1173
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1174
- permissions: {
1175
- access?: string[] | undefined;
1176
- organization?: ("update" | "delete")[] | undefined;
1177
- member?: ("update" | "delete" | "create")[] | undefined;
1178
- invitation?: ("create" | "cancel")[] | undefined;
1179
- team?: ("update" | "delete" | "create")[] | undefined;
1180
- ac?: ("update" | "delete" | "create" | "read")[] | undefined;
1181
- };
1182
- } & {
1183
- organizationId?: string | undefined;
1184
- } & {
1185
- fetchOptions?: FetchOptions | undefined;
1186
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1187
- error: null;
1188
- success: boolean;
1189
- }, {
1190
- code?: string | undefined;
1191
- message?: string | undefined;
1192
- }, FetchOptions["throw"] extends true ? true : true>>;
1193
- };
1194
- } & {
1195
- organization: {
1196
- createTeam: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1197
- name: string;
1198
- organizationId?: string | undefined;
1199
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1200
- name: string;
1201
- organizationId?: string | undefined;
1202
- } & {
1203
- fetchOptions?: FetchOptions | undefined;
1204
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1205
- id: string;
1206
- name: string;
1207
- organizationId: string;
1208
- createdAt: Date;
1209
- updatedAt?: Date | undefined;
1210
- }, {
1211
- code?: string | undefined;
1212
- message?: string | undefined;
1213
- }, FetchOptions["throw"] extends true ? true : true>>;
1214
- };
1215
- } & {
1216
- organization: {
1217
- listTeams: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1218
- organizationId?: string | undefined;
1219
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1220
- query?: {
1221
- organizationId?: string | undefined;
1222
- } | undefined;
1223
- fetchOptions?: FetchOptions | undefined;
1224
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1225
- id: string;
1226
- name: string;
1227
- organizationId: string;
1228
- createdAt: Date;
1229
- updatedAt?: Date | undefined;
1230
- }[], {
1231
- code?: string | undefined;
1232
- message?: string | undefined;
1233
- }, FetchOptions["throw"] extends true ? true : true>>;
1234
- };
1235
- } & {
1236
- organization: {
1237
- removeTeam: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1238
- teamId: string;
1239
- organizationId?: string | undefined;
1240
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1241
- teamId: string;
1242
- organizationId?: string | undefined;
1243
- } & {
1244
- fetchOptions?: FetchOptions | undefined;
1245
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1246
- message: string;
1247
- }, {
1248
- code?: string | undefined;
1249
- message?: string | undefined;
1250
- }, FetchOptions["throw"] extends true ? true : true>>;
1251
- };
1252
- } & {
1253
- organization: {
1254
- updateTeam: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1255
- teamId: string;
1256
- data: Partial<{
1257
- name: string;
1258
- organizationId: string;
1259
- }>;
1260
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1261
- teamId: string;
1262
- data: Partial<{
1263
- name: string;
1264
- organizationId: string;
1265
- }>;
1266
- } & {
1267
- fetchOptions?: FetchOptions | undefined;
1268
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1269
- id: string;
1270
- name: string;
1271
- organizationId: string;
1272
- createdAt: Date;
1273
- updatedAt?: Date | undefined;
1274
- }, {
1275
- code?: string | undefined;
1276
- message?: string | undefined;
1277
- }, FetchOptions["throw"] extends true ? true : true>>;
1278
- };
1279
- } & {
1280
- organization: {
1281
- setActiveTeam: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1282
- teamId?: string | null | undefined;
1283
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1284
- teamId?: string | null | undefined;
1285
- } & {
1286
- fetchOptions?: FetchOptions | undefined;
1287
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1288
- id: string;
1289
- name: string;
1290
- organizationId: string;
1291
- createdAt: Date;
1292
- updatedAt?: Date | undefined;
1293
- }, {
1294
- code?: string | undefined;
1295
- message?: string | undefined;
1296
- }, FetchOptions["throw"] extends true ? true : true>>;
1297
- };
1298
- } & {
1299
- organization: {
1300
- listUserTeams: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1301
- query?: Record<string, any> | undefined;
1302
- fetchOptions?: FetchOptions | undefined;
1303
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1304
- id: string;
1305
- name: string;
1306
- organizationId: string;
1307
- createdAt: Date;
1308
- updatedAt?: Date | undefined;
1309
- }[], {
1310
- code?: string | undefined;
1311
- message?: string | undefined;
1312
- }, FetchOptions["throw"] extends true ? true : true>>;
1313
- };
1314
- } & {
1315
- organization: {
1316
- listTeamMembers: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1317
- teamId?: string | undefined;
1318
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1319
- query?: {
1320
- teamId?: string | undefined;
1321
- } | undefined;
1322
- fetchOptions?: FetchOptions | undefined;
1323
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1324
- id: string;
1325
- teamId: string;
1326
- userId: string;
1327
- createdAt: Date;
1328
- }[], {
1329
- code?: string | undefined;
1330
- message?: string | undefined;
1331
- }, FetchOptions["throw"] extends true ? true : true>>;
1332
- };
1333
- } & {
1334
- organization: {
1335
- addTeamMember: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1336
- teamId: string;
1337
- userId: unknown;
1338
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1339
- teamId: string;
1340
- userId: unknown;
1341
- } & {
1342
- fetchOptions?: FetchOptions | undefined;
1343
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1344
- id: string;
1345
- teamId: string;
1346
- userId: string;
1347
- createdAt: Date;
1348
- }, {
1349
- code?: string | undefined;
1350
- message?: string | undefined;
1351
- }, FetchOptions["throw"] extends true ? true : true>>;
1352
- };
1353
- } & {
1354
- organization: {
1355
- removeTeamMember: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1356
- teamId: string;
1357
- userId: unknown;
1358
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1359
- teamId: string;
1360
- userId: unknown;
1361
- } & {
1362
- fetchOptions?: FetchOptions | undefined;
1363
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1364
- message: string;
1365
- }, {
1366
- code?: string | undefined;
1367
- message?: string | undefined;
1368
- }, FetchOptions["throw"] extends true ? true : true>>;
1369
- };
1370
- } & {
1371
- sso: {
1372
- saml2: {
1373
- sp: {
1374
- metadata: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1375
- providerId: string;
1376
- format?: "json" | "xml" | undefined;
1377
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1378
- query: {
1379
- providerId: string;
1380
- format?: "json" | "xml" | undefined;
1381
- };
1382
- fetchOptions?: FetchOptions | undefined;
1383
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<Response, {
1384
- code?: string | undefined;
1385
- message?: string | undefined;
1386
- }, FetchOptions["throw"] extends true ? true : true>>;
1387
- };
1388
- };
1389
- };
1390
- } & {
1391
- sso: {
1392
- register: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1393
- providerId: string;
1394
- issuer: string;
1395
- domain: string;
1396
- oidcConfig?: {
1397
- clientId: string;
1398
- clientSecret: string;
1399
- authorizationEndpoint?: string | undefined;
1400
- tokenEndpoint?: string | undefined;
1401
- userInfoEndpoint?: string | undefined;
1402
- tokenEndpointAuthentication?: "client_secret_post" | "client_secret_basic" | undefined;
1403
- jwksEndpoint?: string | undefined;
1404
- discoveryEndpoint?: string | undefined;
1405
- skipDiscovery?: boolean | undefined;
1406
- scopes?: string[] | undefined;
1407
- pkce?: boolean | undefined;
1408
- mapping?: {
1409
- id: string;
1410
- email: string;
1411
- name: string;
1412
- emailVerified?: string | undefined;
1413
- image?: string | undefined;
1414
- extraFields?: Record<string, any> | undefined;
1415
- } | undefined;
1416
- } | undefined;
1417
- samlConfig?: {
1418
- entryPoint: string;
1419
- cert: string;
1420
- callbackUrl: string;
1421
- spMetadata: {
1422
- metadata?: string | undefined;
1423
- entityID?: string | undefined;
1424
- binding?: string | undefined;
1425
- privateKey?: string | undefined;
1426
- privateKeyPass?: string | undefined;
1427
- isAssertionEncrypted?: boolean | undefined;
1428
- encPrivateKey?: string | undefined;
1429
- encPrivateKeyPass?: string | undefined;
1430
- };
1431
- audience?: string | undefined;
1432
- idpMetadata?: {
1433
- metadata?: string | undefined;
1434
- entityID?: string | undefined;
1435
- cert?: string | undefined;
1436
- privateKey?: string | undefined;
1437
- privateKeyPass?: string | undefined;
1438
- isAssertionEncrypted?: boolean | undefined;
1439
- encPrivateKey?: string | undefined;
1440
- encPrivateKeyPass?: string | undefined;
1441
- singleSignOnService?: {
1442
- Binding: string;
1443
- Location: string;
1444
- }[] | undefined;
1445
- } | undefined;
1446
- wantAssertionsSigned?: boolean | undefined;
1447
- authnRequestsSigned?: boolean | undefined;
1448
- signatureAlgorithm?: string | undefined;
1449
- digestAlgorithm?: string | undefined;
1450
- identifierFormat?: string | undefined;
1451
- privateKey?: string | undefined;
1452
- decryptionPvk?: string | undefined;
1453
- additionalParams?: Record<string, any> | undefined;
1454
- mapping?: {
1455
- id: string;
1456
- email: string;
1457
- name: string;
1458
- emailVerified?: string | undefined;
1459
- firstName?: string | undefined;
1460
- lastName?: string | undefined;
1461
- extraFields?: Record<string, any> | undefined;
1462
- } | undefined;
1463
- } | undefined;
1464
- organizationId?: string | undefined;
1465
- overrideUserInfo?: boolean | undefined;
1466
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1467
- providerId: string;
1468
- issuer: string;
1469
- domain: string;
1470
- oidcConfig?: {
1471
- clientId: string;
1472
- clientSecret: string;
1473
- authorizationEndpoint?: string | undefined;
1474
- tokenEndpoint?: string | undefined;
1475
- userInfoEndpoint?: string | undefined;
1476
- tokenEndpointAuthentication?: "client_secret_post" | "client_secret_basic" | undefined;
1477
- jwksEndpoint?: string | undefined;
1478
- discoveryEndpoint?: string | undefined;
1479
- skipDiscovery?: boolean | undefined;
1480
- scopes?: string[] | undefined;
1481
- pkce?: boolean | undefined;
1482
- mapping?: {
1483
- id: string;
1484
- email: string;
1485
- name: string;
1486
- emailVerified?: string | undefined;
1487
- image?: string | undefined;
1488
- extraFields?: Record<string, any> | undefined;
1489
- } | undefined;
1490
- } | undefined;
1491
- samlConfig?: {
1492
- entryPoint: string;
1493
- cert: string;
1494
- callbackUrl: string;
1495
- spMetadata: {
1496
- metadata?: string | undefined;
1497
- entityID?: string | undefined;
1498
- binding?: string | undefined;
1499
- privateKey?: string | undefined;
1500
- privateKeyPass?: string | undefined;
1501
- isAssertionEncrypted?: boolean | undefined;
1502
- encPrivateKey?: string | undefined;
1503
- encPrivateKeyPass?: string | undefined;
1504
- };
1505
- audience?: string | undefined;
1506
- idpMetadata?: {
1507
- metadata?: string | undefined;
1508
- entityID?: string | undefined;
1509
- cert?: string | undefined;
1510
- privateKey?: string | undefined;
1511
- privateKeyPass?: string | undefined;
1512
- isAssertionEncrypted?: boolean | undefined;
1513
- encPrivateKey?: string | undefined;
1514
- encPrivateKeyPass?: string | undefined;
1515
- singleSignOnService?: {
1516
- Binding: string;
1517
- Location: string;
1518
- }[] | undefined;
1519
- } | undefined;
1520
- wantAssertionsSigned?: boolean | undefined;
1521
- authnRequestsSigned?: boolean | undefined;
1522
- signatureAlgorithm?: string | undefined;
1523
- digestAlgorithm?: string | undefined;
1524
- identifierFormat?: string | undefined;
1525
- privateKey?: string | undefined;
1526
- decryptionPvk?: string | undefined;
1527
- additionalParams?: Record<string, any> | undefined;
1528
- mapping?: {
1529
- id: string;
1530
- email: string;
1531
- name: string;
1532
- emailVerified?: string | undefined;
1533
- firstName?: string | undefined;
1534
- lastName?: string | undefined;
1535
- extraFields?: Record<string, any> | undefined;
1536
- } | undefined;
1537
- } | undefined;
1538
- organizationId?: string | undefined;
1539
- overrideUserInfo?: boolean | undefined;
1540
- } & {
1541
- fetchOptions?: FetchOptions | undefined;
1542
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<NonNullable<{
1543
- redirectURI: string;
1544
- oidcConfig: _better_auth_sso.OIDCConfig | null;
1545
- samlConfig: _better_auth_sso.SAMLConfig | null;
1546
- } & Omit<{
1547
- issuer: string;
1548
- oidcConfig?: _better_auth_sso.OIDCConfig | undefined;
1549
- samlConfig?: _better_auth_sso.SAMLConfig | undefined;
1550
- userId: string;
1551
- providerId: string;
1552
- organizationId?: string | undefined;
1553
- domain: string;
1554
- }, "oidcConfig" | "samlConfig">>, {
1555
- code?: string | undefined;
1556
- message?: string | undefined;
1557
- }, FetchOptions["throw"] extends true ? true : true>>;
1558
- };
1559
- } & {
1560
- signIn: {
1561
- sso: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1562
- callbackURL: string;
1563
- email?: string | undefined;
1564
- organizationSlug?: string | undefined;
1565
- providerId?: string | undefined;
1566
- domain?: string | undefined;
1567
- errorCallbackURL?: string | undefined;
1568
- newUserCallbackURL?: string | undefined;
1569
- scopes?: string[] | undefined;
1570
- loginHint?: string | undefined;
1571
- requestSignUp?: boolean | undefined;
1572
- providerType?: "saml" | "oidc" | undefined;
1573
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1574
- callbackURL: string;
1575
- email?: string | undefined;
1576
- organizationSlug?: string | undefined;
1577
- providerId?: string | undefined;
1578
- domain?: string | undefined;
1579
- errorCallbackURL?: string | undefined;
1580
- newUserCallbackURL?: string | undefined;
1581
- scopes?: string[] | undefined;
1582
- loginHint?: string | undefined;
1583
- requestSignUp?: boolean | undefined;
1584
- providerType?: "saml" | "oidc" | undefined;
1585
- } & {
1586
- fetchOptions?: FetchOptions | undefined;
1587
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1588
- url: string;
1589
- redirect: boolean;
1590
- }, {
1591
- code?: string | undefined;
1592
- message?: string | undefined;
1593
- }, FetchOptions["throw"] extends true ? true : true>>;
1594
- };
1595
- } & {
1596
- sso: {
1597
- providers: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1598
- query?: Record<string, any> | undefined;
1599
- fetchOptions?: FetchOptions | undefined;
1600
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1601
- providers: {
1602
- providerId: string;
1603
- type: string;
1604
- issuer: string;
1605
- domain: string;
1606
- organizationId: string | null;
1607
- domainVerified: boolean;
1608
- oidcConfig: {
1609
- discoveryEndpoint: string;
1610
- clientIdLastFour: string;
1611
- pkce: boolean;
1612
- authorizationEndpoint: string | undefined;
1613
- tokenEndpoint: string | undefined;
1614
- userInfoEndpoint: string | undefined;
1615
- jwksEndpoint: string | undefined;
1616
- scopes: string[] | undefined;
1617
- tokenEndpointAuthentication: "client_secret_post" | "client_secret_basic" | undefined;
1618
- } | undefined;
1619
- samlConfig: {
1620
- entryPoint: string;
1621
- callbackUrl: string;
1622
- audience: string | undefined;
1623
- wantAssertionsSigned: boolean | undefined;
1624
- authnRequestsSigned: boolean | undefined;
1625
- identifierFormat: string | undefined;
1626
- signatureAlgorithm: string | undefined;
1627
- digestAlgorithm: string | undefined;
1628
- certificate: {
1629
- fingerprintSha256: string;
1630
- notBefore: string;
1631
- notAfter: string;
1632
- publicKeyAlgorithm: string;
1633
- } | {
1634
- error: string;
1635
- };
1636
- } | undefined;
1637
- spMetadataUrl: string;
1638
- }[];
1639
- }, {
1640
- code?: string | undefined;
1641
- message?: string | undefined;
1642
- }, FetchOptions["throw"] extends true ? true : true>>;
1643
- };
1644
- } & {
1645
- sso: {
1646
- getProvider: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1647
- providerId: string;
1648
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1649
- query: {
1650
- providerId: string;
1651
- };
1652
- fetchOptions?: FetchOptions | undefined;
1653
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1654
- providerId: string;
1655
- type: string;
1656
- issuer: string;
1657
- domain: string;
1658
- organizationId: string | null;
1659
- domainVerified: boolean;
1660
- oidcConfig: {
1661
- discoveryEndpoint: string;
1662
- clientIdLastFour: string;
1663
- pkce: boolean;
1664
- authorizationEndpoint: string | undefined;
1665
- tokenEndpoint: string | undefined;
1666
- userInfoEndpoint: string | undefined;
1667
- jwksEndpoint: string | undefined;
1668
- scopes: string[] | undefined;
1669
- tokenEndpointAuthentication: "client_secret_post" | "client_secret_basic" | undefined;
1670
- } | undefined;
1671
- samlConfig: {
1672
- entryPoint: string;
1673
- callbackUrl: string;
1674
- audience: string | undefined;
1675
- wantAssertionsSigned: boolean | undefined;
1676
- authnRequestsSigned: boolean | undefined;
1677
- identifierFormat: string | undefined;
1678
- signatureAlgorithm: string | undefined;
1679
- digestAlgorithm: string | undefined;
1680
- certificate: {
1681
- fingerprintSha256: string;
1682
- notBefore: string;
1683
- notAfter: string;
1684
- publicKeyAlgorithm: string;
1685
- } | {
1686
- error: string;
1687
- };
1688
- } | undefined;
1689
- spMetadataUrl: string;
1690
- }, {
1691
- code?: string | undefined;
1692
- message?: string | undefined;
1693
- }, FetchOptions["throw"] extends true ? true : true>>;
1694
- };
1695
- } & {
1696
- sso: {
1697
- updateProvider: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1698
- providerId: string;
1699
- issuer?: string | undefined;
1700
- domain?: string | undefined;
1701
- oidcConfig?: {
1702
- clientId?: string | undefined;
1703
- clientSecret?: string | undefined;
1704
- authorizationEndpoint?: string | undefined;
1705
- tokenEndpoint?: string | undefined;
1706
- userInfoEndpoint?: string | undefined;
1707
- tokenEndpointAuthentication?: "client_secret_post" | "client_secret_basic" | undefined;
1708
- jwksEndpoint?: string | undefined;
1709
- discoveryEndpoint?: string | undefined;
1710
- scopes?: string[] | undefined;
1711
- pkce?: boolean | undefined;
1712
- overrideUserInfo?: boolean | undefined;
1713
- mapping?: {
1714
- id?: string | undefined;
1715
- email?: string | undefined;
1716
- emailVerified?: string | undefined;
1717
- name?: string | undefined;
1718
- image?: string | undefined;
1719
- extraFields?: Record<string, any> | undefined;
1720
- } | undefined;
1721
- } | undefined;
1722
- samlConfig?: {
1723
- entryPoint?: string | undefined;
1724
- cert?: string | undefined;
1725
- callbackUrl?: string | undefined;
1726
- audience?: string | undefined;
1727
- idpMetadata?: {
1728
- metadata?: string | undefined;
1729
- entityID?: string | undefined;
1730
- cert?: string | undefined;
1731
- privateKey?: string | undefined;
1732
- privateKeyPass?: string | undefined;
1733
- isAssertionEncrypted?: boolean | undefined;
1734
- encPrivateKey?: string | undefined;
1735
- encPrivateKeyPass?: string | undefined;
1736
- singleSignOnService?: {
1737
- Binding: string;
1738
- Location: string;
1739
- }[] | undefined;
1740
- } | undefined;
1741
- spMetadata?: {
1742
- metadata?: string | undefined;
1743
- entityID?: string | undefined;
1744
- binding?: string | undefined;
1745
- privateKey?: string | undefined;
1746
- privateKeyPass?: string | undefined;
1747
- isAssertionEncrypted?: boolean | undefined;
1748
- encPrivateKey?: string | undefined;
1749
- encPrivateKeyPass?: string | undefined;
1750
- } | undefined;
1751
- wantAssertionsSigned?: boolean | undefined;
1752
- authnRequestsSigned?: boolean | undefined;
1753
- signatureAlgorithm?: string | undefined;
1754
- digestAlgorithm?: string | undefined;
1755
- identifierFormat?: string | undefined;
1756
- privateKey?: string | undefined;
1757
- decryptionPvk?: string | undefined;
1758
- additionalParams?: Record<string, any> | undefined;
1759
- mapping?: {
1760
- id?: string | undefined;
1761
- email?: string | undefined;
1762
- emailVerified?: string | undefined;
1763
- name?: string | undefined;
1764
- firstName?: string | undefined;
1765
- lastName?: string | undefined;
1766
- extraFields?: Record<string, any> | undefined;
1767
- } | undefined;
1768
- } | undefined;
1769
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1770
- providerId: string;
1771
- issuer?: string | undefined;
1772
- domain?: string | undefined;
1773
- oidcConfig?: {
1774
- clientId?: string | undefined;
1775
- clientSecret?: string | undefined;
1776
- authorizationEndpoint?: string | undefined;
1777
- tokenEndpoint?: string | undefined;
1778
- userInfoEndpoint?: string | undefined;
1779
- tokenEndpointAuthentication?: "client_secret_post" | "client_secret_basic" | undefined;
1780
- jwksEndpoint?: string | undefined;
1781
- discoveryEndpoint?: string | undefined;
1782
- scopes?: string[] | undefined;
1783
- pkce?: boolean | undefined;
1784
- overrideUserInfo?: boolean | undefined;
1785
- mapping?: {
1786
- id?: string | undefined;
1787
- email?: string | undefined;
1788
- emailVerified?: string | undefined;
1789
- name?: string | undefined;
1790
- image?: string | undefined;
1791
- extraFields?: Record<string, any> | undefined;
1792
- } | undefined;
1793
- } | undefined;
1794
- samlConfig?: {
1795
- entryPoint?: string | undefined;
1796
- cert?: string | undefined;
1797
- callbackUrl?: string | undefined;
1798
- audience?: string | undefined;
1799
- idpMetadata?: {
1800
- metadata?: string | undefined;
1801
- entityID?: string | undefined;
1802
- cert?: string | undefined;
1803
- privateKey?: string | undefined;
1804
- privateKeyPass?: string | undefined;
1805
- isAssertionEncrypted?: boolean | undefined;
1806
- encPrivateKey?: string | undefined;
1807
- encPrivateKeyPass?: string | undefined;
1808
- singleSignOnService?: {
1809
- Binding: string;
1810
- Location: string;
1811
- }[] | undefined;
1812
- } | undefined;
1813
- spMetadata?: {
1814
- metadata?: string | undefined;
1815
- entityID?: string | undefined;
1816
- binding?: string | undefined;
1817
- privateKey?: string | undefined;
1818
- privateKeyPass?: string | undefined;
1819
- isAssertionEncrypted?: boolean | undefined;
1820
- encPrivateKey?: string | undefined;
1821
- encPrivateKeyPass?: string | undefined;
1822
- } | undefined;
1823
- wantAssertionsSigned?: boolean | undefined;
1824
- authnRequestsSigned?: boolean | undefined;
1825
- signatureAlgorithm?: string | undefined;
1826
- digestAlgorithm?: string | undefined;
1827
- identifierFormat?: string | undefined;
1828
- privateKey?: string | undefined;
1829
- decryptionPvk?: string | undefined;
1830
- additionalParams?: Record<string, any> | undefined;
1831
- mapping?: {
1832
- id?: string | undefined;
1833
- email?: string | undefined;
1834
- emailVerified?: string | undefined;
1835
- name?: string | undefined;
1836
- firstName?: string | undefined;
1837
- lastName?: string | undefined;
1838
- extraFields?: Record<string, any> | undefined;
1839
- } | undefined;
1840
- } | undefined;
1841
- } & {
1842
- fetchOptions?: FetchOptions | undefined;
1843
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1844
- providerId: string;
1845
- type: string;
1846
- issuer: string;
1847
- domain: string;
1848
- organizationId: string | null;
1849
- domainVerified: boolean;
1850
- oidcConfig: {
1851
- discoveryEndpoint: string;
1852
- clientIdLastFour: string;
1853
- pkce: boolean;
1854
- authorizationEndpoint: string | undefined;
1855
- tokenEndpoint: string | undefined;
1856
- userInfoEndpoint: string | undefined;
1857
- jwksEndpoint: string | undefined;
1858
- scopes: string[] | undefined;
1859
- tokenEndpointAuthentication: "client_secret_post" | "client_secret_basic" | undefined;
1860
- } | undefined;
1861
- samlConfig: {
1862
- entryPoint: string;
1863
- callbackUrl: string;
1864
- audience: string | undefined;
1865
- wantAssertionsSigned: boolean | undefined;
1866
- authnRequestsSigned: boolean | undefined;
1867
- identifierFormat: string | undefined;
1868
- signatureAlgorithm: string | undefined;
1869
- digestAlgorithm: string | undefined;
1870
- certificate: {
1871
- fingerprintSha256: string;
1872
- notBefore: string;
1873
- notAfter: string;
1874
- publicKeyAlgorithm: string;
1875
- } | {
1876
- error: string;
1877
- };
1878
- } | undefined;
1879
- spMetadataUrl: string;
1880
- }, {
1881
- code?: string | undefined;
1882
- message?: string | undefined;
1883
- }, FetchOptions["throw"] extends true ? true : true>>;
1884
- };
1885
- } & {
1886
- sso: {
1887
- deleteProvider: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1888
- providerId: string;
1889
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1890
- providerId: string;
1891
- } & {
1892
- fetchOptions?: FetchOptions | undefined;
1893
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1894
- success: boolean;
1895
- }, {
1896
- code?: string | undefined;
1897
- message?: string | undefined;
1898
- }, FetchOptions["throw"] extends true ? true : true>>;
1899
- };
1900
- } & {
1901
- twoFactor: {
1902
- enable: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1903
- password: string;
1904
- issuer?: string | undefined;
1905
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1906
- password: string;
1907
- issuer?: string | undefined;
1908
- } & {
1909
- fetchOptions?: FetchOptions | undefined;
1910
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1911
- totpURI: string;
1912
- backupCodes: string[];
1913
- }, {
1914
- code?: string | undefined;
1915
- message?: string | undefined;
1916
- }, FetchOptions["throw"] extends true ? true : true>>;
1917
- };
1918
- } & {
1919
- twoFactor: {
1920
- disable: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1921
- password: string;
1922
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1923
- password: string;
1924
- } & {
1925
- fetchOptions?: FetchOptions | undefined;
1926
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1927
- status: boolean;
1928
- }, {
1929
- code?: string | undefined;
1930
- message?: string | undefined;
1931
- }, FetchOptions["throw"] extends true ? true : true>>;
1932
- };
1933
- } & {
1934
- twoFactor: {
1935
- verifyBackupCode: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1936
- code: string;
1937
- disableSession?: boolean | undefined;
1938
- trustDevice?: boolean | undefined;
1939
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1940
- code: string;
1941
- disableSession?: boolean | undefined;
1942
- trustDevice?: boolean | undefined;
1943
- } & {
1944
- fetchOptions?: FetchOptions | undefined;
1945
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<Omit<{
1946
- token: string | undefined;
1947
- user: (Record<string, any> & {
1948
- id: string;
1949
- createdAt: Date;
1950
- updatedAt: Date;
1951
- email: string;
1952
- emailVerified: boolean;
1953
- name: string;
1954
- image?: string | null | undefined;
1955
- }) | better_auth_plugins.UserWithTwoFactor;
1956
- }, "user"> & {
1957
- user: better_auth.StripEmptyObjects<{
1958
- id: string;
1959
- createdAt: Date;
1960
- updatedAt: Date;
1961
- email: string;
1962
- emailVerified: boolean;
1963
- name: string;
1964
- image?: string | null | undefined;
1965
- } & {
1966
- twoFactorEnabled: boolean | null | undefined;
1967
- } & {} & {
1968
- banned: boolean | null | undefined;
1969
- } & {
1970
- role?: string | null | undefined;
1971
- banReason?: string | null | undefined;
1972
- banExpires?: Date | null | undefined;
1973
- } & {} & {
1974
- lastActiveAt?: Date | null | undefined;
1975
- }>;
1976
- }, {
1977
- code?: string | undefined;
1978
- message?: string | undefined;
1979
- }, FetchOptions["throw"] extends true ? true : true>>;
1980
- };
1981
- } & {
1982
- twoFactor: {
1983
- generateBackupCodes: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1984
- password: string;
1985
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1986
- password: string;
1987
- } & {
1988
- fetchOptions?: FetchOptions | undefined;
1989
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1990
- status: boolean;
1991
- backupCodes: string[];
1992
- }, {
1993
- code?: string | undefined;
1994
- message?: string | undefined;
1995
- }, FetchOptions["throw"] extends true ? true : true>>;
1996
- };
1997
- } & {
1998
- twoFactor: {
1999
- sendOtp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2000
- trustDevice?: boolean | undefined;
2001
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2002
- query?: Record<string, any> | undefined;
2003
- fetchOptions?: FetchOptions | undefined;
2004
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2005
- status: boolean;
2006
- }, {
2007
- code?: string | undefined;
2008
- message?: string | undefined;
2009
- }, FetchOptions["throw"] extends true ? true : true>>;
2010
- };
2011
- } & {
2012
- twoFactor: {
2013
- verifyOtp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2014
- code: string;
2015
- trustDevice?: boolean | undefined;
2016
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2017
- code: string;
2018
- trustDevice?: boolean | undefined;
2019
- } & {
2020
- fetchOptions?: FetchOptions | undefined;
2021
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<(Omit<{
2022
- token: string;
2023
- user: better_auth_plugins.UserWithTwoFactor;
2024
- }, "user"> & {
2025
- user: better_auth.StripEmptyObjects<{
2026
- id: string;
2027
- createdAt: Date;
2028
- updatedAt: Date;
2029
- email: string;
2030
- emailVerified: boolean;
2031
- name: string;
2032
- image?: string | null | undefined;
2033
- } & {
2034
- twoFactorEnabled: boolean | null | undefined;
2035
- } & {} & {
2036
- banned: boolean | null | undefined;
2037
- } & {
2038
- role?: string | null | undefined;
2039
- banReason?: string | null | undefined;
2040
- banExpires?: Date | null | undefined;
2041
- } & {} & {
2042
- lastActiveAt?: Date | null | undefined;
2043
- }>;
2044
- }) | (Omit<{
2045
- token: string;
2046
- user: Record<string, any> & {
2047
- id: string;
2048
- createdAt: Date;
2049
- updatedAt: Date;
2050
- email: string;
2051
- emailVerified: boolean;
2052
- name: string;
2053
- image?: string | null | undefined;
2054
- };
2055
- }, "user"> & {
2056
- user: better_auth.StripEmptyObjects<{
2057
- id: string;
2058
- createdAt: Date;
2059
- updatedAt: Date;
2060
- email: string;
2061
- emailVerified: boolean;
2062
- name: string;
2063
- image?: string | null | undefined;
2064
- } & {
2065
- twoFactorEnabled: boolean | null | undefined;
2066
- } & {} & {
2067
- banned: boolean | null | undefined;
2068
- } & {
2069
- role?: string | null | undefined;
2070
- banReason?: string | null | undefined;
2071
- banExpires?: Date | null | undefined;
2072
- } & {} & {
2073
- lastActiveAt?: Date | null | undefined;
2074
- }>;
2075
- }), {
2076
- code?: string | undefined;
2077
- message?: string | undefined;
2078
- }, FetchOptions["throw"] extends true ? true : true>>;
2079
- };
2080
- } & {
2081
- twoFactor: {
2082
- getTotpUri: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2083
- password: string;
2084
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2085
- password: string;
2086
- } & {
2087
- fetchOptions?: FetchOptions | undefined;
2088
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2089
- totpURI: string;
2090
- }, {
2091
- code?: string | undefined;
2092
- message?: string | undefined;
2093
- }, FetchOptions["throw"] extends true ? true : true>>;
2094
- };
2095
- } & {
2096
- twoFactor: {
2097
- verifyTotp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2098
- code: string;
2099
- trustDevice?: boolean | undefined;
2100
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2101
- code: string;
2102
- trustDevice?: boolean | undefined;
2103
- } & {
2104
- fetchOptions?: FetchOptions | undefined;
2105
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<(Omit<{
2106
- token: string;
2107
- user: better_auth_plugins.UserWithTwoFactor;
2108
- }, "user"> & {
2109
- user: better_auth.StripEmptyObjects<{
2110
- id: string;
2111
- createdAt: Date;
2112
- updatedAt: Date;
2113
- email: string;
2114
- emailVerified: boolean;
2115
- name: string;
2116
- image?: string | null | undefined;
2117
- } & {
2118
- twoFactorEnabled: boolean | null | undefined;
2119
- } & {} & {
2120
- banned: boolean | null | undefined;
2121
- } & {
2122
- role?: string | null | undefined;
2123
- banReason?: string | null | undefined;
2124
- banExpires?: Date | null | undefined;
2125
- } & {} & {
2126
- lastActiveAt?: Date | null | undefined;
2127
- }>;
2128
- }) | (Omit<{
2129
- token: string;
2130
- user: Record<string, any> & {
2131
- id: string;
2132
- createdAt: Date;
2133
- updatedAt: Date;
2134
- email: string;
2135
- emailVerified: boolean;
2136
- name: string;
2137
- image?: string | null | undefined;
2138
- };
2139
- }, "user"> & {
2140
- user: better_auth.StripEmptyObjects<{
2141
- id: string;
2142
- createdAt: Date;
2143
- updatedAt: Date;
2144
- email: string;
2145
- emailVerified: boolean;
2146
- name: string;
2147
- image?: string | null | undefined;
2148
- } & {
2149
- twoFactorEnabled: boolean | null | undefined;
2150
- } & {} & {
2151
- banned: boolean | null | undefined;
2152
- } & {
2153
- role?: string | null | undefined;
2154
- banReason?: string | null | undefined;
2155
- banExpires?: Date | null | undefined;
2156
- } & {} & {
2157
- lastActiveAt?: Date | null | undefined;
2158
- }>;
2159
- }), {
2160
- code?: string | undefined;
2161
- message?: string | undefined;
2162
- }, FetchOptions["throw"] extends true ? true : true>>;
2163
- };
2164
- } & {
2165
- token: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2166
- query?: Record<string, any> | undefined;
2167
- fetchOptions?: FetchOptions | undefined;
2168
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2169
- token: string;
2170
- }, {
2171
- code?: string | undefined;
2172
- message?: string | undefined;
2173
- }, FetchOptions["throw"] extends true ? true : true>>;
2174
- } & {
2175
- apiKey: {
2176
- create: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2177
- configId?: string | undefined;
2178
- name?: string | undefined;
2179
- expiresIn?: number | null | undefined;
2180
- prefix?: string | undefined;
2181
- remaining?: number | null | undefined;
2182
- metadata?: any;
2183
- refillAmount?: number | undefined;
2184
- refillInterval?: number | undefined;
2185
- rateLimitTimeWindow?: number | undefined;
2186
- rateLimitMax?: number | undefined;
2187
- rateLimitEnabled?: boolean | undefined;
2188
- permissions?: Record<string, string[]> | undefined;
2189
- userId?: unknown;
2190
- organizationId?: unknown;
2191
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2192
- configId?: string | undefined;
2193
- name?: string | undefined;
2194
- expiresIn?: number | null | undefined;
2195
- prefix?: string | undefined;
2196
- remaining?: number | null | undefined;
2197
- metadata?: any;
2198
- refillAmount?: number | undefined;
2199
- refillInterval?: number | undefined;
2200
- rateLimitTimeWindow?: number | undefined;
2201
- rateLimitMax?: number | undefined;
2202
- rateLimitEnabled?: boolean | undefined;
2203
- permissions?: Record<string, string[]> | undefined;
2204
- userId?: unknown;
2205
- organizationId?: unknown;
2206
- } & {
2207
- fetchOptions?: FetchOptions | undefined;
2208
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2209
- key: string;
2210
- metadata: any;
2211
- permissions: any;
2212
- id: string;
2213
- configId: string;
2214
- name: string | null;
2215
- start: string | null;
2216
- prefix: string | null;
2217
- referenceId: string;
2218
- refillInterval: number | null;
2219
- refillAmount: number | null;
2220
- lastRefillAt: Date | null;
2221
- enabled: boolean;
2222
- rateLimitEnabled: boolean;
2223
- rateLimitTimeWindow: number | null;
2224
- rateLimitMax: number | null;
2225
- requestCount: number;
2226
- remaining: number | null;
2227
- lastRequest: Date | null;
2228
- expiresAt: Date | null;
2229
- createdAt: Date;
2230
- updatedAt: Date;
2231
- }, {
2232
- code?: string | undefined;
2233
- message?: string | undefined;
2234
- }, FetchOptions["throw"] extends true ? true : true>>;
2235
- };
2236
- } & {
2237
- apiKey: {
2238
- get: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
2239
- id: string;
2240
- configId?: string | undefined;
2241
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2242
- query: {
2243
- id: string;
2244
- configId?: string | undefined;
2245
- };
2246
- fetchOptions?: FetchOptions | undefined;
2247
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2248
- metadata: Record<string, any> | null;
2249
- permissions: {
2250
- [key: string]: string[];
2251
- } | null;
2252
- id: string;
2253
- configId: string;
2254
- name: string | null;
2255
- start: string | null;
2256
- prefix: string | null;
2257
- referenceId: string;
2258
- refillInterval: number | null;
2259
- refillAmount: number | null;
2260
- lastRefillAt: Date | null;
2261
- enabled: boolean;
2262
- rateLimitEnabled: boolean;
2263
- rateLimitTimeWindow: number | null;
2264
- rateLimitMax: number | null;
2265
- requestCount: number;
2266
- remaining: number | null;
2267
- lastRequest: Date | null;
2268
- expiresAt: Date | null;
2269
- createdAt: Date;
2270
- updatedAt: Date;
2271
- }, {
2272
- code?: string | undefined;
2273
- message?: string | undefined;
2274
- }, FetchOptions["throw"] extends true ? true : true>>;
2275
- };
2276
- } & {
2277
- apiKey: {
2278
- update: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2279
- keyId: string;
2280
- configId?: string | undefined;
2281
- userId?: unknown;
2282
- name?: string | undefined;
2283
- enabled?: boolean | undefined;
2284
- remaining?: number | undefined;
2285
- refillAmount?: number | undefined;
2286
- refillInterval?: number | undefined;
2287
- metadata?: any;
2288
- expiresIn?: number | null | undefined;
2289
- rateLimitEnabled?: boolean | undefined;
2290
- rateLimitTimeWindow?: number | undefined;
2291
- rateLimitMax?: number | undefined;
2292
- permissions?: Record<string, string[]> | null | undefined;
2293
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2294
- keyId: string;
2295
- configId?: string | undefined;
2296
- userId?: unknown;
2297
- name?: string | undefined;
2298
- enabled?: boolean | undefined;
2299
- remaining?: number | undefined;
2300
- refillAmount?: number | undefined;
2301
- refillInterval?: number | undefined;
2302
- metadata?: any;
2303
- expiresIn?: number | null | undefined;
2304
- rateLimitEnabled?: boolean | undefined;
2305
- rateLimitTimeWindow?: number | undefined;
2306
- rateLimitMax?: number | undefined;
2307
- permissions?: Record<string, string[]> | null | undefined;
2308
- } & {
2309
- fetchOptions?: FetchOptions | undefined;
2310
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2311
- metadata: Record<string, any> | null;
2312
- permissions: {
2313
- [key: string]: string[];
2314
- } | null;
2315
- id: string;
2316
- configId: string;
2317
- name: string | null;
2318
- start: string | null;
2319
- prefix: string | null;
2320
- referenceId: string;
2321
- refillInterval: number | null;
2322
- refillAmount: number | null;
2323
- lastRefillAt: Date | null;
2324
- enabled: boolean;
2325
- rateLimitEnabled: boolean;
2326
- rateLimitTimeWindow: number | null;
2327
- rateLimitMax: number | null;
2328
- requestCount: number;
2329
- remaining: number | null;
2330
- lastRequest: Date | null;
2331
- expiresAt: Date | null;
2332
- createdAt: Date;
2333
- updatedAt: Date;
2334
- }, {
2335
- code?: string | undefined;
2336
- message?: string | undefined;
2337
- }, FetchOptions["throw"] extends true ? true : true>>;
2338
- };
2339
- } & {
2340
- apiKey: {
2341
- delete: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2342
- keyId: string;
2343
- configId?: string | undefined;
2344
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2345
- keyId: string;
2346
- configId?: string | undefined;
2347
- } & {
2348
- fetchOptions?: FetchOptions | undefined;
2349
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2350
- success: boolean;
2351
- }, {
2352
- code?: string | undefined;
2353
- message?: string | undefined;
2354
- }, FetchOptions["throw"] extends true ? true : true>>;
2355
- };
2356
- } & {
2357
- apiKey: {
2358
- list: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
2359
- configId?: string | undefined;
2360
- organizationId?: string | undefined;
2361
- limit?: unknown;
2362
- offset?: unknown;
2363
- sortBy?: string | undefined;
2364
- sortDirection?: "asc" | "desc" | undefined;
2365
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2366
- query?: {
2367
- configId?: string | undefined;
2368
- organizationId?: string | undefined;
2369
- limit?: unknown;
2370
- offset?: unknown;
2371
- sortBy?: string | undefined;
2372
- sortDirection?: "asc" | "desc" | undefined;
2373
- } | undefined;
2374
- fetchOptions?: FetchOptions | undefined;
2375
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2376
- apiKeys: {
2377
- metadata: Record<string, any> | null;
2378
- permissions: {
2379
- [key: string]: string[];
2380
- } | null;
2381
- id: string;
2382
- configId: string;
2383
- name: string | null;
2384
- start: string | null;
2385
- prefix: string | null;
2386
- referenceId: string;
2387
- refillInterval: number | null;
2388
- refillAmount: number | null;
2389
- lastRefillAt: Date | null;
2390
- enabled: boolean;
2391
- rateLimitEnabled: boolean;
2392
- rateLimitTimeWindow: number | null;
2393
- rateLimitMax: number | null;
2394
- requestCount: number;
2395
- remaining: number | null;
2396
- lastRequest: Date | null;
2397
- expiresAt: Date | null;
2398
- createdAt: Date;
2399
- updatedAt: Date;
2400
- }[];
2401
- total: number;
2402
- limit: number | undefined;
2403
- offset: number | undefined;
2404
- }, {
2405
- code?: string | undefined;
2406
- message?: string | undefined;
2407
- }, FetchOptions["throw"] extends true ? true : true>>;
2408
- };
2409
- } & {
2410
- admin: {
2411
- setRole: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2412
- userId: string;
2413
- role: "admin" | "user" | ("admin" | "user")[];
2414
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2415
- userId: string;
2416
- role: "admin" | "user" | ("admin" | "user")[];
2417
- } & {
2418
- fetchOptions?: FetchOptions | undefined;
2419
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2420
- user: better_auth_plugins.UserWithRole;
2421
- }, {
2422
- code?: string | undefined;
2423
- message?: string | undefined;
2424
- }, FetchOptions["throw"] extends true ? true : true>>;
2425
- };
2426
- } & {
2427
- admin: {
2428
- getUser: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
2429
- id: string;
2430
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2431
- query: {
2432
- id: string;
2433
- };
2434
- fetchOptions?: FetchOptions | undefined;
2435
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<better_auth_plugins.UserWithRole, {
2436
- code?: string | undefined;
2437
- message?: string | undefined;
2438
- }, FetchOptions["throw"] extends true ? true : true>>;
2439
- };
2440
- } & {
2441
- admin: {
2442
- createUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2443
- email: string;
2444
- password?: string | undefined;
2445
- name: string;
2446
- role?: "admin" | "user" | ("admin" | "user")[] | undefined;
2447
- data?: Record<string, any> | undefined;
2448
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2449
- email: string;
2450
- password?: string | undefined;
2451
- name: string;
2452
- role?: "admin" | "user" | ("admin" | "user")[] | undefined;
2453
- data?: Record<string, any> | undefined;
2454
- } & {
2455
- fetchOptions?: FetchOptions | undefined;
2456
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2457
- user: better_auth_plugins.UserWithRole;
2458
- }, {
2459
- code?: string | undefined;
2460
- message?: string | undefined;
2461
- }, FetchOptions["throw"] extends true ? true : true>>;
2462
- };
2463
- } & {
2464
- admin: {
2465
- updateUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2466
- userId: unknown;
2467
- data: Record<any, any>;
2468
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2469
- userId: unknown;
2470
- data: Record<any, any>;
2471
- } & {
2472
- fetchOptions?: FetchOptions | undefined;
2473
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<better_auth_plugins.UserWithRole, {
2474
- code?: string | undefined;
2475
- message?: string | undefined;
2476
- }, FetchOptions["throw"] extends true ? true : true>>;
2477
- };
2478
- } & {
2479
- admin: {
2480
- listUsers: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
2481
- searchValue?: string | undefined;
2482
- searchField?: "name" | "email" | undefined;
2483
- searchOperator?: "contains" | "starts_with" | "ends_with" | undefined;
2484
- limit?: string | number | undefined;
2485
- offset?: string | number | undefined;
2486
- sortBy?: string | undefined;
2487
- sortDirection?: "asc" | "desc" | undefined;
2488
- filterField?: string | undefined;
2489
- filterValue?: string | number | boolean | string[] | number[] | undefined;
2490
- filterOperator?: "in" | "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
2491
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2492
- query: {
2493
- searchValue?: string | undefined;
2494
- searchField?: "name" | "email" | undefined;
2495
- searchOperator?: "contains" | "starts_with" | "ends_with" | undefined;
2496
- limit?: string | number | undefined;
2497
- offset?: string | number | undefined;
2498
- sortBy?: string | undefined;
2499
- sortDirection?: "asc" | "desc" | undefined;
2500
- filterField?: string | undefined;
2501
- filterValue?: string | number | boolean | string[] | number[] | undefined;
2502
- filterOperator?: "in" | "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
2503
- };
2504
- fetchOptions?: FetchOptions | undefined;
2505
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2506
- users: better_auth_plugins.UserWithRole[];
2507
- total: number;
2508
- }, {
2509
- code?: string | undefined;
2510
- message?: string | undefined;
2511
- }, FetchOptions["throw"] extends true ? true : true>>;
2512
- };
2513
- } & {
2514
- admin: {
2515
- listUserSessions: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2516
- userId: unknown;
2517
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2518
- userId: unknown;
2519
- } & {
2520
- fetchOptions?: FetchOptions | undefined;
2521
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2522
- sessions: better_auth_plugins.SessionWithImpersonatedBy[];
2523
- }, {
2524
- code?: string | undefined;
2525
- message?: string | undefined;
2526
- }, FetchOptions["throw"] extends true ? true : true>>;
2527
- };
2528
- } & {
2529
- admin: {
2530
- unbanUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2531
- userId: unknown;
2532
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2533
- userId: unknown;
2534
- } & {
2535
- fetchOptions?: FetchOptions | undefined;
2536
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2537
- user: better_auth_plugins.UserWithRole;
2538
- }, {
2539
- code?: string | undefined;
2540
- message?: string | undefined;
2541
- }, FetchOptions["throw"] extends true ? true : true>>;
2542
- };
2543
- } & {
2544
- admin: {
2545
- banUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2546
- userId: unknown;
2547
- banReason?: string | undefined;
2548
- banExpiresIn?: number | undefined;
2549
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2550
- userId: unknown;
2551
- banReason?: string | undefined;
2552
- banExpiresIn?: number | undefined;
2553
- } & {
2554
- fetchOptions?: FetchOptions | undefined;
2555
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2556
- user: better_auth_plugins.UserWithRole;
2557
- }, {
2558
- code?: string | undefined;
2559
- message?: string | undefined;
2560
- }, FetchOptions["throw"] extends true ? true : true>>;
2561
- };
2562
- } & {
2563
- admin: {
2564
- impersonateUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2565
- userId: unknown;
2566
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2567
- userId: unknown;
2568
- } & {
2569
- fetchOptions?: FetchOptions | undefined;
2570
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2571
- session: {
2572
- id: string;
2573
- createdAt: Date;
2574
- updatedAt: Date;
2575
- userId: string;
2576
- expiresAt: Date;
2577
- token: string;
2578
- ipAddress?: string | null | undefined;
2579
- userAgent?: string | null | undefined;
2580
- };
2581
- user: better_auth_plugins.UserWithRole;
2582
- }, {
2583
- code?: string | undefined;
2584
- message?: string | undefined;
2585
- }, FetchOptions["throw"] extends true ? true : true>>;
2586
- };
2587
- } & {
2588
- admin: {
2589
- stopImpersonating: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2590
- query?: Record<string, any> | undefined;
2591
- fetchOptions?: FetchOptions | undefined;
2592
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2593
- session: {
2594
- id: string;
2595
- createdAt: Date;
2596
- updatedAt: Date;
2597
- userId: string;
2598
- expiresAt: Date;
2599
- token: string;
2600
- ipAddress?: string | null | undefined;
2601
- userAgent?: string | null | undefined;
2602
- } & Record<string, any>;
2603
- user: {
2604
- id: string;
2605
- createdAt: Date;
2606
- updatedAt: Date;
2607
- email: string;
2608
- emailVerified: boolean;
2609
- name: string;
2610
- image?: string | null | undefined;
2611
- } & Record<string, any>;
2612
- }, {
2613
- code?: string | undefined;
2614
- message?: string | undefined;
2615
- }, FetchOptions["throw"] extends true ? true : true>>;
2616
- };
2617
- } & {
2618
- admin: {
2619
- revokeUserSession: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2620
- sessionToken: string;
2621
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2622
- sessionToken: string;
2623
- } & {
2624
- fetchOptions?: FetchOptions | undefined;
2625
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2626
- success: boolean;
2627
- }, {
2628
- code?: string | undefined;
2629
- message?: string | undefined;
2630
- }, FetchOptions["throw"] extends true ? true : true>>;
2631
- };
2632
- } & {
2633
- admin: {
2634
- revokeUserSessions: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2635
- userId: unknown;
2636
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2637
- userId: unknown;
2638
- } & {
2639
- fetchOptions?: FetchOptions | undefined;
2640
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2641
- success: boolean;
2642
- }, {
2643
- code?: string | undefined;
2644
- message?: string | undefined;
2645
- }, FetchOptions["throw"] extends true ? true : true>>;
2646
- };
2647
- } & {
2648
- admin: {
2649
- removeUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2650
- userId: unknown;
2651
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2652
- userId: unknown;
2653
- } & {
2654
- fetchOptions?: FetchOptions | undefined;
2655
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2656
- success: boolean;
2657
- }, {
2658
- code?: string | undefined;
2659
- message?: string | undefined;
2660
- }, FetchOptions["throw"] extends true ? true : true>>;
2661
- };
2662
- } & {
2663
- admin: {
2664
- setUserPassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2665
- newPassword: string;
2666
- userId: unknown;
2667
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2668
- newPassword: string;
2669
- userId: unknown;
2670
- } & {
2671
- fetchOptions?: FetchOptions | undefined;
2672
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2673
- status: boolean;
2674
- }, {
2675
- code?: string | undefined;
2676
- message?: string | undefined;
2677
- }, FetchOptions["throw"] extends true ? true : true>>;
2678
- };
2679
- } & {
2680
- admin: {
2681
- hasPermission: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2682
- permissions: {
2683
- readonly user?: ("update" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "set-password" | "get")[] | undefined;
2684
- readonly session?: ("delete" | "list" | "revoke")[] | undefined;
2685
- };
2686
- } & {
2687
- userId?: string | undefined;
2688
- role?: "admin" | "user" | undefined;
2689
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2690
- permissions: {
2691
- readonly user?: ("update" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "set-password" | "get")[] | undefined;
2692
- readonly session?: ("delete" | "list" | "revoke")[] | undefined;
698
+ declare class RefreshTokenExpiredError extends ApplicationError {
699
+ constructor(options?: ErrorOptions);
700
+ }
701
+ /**
702
+ * Thrown when an authorization flow fails unexpectedly.
703
+ */
704
+ declare class AuthorizationFlowError extends ApplicationError {
705
+ constructor(message: string, options?: ErrorOptions);
706
+ }
707
+ /**
708
+ * Thrown when the authenticated session no longer satisfies the target
709
+ * application's assurance policy.
710
+ *
711
+ * During device-code token exchange this is a final error: the consumed flow
712
+ * cannot be retried and the client must start a new device authorization flow.
713
+ */
714
+ declare class ApplicationSessionAssuranceError extends ApplicationError {
715
+ readonly payload: SessionAssuranceRequiredPayload | null;
716
+ readonly currentAssurance: SessionAssuranceRequiredPayload['currentAssurance'] | null;
717
+ readonly requiredAssurance: SessionAssuranceRequiredPayload['requiredAssurance'] | null;
718
+ readonly validStepUps: SessionAssuranceRequiredPayload['validStepUps'];
719
+ constructor(payload?: SessionAssuranceRequiredPayload | null, options?: ErrorOptions);
720
+ }
721
+ /**
722
+ * Thrown when an operation requires an authenticated user but no session exists.
723
+ */
724
+ declare class UserNotLoggedInError extends ApplicationError {
725
+ constructor(message: string, options?: ErrorOptions);
726
+ }
727
+ /**
728
+ * Thrown during device code polling when the user has not yet authorized the request.
729
+ *
730
+ * The client should continue polling at the specified interval.
731
+ */
732
+ declare class DeviceAuthorizationPendingError extends ApplicationError {
733
+ constructor(options?: ErrorOptions);
734
+ }
735
+ /**
736
+ * Thrown when the client is polling too frequently during the device flow.
737
+ *
738
+ * The client should increase its polling interval before retrying.
739
+ */
740
+ declare class DeviceAuthorizationSlowDownError extends ApplicationError {
741
+ constructor(options?: ErrorOptions);
742
+ }
743
+ /**
744
+ * Thrown when the user explicitly denies the device authorization request.
745
+ */
746
+ declare class DeviceAccessDeniedError extends ApplicationError {
747
+ constructor(options?: ErrorOptions);
748
+ }
749
+ /**
750
+ * Thrown when the device code has expired or has already been consumed.
751
+ *
752
+ * The client must start a new device authorization flow.
753
+ */
754
+ declare class DeviceCodeExpiredError extends ApplicationError {
755
+ constructor(options?: ErrorOptions);
756
+ }
757
+ /**
758
+ * Thrown when the authorization server returns a transient error during the device flow.
759
+ *
760
+ * The token exchange can be safely retried.
761
+ */
762
+ declare class DeviceTransientServerError extends ApplicationError {
763
+ constructor(options?: ErrorOptions);
764
+ }
765
+
766
+ /**
767
+ * Checks whether a session assurance value satisfies an application policy.
768
+ */
769
+ declare function isSessionAssuranceSufficient(sessionAssurance: JWTPayload['assurance'] | null | undefined, config?: ApplicationConfig): boolean;
770
+
771
+ /**
772
+ * Service for managing applications and their candidate organizations.
773
+ *
774
+ * Provides functionality for:
775
+ * - OAuth authorization code flow (PKCE)
776
+ * - Device authorization flow (RFC 8628)
777
+ * - Token management (refresh, exchange)
778
+ * - Organization switching
779
+ */
780
+ declare class ApplicationService {
781
+ private client;
782
+ /**
783
+ * Creates a new ApplicationService instance.
784
+ *
785
+ * @param client - The API client for making application requests
786
+ */
787
+ constructor(client: APIClient);
788
+ /**
789
+ * Gets public display context for an application auth redirect.
790
+ *
791
+ * @param applicationId - The application ID to get public auth context for
792
+ * @returns The minimal application identity safe to show before login
793
+ */
794
+ getApplicationAuthContext(applicationId: string): Promise<ApplicationAuthContextResponse>;
795
+ /**
796
+ * Lists candidate organizations for a specific application.
797
+ *
798
+ * Returns organizations where the authenticated user is a member and
799
+ * the application has been enabled with appropriate entitlement rules.
800
+ *
801
+ * @param applicationId - The application ID to get candidate organizations for
802
+ * @returns The list of candidate organizations
803
+ */
804
+ listCandidateOrganizations(applicationId: string): Promise<ListCandidateOrganizationsResponse>;
805
+ /**
806
+ * Starts an authorization flow for a specific application.
807
+ *
808
+ * @param applicationId - The application ID to start the authorization flow for
809
+ * @param redirectUri - The redirect URI to use for the authorization flow
810
+ * @param codeChallenge - The code challenge to use for the authorization flow
811
+ * @param organizationId - The organization ID to start the authorization flow for
812
+ */
813
+ startAuthorizationFlow(applicationId: string, redirectUri: string, codeChallenge: string, organizationId: string): Promise<StartAuthorizationFlowResponse>;
814
+ /**
815
+ * Starts a device authorization flow (RFC 8628).
816
+ *
817
+ * Returns a device code and user code that the end user must enter
818
+ * on the verification URI to authorize the device.
819
+ *
820
+ * @param requesterApplicationId - The application requesting authorization
821
+ * @param targetApplicationId - The target application to gain access to
822
+ * @returns Device authorization details including codes and verification URI
823
+ */
824
+ startDeviceAuthorizationFlow(requesterApplicationId: string, targetApplicationId: string): Promise<DeviceAuthorizationResponse>;
825
+ /**
826
+ * Retrieves the context for a pending device authorization request.
827
+ *
828
+ * Used by the authorization page to display details about the requesting
829
+ * and target applications before the user approves or denies.
830
+ *
831
+ * @param userCode - The user code from the device authorization response
832
+ * @returns Context including application info, available organizations, and status
833
+ */
834
+ getDeviceAuthorizationContext(userCode: string): Promise<DeviceAuthorizationContextResponse>;
835
+ /**
836
+ * Approves a pending device authorization request.
837
+ *
838
+ * @param userCode - The user code identifying the device authorization request
839
+ * @param organizationId - The organization to authorize the device for
840
+ * @returns Confirmation of the approval action
841
+ */
842
+ approveDeviceAuthorizationFlow(userCode: string, organizationId: string): Promise<DeviceAuthorizationActionResponse>;
843
+ /**
844
+ * Denies a pending device authorization request.
845
+ *
846
+ * @param userCode - The user code identifying the device authorization request
847
+ * @returns Confirmation of the denial action
848
+ */
849
+ denyDeviceAuthorizationFlow(userCode: string): Promise<DeviceAuthorizationActionResponse>;
850
+ /**
851
+ * Exchanges a device code for access and refresh tokens.
852
+ *
853
+ * This should be called by the device client while polling. It will throw
854
+ * typed errors to indicate the polling state (pending, slow down, denied, expired).
855
+ *
856
+ * @param deviceCode - The device code obtained from {@link startDeviceAuthorizationFlow}
857
+ * @returns Access and refresh tokens along with user and organization info
858
+ *
859
+ * @throws {DeviceAuthorizationPendingError} The user hasn't authorized yet — keep polling
860
+ * @throws {DeviceAuthorizationSlowDownError} Polling too fast — increase the interval
861
+ * @throws {DeviceAccessDeniedError} The user denied the request
862
+ * @throws {DeviceCodeExpiredError} The device code has expired
863
+ * @throws {DeviceTransientServerError} Transient server error — safe to retry
864
+ * @throws {ApplicationSessionAssuranceError} Assurance policy changed or is no longer met — start a new flow
865
+ */
866
+ exchangeDeviceCodeForTokens(deviceCode: string): Promise<CompleteAuthorizationFlowResponse>;
867
+ /**
868
+ * Completes an authorization flow for a specific application.
869
+ *
870
+ * @param code - The code to use for the authorization flow
871
+ * @param codeVerifier - The code verifier to use for the authorization flow
872
+ */
873
+ completeAuthorizationFlow(code: string, codeVerifier: string): Promise<CompleteAuthorizationFlowResponse>;
874
+ /**
875
+ * Refreshes an authentication token for a specific application.
876
+ *
877
+ * @param refreshToken - The refresh token to use for the authentication token refresh
878
+ * @throws {RefreshTokenExpiredError} When the refresh token has expired or is invalid
879
+ * @throws {ApplicationError} For other API errors
880
+ */
881
+ refreshAccessToken(refreshToken: string): Promise<CompleteAuthorizationFlowResponse | null>;
882
+ /**
883
+ * Gets the current user and organization for a specific application.
884
+ *
885
+ * By default, the returned organization does not include its `members`,
886
+ * `teams`, or `invitations` collections. Pass `options.include` to request
887
+ * any of them explicitly.
888
+ *
889
+ * @param accessToken - The access token to use for the who am I request
890
+ * @param options - Optional include list controlling which relations are loaded
891
+ * @returns The current user and organization
892
+ */
893
+ whoAmI(accessToken: string, options?: WhoAmIOptions): Promise<WhoAmIResponse>;
894
+ /**
895
+ * Switches the active organization for the authenticated user.
896
+ *
897
+ * Issues new access and refresh tokens scoped to the specified organization.
898
+ * The target organization must be entitled to the application and the entitlement's
899
+ * access rules must allow the current user.
900
+ *
901
+ * @param organizationId - The ID of the organization to switch to
902
+ * @param accessToken - Optional access token for authentication (uses cookie if not provided)
903
+ * @returns New authentication tokens and user/organization details
904
+ */
905
+ switchOrganization(organizationId: string, accessToken: string): Promise<CompleteAuthorizationFlowResponse>;
906
+ /**
907
+ * Logs out the user by invalidating their refresh token.
908
+ *
909
+ * Revokes the refresh token on the server, preventing further token refreshes
910
+ * and effectively ending the user's session.
911
+ *
912
+ * @param refreshToken - The refresh token to invalidate
913
+ */
914
+ logout(refreshToken: string): Promise<void>;
915
+ }
916
+
917
+ declare const ApiKeyMetadata: z.ZodObject<{
918
+ user: z.ZodObject<{
919
+ id: z.ZodString;
920
+ email: z.ZodString;
921
+ }, z.core.$strip>;
922
+ workspace: z.ZodObject<{
923
+ id: z.ZodString;
924
+ title: z.ZodString;
925
+ }, z.core.$strip>;
926
+ application: z.ZodNullable<z.ZodOptional<z.ZodObject<{
927
+ id: z.ZodString;
928
+ name: z.ZodString;
929
+ }, z.core.$strip>>>;
930
+ }, z.core.$strip>;
931
+ /**
932
+ * Metadata attached to an API key, identifying the owning user and workspace.
933
+ */
934
+ type ApiKeyMetadata = z.infer<typeof ApiKeyMetadata> & Record<string, unknown>;
935
+ /**
936
+ * A full API key including the secret key value.
937
+ *
938
+ * The secret `key` field is only returned once at creation time.
939
+ */
940
+ type ApiKey = Omit<ApiKey$1, 'metadata' | 'name'> & {
941
+ /** Display name of the API key. */
942
+ name: string;
943
+ /** Metadata identifying the key's owner and workspace. */
944
+ metadata: ApiKeyMetadata;
945
+ };
946
+ /**
947
+ * An API key with the secret key value omitted.
948
+ *
949
+ * Used in list and get operations where the secret should not be exposed.
950
+ */
951
+ type ApiKeyWithoutSecret = Omit<ApiKey, 'key'>;
952
+ /**
953
+ * Payload for creating a new API key.
954
+ */
955
+ type CreateApiKeyPayload = {
956
+ /** Display name for the API key. */
957
+ name: string;
958
+ /** Time in milliseconds until the key expires. Omit for a non-expiring key. */
959
+ expiresIn?: number;
960
+ /** Optional prefix prepended to the generated key for identification. */
961
+ prefix?: string;
962
+ /** Optional metadata to attach to the key. */
963
+ metadata?: ApiKeyMetadata;
964
+ };
965
+ /**
966
+ * Payload for updating an existing API key.
967
+ */
968
+ type UpdateApiKeyPayload = {
969
+ /** The ID of the API key to update. */
970
+ id: string;
971
+ /** The new display name for the API key. */
972
+ name: string;
973
+ };
974
+
975
+ /**
976
+ * Removes index signatures from a type
977
+ * @template T - The type to remove index signatures from
978
+ * @example
979
+ * ```typescript
980
+ * type MyType = {
981
+ * foo: string
982
+ * bar: number
983
+ * [key: string]: any
984
+ * }
985
+ *
986
+ * type StrictMyType = Strict<MyType> // { foo: string; bar: number; }
987
+ * ```
988
+ */
989
+ type Strict<T> = {
990
+ [K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];
991
+ };
992
+ /**
993
+ * Creates a configured Better Auth API client with all required plugins.
994
+ *
995
+ * @param apiUrl - The base URL of the authentication API
996
+ * @param fetchOptions - Custom fetch options to include in all API requests
997
+ * @returns A fully-configured Better Auth client instance
998
+ *
999
+ * @internal
1000
+ */
1001
+ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOption): {
1002
+ useActiveOrganization: better_auth_client.AuthQueryAtom<better_auth.Prettify<{
1003
+ id: string;
1004
+ name: string;
1005
+ slug: string;
1006
+ createdAt: Date;
1007
+ logo?: string | null | undefined | undefined;
1008
+ metadata?: any;
1009
+ } & {
1010
+ members: {
1011
+ id: string;
1012
+ organizationId: string;
1013
+ role: "org:admin" | "org:member" | "org:reviewer";
1014
+ createdAt: Date;
1015
+ userId: string;
1016
+ teamId?: string | undefined | undefined;
1017
+ user: {
1018
+ id: string;
1019
+ email: string;
1020
+ name: string;
1021
+ image?: string | undefined;
2693
1022
  };
2694
- } & {
2695
- userId?: string | undefined;
2696
- role?: "admin" | "user" | undefined;
2697
- } & {
2698
- fetchOptions?: FetchOptions | undefined;
2699
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2700
- error: null;
2701
- success: boolean;
2702
- }, {
2703
- code?: string | undefined;
2704
- message?: string | undefined;
2705
- }, FetchOptions["throw"] extends true ? true : true>>;
2706
- };
1023
+ }[];
1024
+ invitations: {
1025
+ id: string;
1026
+ organizationId: string;
1027
+ email: string;
1028
+ role: "org:admin" | "org:member" | "org:reviewer";
1029
+ status: better_auth_plugins.InvitationStatus;
1030
+ inviterId: string;
1031
+ expiresAt: Date;
1032
+ createdAt: Date;
1033
+ teamId?: string | undefined | undefined;
1034
+ }[];
1035
+ }>>;
1036
+ useListOrganizations: better_auth_client.AuthQueryAtom<{
1037
+ id: string;
1038
+ name: string;
1039
+ slug: string;
1040
+ createdAt: Date;
1041
+ logo?: string | null | undefined | undefined;
1042
+ metadata?: any;
1043
+ }[]>;
1044
+ useActiveMember: better_auth_client.AuthQueryAtom<{
1045
+ id: string;
1046
+ organizationId: string;
1047
+ userId: string;
1048
+ role: string;
1049
+ createdAt: Date;
1050
+ }>;
1051
+ useActiveMemberRole: better_auth_client.AuthQueryAtom<{
1052
+ role: string;
1053
+ }>;
2707
1054
  } & {
2708
1055
  signIn: {
2709
1056
  social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2710
- 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";
1057
+ provider: (string & {}) | "google" | "microsoft" | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel";
2711
1058
  callbackURL?: string | undefined;
2712
1059
  newUserCallbackURL?: string | undefined;
2713
1060
  errorCallbackURL?: string | undefined;
@@ -2724,7 +1071,7 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
2724
1071
  loginHint?: string | undefined;
2725
1072
  additionalData?: Record<string, any> | undefined;
2726
1073
  }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2727
- 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";
1074
+ provider: (string & {}) | "google" | "microsoft" | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel";
2728
1075
  callbackURL?: string | undefined;
2729
1076
  newUserCallbackURL?: string | undefined;
2730
1077
  errorCallbackURL?: string | undefined;
@@ -3518,6 +1865,84 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
3518
1865
  error: null;
3519
1866
  }>;
3520
1867
  };
1868
+ } & {
1869
+ sessionAssurance: {
1870
+ getSessionAssurance: () => Promise<{
1871
+ data: null;
1872
+ error: {
1873
+ message?: string | undefined;
1874
+ status: number;
1875
+ statusText: string;
1876
+ };
1877
+ } | {
1878
+ data: unknown;
1879
+ error: null;
1880
+ }>;
1881
+ stepUpWithPassword: (body: {
1882
+ password: string;
1883
+ }) => Promise<{
1884
+ data: null;
1885
+ error: {
1886
+ message?: string | undefined;
1887
+ status: number;
1888
+ statusText: string;
1889
+ };
1890
+ } | {
1891
+ data: unknown;
1892
+ error: null;
1893
+ }>;
1894
+ sendOtp: () => Promise<{
1895
+ data: null;
1896
+ error: {
1897
+ message?: string | undefined;
1898
+ status: number;
1899
+ statusText: string;
1900
+ };
1901
+ } | {
1902
+ data: unknown;
1903
+ error: null;
1904
+ }>;
1905
+ verifyOtp: (body: {
1906
+ otp: string;
1907
+ }) => Promise<{
1908
+ data: null;
1909
+ error: {
1910
+ message?: string | undefined;
1911
+ status: number;
1912
+ statusText: string;
1913
+ };
1914
+ } | {
1915
+ data: unknown;
1916
+ error: null;
1917
+ }>;
1918
+ beginOAuthStepUp: (body: {
1919
+ provider: OAuthStepUpProvider;
1920
+ returnUrl?: string;
1921
+ }) => Promise<{
1922
+ data: null;
1923
+ error: {
1924
+ message?: string | undefined;
1925
+ status: number;
1926
+ statusText: string;
1927
+ };
1928
+ } | {
1929
+ data: unknown;
1930
+ error: null;
1931
+ }>;
1932
+ completeOAuthStepUp: (body: {
1933
+ stepUpToken: string;
1934
+ }) => Promise<{
1935
+ data: null;
1936
+ error: {
1937
+ message?: string | undefined;
1938
+ status: number;
1939
+ statusText: string;
1940
+ };
1941
+ } | {
1942
+ data: unknown;
1943
+ error: null;
1944
+ }>;
1945
+ };
3521
1946
  } & {
3522
1947
  $Infer: {
3523
1948
  ActiveOrganization: {
@@ -3741,7 +2166,7 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
3741
2166
  body?: any;
3742
2167
  query?: any;
3743
2168
  params?: any;
3744
- duplex?: "full" | "half" | undefined;
2169
+ duplex? /** Number of hours to retain data before automatic cleanup. */: "full" | "half" | undefined;
3745
2170
  jsonParser: (text: string) => Promise<any> | any;
3746
2171
  retry?: better_auth_client.RetryOptions | undefined;
3747
2172
  retryAttempt?: number | undefined;
@@ -4266,6 +2691,18 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
4266
2691
  readonly code: "INVALID_ROLE_TYPE";
4267
2692
  message: string;
4268
2693
  };
2694
+ OTP_EXPIRED: {
2695
+ readonly code: "OTP_EXPIRED";
2696
+ message: string;
2697
+ };
2698
+ INVALID_OTP: {
2699
+ readonly code: "INVALID_OTP";
2700
+ message: string;
2701
+ };
2702
+ TOO_MANY_ATTEMPTS: {
2703
+ readonly code: "TOO_MANY_ATTEMPTS";
2704
+ message: string;
2705
+ };
4269
2706
  USER_NOT_FOUND: {
4270
2707
  readonly code: "USER_NOT_FOUND";
4271
2708
  message: string;
@@ -4469,408 +2906,380 @@ type Member = Strict<APIClient['$Infer']['Member']>;
4469
2906
  /**
4470
2907
  * Custom settings that can be applied to an organization.
4471
2908
  */
2909
+ type BillingMode = 'credits' | 'plan';
4472
2910
  type OrganizationSettings = {
4473
- /** Whether file storage is disabled for this organization. */
4474
- disableStorage?: boolean;
4475
- /** Number of hours to retain data before automatic cleanup. */
4476
- dataRetentionHours?: number;
4477
- };
4478
- /**
4479
- * An organization with optional custom settings.
4480
- */
4481
- type ExtendedOrganization = BaseOrganization & {
4482
- settings?: OrganizationSettings;
4483
- };
4484
- /**
4485
- * A complete organization object including its members, invitations, and teams.
4486
- */
4487
- type FullOrganization = ExtendedOrganization & {
4488
- members: Member[];
4489
- invitations: Invitation[];
4490
- teams: Team[];
4491
- };
4492
- /**
4493
- * An organization as returned by the "who am I" endpoint, where related
4494
- * collections (`members`, `teams`, `invitations`) are optional and only
4495
- * populated when explicitly requested via the `include` query parameter.
4496
- */
4497
- type WhoAmIOrganization = Omit<FullOrganization, 'members' | 'invitations' | 'teams'> & {
4498
- members?: Member[];
4499
- invitations?: Invitation[];
4500
- teams?: Team[];
4501
- };
4502
- /**
4503
- * A record linking a user to a team.
4504
- */
4505
- type TeamMember = {
4506
- /** Unique identifier for this team membership. */
4507
- id: string;
4508
- /** The team this membership belongs to. */
4509
- teamId: string;
4510
- /** The user who is a member of the team. */
4511
- userId: string;
4512
- /** When the user was added to the team. */
4513
- createdAt: Date;
4514
- };
4515
-
4516
- /**
4517
- * Keys of the organization's related collections that can be optionally
4518
- * included in the "who am I" response.
4519
- */
4520
- type WhoAmIInclude = 'members' | 'teams' | 'invitations';
4521
- /**
4522
- * Represents a registered OAuth application.
4523
- */
4524
- type Application = {
4525
- /** Unique application identifier. */
4526
- id: string;
4527
- /** Display name of the application. */
4528
- name: string;
4529
- /** Human-readable description of the application. */
4530
- description: string;
4531
- /** Allowed OAuth redirect URIs for this application. */
4532
- redirectUris: string[];
4533
- };
4534
- /**
4535
- * Response returned when listing candidate organizations for an application.
4536
- */
4537
- type ListCandidateOrganizationsResponse = FullOrganization[];
4538
- /**
4539
- * Public application context used to preserve continuity during auth redirects.
4540
- */
4541
- type ApplicationAuthContextResponse = {
4542
- /** Minimal application identity shown in the hosted auth flow. */
4543
- application: Pick<Application, 'id' | 'name'>;
4544
- };
4545
- /**
4546
- * Response returned when starting an authorization flow.
4547
- */
4548
- type StartAuthorizationFlowResponse = {
4549
- /** The authorization code to exchange for tokens. */
4550
- code: string;
4551
- };
4552
- /**
4553
- * Response returned when completing an authorization flow or refreshing tokens.
4554
- */
4555
- type CompleteAuthorizationFlowResponse = {
4556
- /** Short-lived JWT access token. */
4557
- accessToken: string;
4558
- /** Long-lived refresh token for obtaining new access tokens. */
4559
- refreshToken: string;
4560
- /** The authenticated user. */
4561
- user: User;
4562
- /** The organization the tokens are scoped to. */
4563
- organization: FullOrganization;
2911
+ /** Whether file storage is disabled for this organization. */
2912
+ disableStorage?: boolean;
2913
+ /** Number of hours to retain data before automatic cleanup. */
2914
+ dataRetentionHours?: number;
2915
+ /** How the organization is billed for usage. */
2916
+ billing?: {
2917
+ mode: BillingMode;
2918
+ cvp?: number;
2919
+ limits?: {
2920
+ enabled: boolean;
2921
+ soft_usd?: number;
2922
+ hard_usd?: number;
2923
+ soft_credits?: number;
2924
+ hard_credits?: number;
2925
+ period: 'monthly';
2926
+ notify_emails?: string[];
2927
+ };
2928
+ };
4564
2929
  };
4565
2930
  /**
4566
- * Response returned by the "who am I" endpoint.
4567
- *
4568
- * By default, the `organization` only contains the base organization fields.
4569
- * The `members`, `teams`, and `invitations` collections are only populated
4570
- * when explicitly requested via the `include` query parameter.
2931
+ * An organization with optional custom settings.
4571
2932
  */
4572
- type WhoAmIResponse = {
4573
- /** The authenticated user. */
4574
- user: User;
4575
- /** The user's active organization. */
4576
- organization: WhoAmIOrganization;
2933
+ type ExtendedOrganization = BaseOrganization & {
2934
+ settings?: OrganizationSettings;
4577
2935
  };
4578
2936
  /**
4579
- * Options accepted by the "who am I" client method.
2937
+ * A complete organization object including its members, invitations, and teams.
4580
2938
  */
4581
- type WhoAmIOptions = {
4582
- /**
4583
- * Collections to include in the returned organization. When omitted or
4584
- * empty, only the base organization fields are returned.
4585
- */
4586
- include?: WhoAmIInclude[];
2939
+ type FullOrganization = ExtendedOrganization & {
2940
+ members: Member[];
2941
+ invitations: Invitation[];
2942
+ teams: Team[];
4587
2943
  };
4588
2944
  /**
4589
- * Response returned when starting a device authorization flow (RFC 8628).
2945
+ * An organization as returned by the "who am I" endpoint, where related
2946
+ * collections (`members`, `teams`, `invitations`) are optional and only
2947
+ * populated when explicitly requested via the `include` query parameter.
4590
2948
  */
4591
- type DeviceAuthorizationResponse = {
4592
- /** The device verification code for polling. */
4593
- device_code: string;
4594
- /** The user-facing code to enter on the verification page. */
4595
- user_code: string;
4596
- /** The URI the user should visit to authorize the device. */
4597
- verification_uri: string;
4598
- /** A complete URI including the user code for convenience. */
4599
- verification_uri_complete: string;
4600
- /** Number of seconds until the device code expires. */
4601
- expires_in: number;
4602
- /** Minimum polling interval in seconds. */
4603
- interval: number;
2949
+ type WhoAmIOrganization = Omit<FullOrganization, 'members' | 'invitations' | 'teams'> & {
2950
+ members?: Member[];
2951
+ invitations?: Invitation[];
2952
+ teams?: Team[];
4604
2953
  };
4605
2954
  /**
4606
- * Minimal application info shown in device authorization context.
4607
- *
4608
- * @internal
2955
+ * A record linking a user to a team.
4609
2956
  */
4610
- type DeviceContextApplication = {
4611
- /** Unique application identifier. */
2957
+ type TeamMember = {
2958
+ /** Unique identifier for this team membership. */
4612
2959
  id: string;
4613
- /** Display name of the application. */
4614
- name: string;
4615
- /** Human-readable description, or `null` if not set. */
4616
- description: string | null;
2960
+ /** The team this membership belongs to. */
2961
+ teamId: string;
2962
+ /** The user who is a member of the team. */
2963
+ userId: string;
2964
+ /** When the user was added to the team. */
2965
+ createdAt: Date;
4617
2966
  };
2967
+
4618
2968
  /**
4619
- * Context information for a pending device authorization request.
2969
+ * Options accepted when listing users through the Better Auth admin plugin.
4620
2970
  */
4621
- type DeviceAuthorizationContextResponse = {
4622
- /** The application that initiated the device flow, with verification status. */
4623
- requester: DeviceContextApplication & {
4624
- isVerified: boolean;
4625
- };
4626
- /** The target application the requester wants access to. */
4627
- target: DeviceContextApplication;
4628
- /** Organizations the user can authorize the device for. */
4629
- organizations: FullOrganization[];
4630
- /** Organization pre-selected by the requester, if any. */
4631
- preselectedOrganizationId: string | null;
4632
- /** Current status of the device authorization request. */
4633
- status: 'pending' | 'approved' | 'denied';
4634
- /** Seconds remaining before the device code expires. */
4635
- expiresIn: number;
2971
+ type ListAdminUsersOptions = {
2972
+ /** Maximum number of users to return. */
2973
+ limit?: number;
2974
+ /** Number of users to skip. */
2975
+ offset?: number;
2976
+ /** Free-text search value. */
2977
+ searchValue?: string;
2978
+ /** User field searched by Better Auth. Defaults to email. */
2979
+ searchField?: 'email' | 'name';
2980
+ /** Search comparison operator. Defaults to contains. */
2981
+ searchOperator?: 'contains' | 'starts_with' | 'ends_with';
2982
+ /** Field used to sort the listing. */
2983
+ sortBy?: string;
2984
+ /** Sort direction. */
2985
+ sortDirection?: 'asc' | 'desc';
2986
+ /** User field filtered by Better Auth. Defaults to email. */
2987
+ filterField?: string;
2988
+ /** Filter value. */
2989
+ filterValue?: string | number | boolean | string[] | number[];
2990
+ /** Filter comparison operator. Defaults to eq. */
2991
+ filterOperator?: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'not_in' | 'contains' | 'starts_with' | 'ends_with';
4636
2992
  };
4637
2993
  /**
4638
- * Response returned when approving or denying a device authorization request.
2994
+ * Options accepted when listing all organizations as a global admin.
4639
2995
  */
4640
- type DeviceAuthorizationActionResponse = {
4641
- /** Whether the action was performed successfully. */
4642
- success: boolean;
2996
+ type ListAdminOrganizationsOptions = {
2997
+ /** Maximum number of organizations to return. Defaults to 50. */
2998
+ limit?: number;
2999
+ /** Number of organizations to skip. Defaults to 0. */
3000
+ offset?: number;
3001
+ /** Column used to order the listing. Defaults to creation date. */
3002
+ sortBy?: 'createdAt' | 'title';
3003
+ /** Order direction. Defaults to descending. */
3004
+ sortDirection?: 'asc' | 'desc';
3005
+ /** Free-text search matched against organization name, slug, and ID. */
3006
+ query?: string;
3007
+ /**
3008
+ * Number of member previews to include per organization (max 10).
3009
+ * When greater than 0, each row also includes the total member count.
3010
+ * Defaults to 0 (no members or member count returned).
3011
+ */
3012
+ membersPreview?: number;
3013
+ /**
3014
+ * Number of application previews to include per organization (max 10).
3015
+ * When greater than 0, each row also includes the total application count.
3016
+ * Defaults to 0 (no applications or application count returned).
3017
+ */
3018
+ applicationsPreview?: number;
4643
3019
  };
4644
-
4645
3020
  /**
4646
- * Base error class for all SDK errors.
4647
- *
4648
- * Extends the native `Error` with a machine-readable `code` property
4649
- * that can be used for programmatic error handling.
3021
+ * Options accepted when fetching a single organization as a global admin.
4650
3022
  */
4651
- declare class BaseError extends Error {
4652
- /** Machine-readable error code (e.g. `"INVALID_SOCIAL_PROVIDER"`). */
4653
- code: string;
3023
+ type GetAdminOrganizationOptions = {
3024
+ /** ID of the organization to fetch. */
3025
+ organizationId: string;
3026
+ /** Column the listing adjacency is computed against. Defaults to creation date. */
3027
+ sortBy?: 'createdAt' | 'title';
3028
+ /** Order direction the listing adjacency is computed against. Defaults to descending. */
3029
+ sortDirection?: 'asc' | 'desc';
4654
3030
  /**
4655
- * @param code - A machine-readable error code
4656
- * @param message - A human-readable error message
4657
- * @param options - Standard `ErrorOptions` (e.g. `cause`)
3031
+ * When true, the organization includes adjacent IDs in the listing
3032
+ * defined by the ordering options.
4658
3033
  */
4659
- constructor(code: string, message: string, options?: ErrorOptions);
4660
- }
4661
-
3034
+ includeAdjacent?: boolean;
3035
+ };
4662
3036
  /**
4663
- * Generic error thrown by the `ApplicationService`.
4664
- *
4665
- * All application-specific errors extend this class, so you can catch
4666
- * `ApplicationError` to handle any application-related failure.
3037
+ * Options accepted when listing members for a single organization as a global admin.
4667
3038
  */
4668
- declare class ApplicationError extends BaseError {
4669
- constructor(message: string, options?: ErrorOptions);
4670
- }
3039
+ type ListAdminOrganizationMembersOptions = {
3040
+ /** ID of the organization whose members should be listed. */
3041
+ organizationId: string;
3042
+ /** Maximum number of members to return. Defaults to 50. */
3043
+ limit?: number;
3044
+ /** Number of members to skip. Defaults to 0. */
3045
+ offset?: number;
3046
+ };
4671
3047
  /**
4672
- * Thrown when a refresh token has expired or been revoked.
4673
- *
4674
- * The client should discard its stored tokens and prompt the user
4675
- * to re-authenticate.
3048
+ * Options accepted when creating an organization as a global admin.
4676
3049
  */
4677
- declare class RefreshTokenExpiredError extends ApplicationError {
4678
- constructor(options?: ErrorOptions);
4679
- }
3050
+ type CreateAdminOrganizationOptions = {
3051
+ /** Optional organization ID. Generated by the API when omitted. */
3052
+ id?: string;
3053
+ /** Display name of the organization. */
3054
+ name: string;
3055
+ /** URL-friendly identifier. Generated from the name when omitted. */
3056
+ slug?: string;
3057
+ /** Logo URL. */
3058
+ logo?: string;
3059
+ /** Opaque metadata stored with the organization. */
3060
+ metadata?: string;
3061
+ /** Custom organization settings. */
3062
+ settings?: OrganizationSettings;
3063
+ };
4680
3064
  /**
4681
- * Thrown when an authorization flow fails unexpectedly.
4682
- */
4683
- declare class AuthorizationFlowError extends ApplicationError {
4684
- constructor(message: string, options?: ErrorOptions);
4685
- }
3065
+ * Options accepted when updating an organization as a global admin.
3066
+ */
3067
+ type UpdateAdminOrganizationOptions = {
3068
+ /** ID of the organization to update. */
3069
+ organizationId: string;
3070
+ /** Display name of the organization. */
3071
+ name?: string;
3072
+ /** URL-friendly identifier. */
3073
+ slug?: string;
3074
+ /** Logo URL. */
3075
+ logo?: string;
3076
+ /** Opaque metadata stored with the organization. */
3077
+ metadata?: string;
3078
+ /** Custom organization settings. Replaces the stored settings object. */
3079
+ settings?: OrganizationSettings;
3080
+ };
4686
3081
  /**
4687
- * Thrown when an operation requires an authenticated user but no session exists.
3082
+ * User row returned by the Better Auth admin user listing endpoint.
4688
3083
  */
4689
- declare class UserNotLoggedInError extends ApplicationError {
4690
- constructor(message: string, options?: ErrorOptions);
4691
- }
3084
+ type AdminUser = {
3085
+ id: string;
3086
+ name: string;
3087
+ email: string;
3088
+ emailVerified: boolean;
3089
+ image: string | null;
3090
+ createdAt: string | Date;
3091
+ updatedAt: string | Date;
3092
+ role: string | null;
3093
+ banned: boolean | null;
3094
+ banReason: string | null;
3095
+ banExpires: string | Date | null;
3096
+ lastActiveAt?: string | Date | null;
3097
+ twoFactorEnabled?: boolean | null;
3098
+ };
4692
3099
  /**
4693
- * Thrown during device code polling when the user has not yet authorized the request.
4694
- *
4695
- * The client should continue polling at the specified interval.
3100
+ * Paginated Better Auth admin user listing response.
4696
3101
  */
4697
- declare class DeviceAuthorizationPendingError extends ApplicationError {
4698
- constructor(options?: ErrorOptions);
4699
- }
3102
+ type ListAdminUsersResult = {
3103
+ users: AdminUser[];
3104
+ total: number;
3105
+ limit?: number;
3106
+ offset?: number;
3107
+ };
4700
3108
  /**
4701
- * Thrown when the client is polling too frequently during the device flow.
4702
- *
4703
- * The client should increase its polling interval before retrying.
3109
+ * Member preview returned alongside each admin organization row.
4704
3110
  */
4705
- declare class DeviceAuthorizationSlowDownError extends ApplicationError {
4706
- constructor(options?: ErrorOptions);
4707
- }
3111
+ type AdminOrganizationMember = {
3112
+ id: string;
3113
+ name: string;
3114
+ email: string;
3115
+ image: string | null;
3116
+ };
4708
3117
  /**
4709
- * Thrown when the user explicitly denies the device authorization request.
3118
+ * Full organization member row returned by the admin organization member listing endpoint.
4710
3119
  */
4711
- declare class DeviceAccessDeniedError extends ApplicationError {
4712
- constructor(options?: ErrorOptions);
4713
- }
3120
+ type AdminOrganizationMemberRecord = AdminOrganizationMember & {
3121
+ memberId: string;
3122
+ organizationId: string;
3123
+ role: string;
3124
+ createdAt: string;
3125
+ };
4714
3126
  /**
4715
- * Thrown when the device code has expired or has already been consumed.
4716
- *
4717
- * The client must start a new device authorization flow.
3127
+ * Paginated organization member listing response.
4718
3128
  */
4719
- declare class DeviceCodeExpiredError extends ApplicationError {
4720
- constructor(options?: ErrorOptions);
4721
- }
3129
+ type ListAdminOrganizationMembersResult = {
3130
+ members: AdminOrganizationMemberRecord[];
3131
+ total: number;
3132
+ limit: number;
3133
+ offset: number;
3134
+ };
4722
3135
  /**
4723
- * Thrown when the authorization server returns a transient error during the device flow.
4724
- *
4725
- * The token exchange can be safely retried.
3136
+ * Application preview returned alongside each admin organization row.
4726
3137
  */
4727
- declare class DeviceTransientServerError extends ApplicationError {
4728
- constructor(options?: ErrorOptions);
4729
- }
4730
-
3138
+ type AdminOrganizationApplication = {
3139
+ id: string;
3140
+ name: string;
3141
+ imageUrl: string | null;
3142
+ createdAt: string;
3143
+ };
4731
3144
  /**
4732
- * Service for managing applications and their candidate organizations.
4733
- *
4734
- * Provides functionality for:
4735
- * - OAuth authorization code flow (PKCE)
4736
- * - Device authorization flow (RFC 8628)
4737
- * - Token management (refresh, exchange)
4738
- * - Organization switching
3145
+ * Organization row returned by the admin organization listing endpoint.
4739
3146
  */
4740
- declare class ApplicationService {
4741
- private client;
4742
- /**
4743
- * Creates a new ApplicationService instance.
4744
- *
4745
- * @param client - The API client for making application requests
4746
- */
4747
- constructor(client: APIClient);
4748
- /**
4749
- * Gets public display context for an application auth redirect.
4750
- *
4751
- * @param applicationId - The application ID to get public auth context for
4752
- * @returns The minimal application identity safe to show before login
4753
- */
4754
- getApplicationAuthContext(applicationId: string): Promise<ApplicationAuthContextResponse>;
4755
- /**
4756
- * Lists candidate organizations for a specific application.
4757
- *
4758
- * Returns organizations where the authenticated user is a member and
4759
- * the application has been enabled with appropriate entitlement rules.
4760
- *
4761
- * @param applicationId - The application ID to get candidate organizations for
4762
- * @returns The list of candidate organizations
4763
- */
4764
- listCandidateOrganizations(applicationId: string): Promise<ListCandidateOrganizationsResponse>;
4765
- /**
4766
- * Starts an authorization flow for a specific application.
4767
- *
4768
- * @param applicationId - The application ID to start the authorization flow for
4769
- * @param redirectUri - The redirect URI to use for the authorization flow
4770
- * @param codeChallenge - The code challenge to use for the authorization flow
4771
- * @param organizationId - The organization ID to start the authorization flow for
4772
- */
4773
- startAuthorizationFlow(applicationId: string, redirectUri: string, codeChallenge: string, organizationId: string): Promise<StartAuthorizationFlowResponse>;
4774
- /**
4775
- * Starts a device authorization flow (RFC 8628).
4776
- *
4777
- * Returns a device code and user code that the end user must enter
4778
- * on the verification URI to authorize the device.
4779
- *
4780
- * @param requesterApplicationId - The application requesting authorization
4781
- * @param targetApplicationId - The target application to gain access to
4782
- * @returns Device authorization details including codes and verification URI
4783
- */
4784
- startDeviceAuthorizationFlow(requesterApplicationId: string, targetApplicationId: string): Promise<DeviceAuthorizationResponse>;
3147
+ type AdminOrganization = {
3148
+ id: string;
3149
+ name: string;
3150
+ slug: string;
3151
+ logo: string | null;
3152
+ createdAt: string;
3153
+ metadata: string | null;
3154
+ settings: OrganizationSettings | null;
3155
+ /** Total number of active members. Present when requested via membersPreview. */
3156
+ memberCount?: number;
3157
+ /** Preview of the first members. Present when requested via membersPreview. */
3158
+ members?: AdminOrganizationMember[];
3159
+ /** Total number of enabled applications. Present when requested via applicationsPreview. */
3160
+ applicationCount?: number;
3161
+ /** Preview of the first enabled applications. Present when requested via applicationsPreview. */
3162
+ applications?: AdminOrganizationApplication[];
4785
3163
  /**
4786
- * Retrieves the context for a pending device authorization request.
4787
- *
4788
- * Used by the authorization page to display details about the requesting
4789
- * and target applications before the user approves or denies.
4790
- *
4791
- * @param userCode - The user code from the device authorization response
4792
- * @returns Context including application info, available organizations, and status
3164
+ * Adjacent organization IDs in the listing defined by the ordering options.
3165
+ * Present when requested via includeAdjacent.
4793
3166
  */
4794
- getDeviceAuthorizationContext(userCode: string): Promise<DeviceAuthorizationContextResponse>;
3167
+ adjacent?: {
3168
+ previous: string | null;
3169
+ next: string | null;
3170
+ /** 1-based position in the listing. */
3171
+ index: number;
3172
+ total: number;
3173
+ };
3174
+ };
3175
+ /**
3176
+ * Paginated admin organization listing response.
3177
+ */
3178
+ type ListAdminOrganizationsResult = {
3179
+ organizations: AdminOrganization[];
3180
+ total: number;
3181
+ limit: number;
3182
+ offset: number;
3183
+ };
3184
+
3185
+ /**
3186
+ * Service for global admin operations.
3187
+ *
3188
+ * All endpoints require the authenticated user to hold the global admin role.
3189
+ */
3190
+ declare class AdminService {
3191
+ private client;
4795
3192
  /**
4796
- * Approves a pending device authorization request.
3193
+ * Creates a new AdminService instance.
4797
3194
  *
4798
- * @param userCode - The user code identifying the device authorization request
4799
- * @param organizationId - The organization to authorize the device for
4800
- * @returns Confirmation of the approval action
3195
+ * @param client - The API client for making admin requests
4801
3196
  */
4802
- approveDeviceAuthorizationFlow(userCode: string, organizationId: string): Promise<DeviceAuthorizationActionResponse>;
3197
+ constructor(client: APIClient);
4803
3198
  /**
4804
- * Denies a pending device authorization request.
3199
+ * Lists all organizations, optionally with member and application previews
3200
+ * and totals when a preview size is requested.
4805
3201
  *
4806
- * @param userCode - The user code identifying the device authorization request
4807
- * @returns Confirmation of the denial action
3202
+ * @param options - Pagination, ordering, search, and preview options
3203
+ * @returns The paginated organization listing
4808
3204
  */
4809
- denyDeviceAuthorizationFlow(userCode: string): Promise<DeviceAuthorizationActionResponse>;
3205
+ listOrganizations(options?: ListAdminOrganizationsOptions): Promise<{
3206
+ data: null;
3207
+ error: {
3208
+ message?: string | undefined;
3209
+ status: number;
3210
+ statusText: string;
3211
+ };
3212
+ } | {
3213
+ data: ListAdminOrganizationsResult;
3214
+ error: null;
3215
+ }>;
4810
3216
  /**
4811
- * Exchanges a device code for access and refresh tokens.
4812
- *
4813
- * This should be called by the device client while polling. It will throw
4814
- * typed errors to indicate the polling state (pending, slow down, denied, expired).
3217
+ * Lists all Better Auth users from the user table.
4815
3218
  *
4816
- * @param deviceCode - The device code obtained from {@link startDeviceAuthorizationFlow}
4817
- * @returns Access and refresh tokens along with user and organization info
4818
- *
4819
- * @throws {DeviceAuthorizationPendingError} The user hasn't authorized yet — keep polling
4820
- * @throws {DeviceAuthorizationSlowDownError} Polling too fast — increase the interval
4821
- * @throws {DeviceAccessDeniedError} The user denied the request
4822
- * @throws {DeviceCodeExpiredError} The device code has expired
4823
- * @throws {DeviceTransientServerError} Transient server error — safe to retry
3219
+ * @param options - Pagination, search, filter, and ordering options
3220
+ * @returns The paginated user listing
4824
3221
  */
4825
- exchangeDeviceCodeForTokens(deviceCode: string): Promise<CompleteAuthorizationFlowResponse>;
3222
+ listUsers(options?: ListAdminUsersOptions): Promise<{
3223
+ data: null;
3224
+ error: {
3225
+ message?: string | undefined;
3226
+ status: number;
3227
+ statusText: string;
3228
+ };
3229
+ } | {
3230
+ data: ListAdminUsersResult;
3231
+ error: null;
3232
+ }>;
4826
3233
  /**
4827
- * Completes an authorization flow for a specific application.
3234
+ * Fetches a single organization, optionally with adjacent IDs in
3235
+ * the listing defined by the ordering options.
4828
3236
  *
4829
- * @param code - The code to use for the authorization flow
4830
- * @param codeVerifier - The code verifier to use for the authorization flow
3237
+ * @param options - Organization ID and listing adjacency options
3238
+ * @returns The organization
4831
3239
  */
4832
- completeAuthorizationFlow(code: string, codeVerifier: string): Promise<CompleteAuthorizationFlowResponse>;
3240
+ getOrganization(options: GetAdminOrganizationOptions): Promise<{
3241
+ data: AdminOrganization;
3242
+ } | null>;
4833
3243
  /**
4834
- * Refreshes an authentication token for a specific application.
3244
+ * Lists active members for one organization as a global admin.
4835
3245
  *
4836
- * @param refreshToken - The refresh token to use for the authentication token refresh
4837
- * @throws {RefreshTokenExpiredError} When the refresh token has expired or is invalid
4838
- * @throws {ApplicationError} For other API errors
3246
+ * @param options - Organization ID and pagination options
3247
+ * @returns The paginated organization member listing
4839
3248
  */
4840
- refreshAccessToken(refreshToken: string): Promise<CompleteAuthorizationFlowResponse | null>;
3249
+ listOrganizationMembers(options: ListAdminOrganizationMembersOptions): Promise<{
3250
+ data: null;
3251
+ error: {
3252
+ message?: string | undefined;
3253
+ status: number;
3254
+ statusText: string;
3255
+ };
3256
+ } | {
3257
+ data: ListAdminOrganizationMembersResult;
3258
+ error: null;
3259
+ }>;
4841
3260
  /**
4842
- * Gets the current user and organization for a specific application.
4843
- *
4844
- * By default, the returned organization does not include its `members`,
4845
- * `teams`, or `invitations` collections. Pass `options.include` to request
4846
- * any of them explicitly.
3261
+ * Creates an organization without adding the creator as a member.
4847
3262
  *
4848
- * @param accessToken - The access token to use for the who am I request
4849
- * @param options - Optional include list controlling which relations are loaded
4850
- * @returns The current user and organization
3263
+ * @param options - Organization name and optional slug, logo, metadata, and settings
3264
+ * @returns The created organization
4851
3265
  */
4852
- whoAmI(accessToken: string, options?: WhoAmIOptions): Promise<WhoAmIResponse>;
3266
+ createOrganization(options: CreateAdminOrganizationOptions): Promise<{
3267
+ data: AdminOrganization;
3268
+ } | null>;
4853
3269
  /**
4854
- * Switches the active organization for the authenticated user.
3270
+ * Updates an organization's profile and settings.
4855
3271
  *
4856
- * Issues new access and refresh tokens scoped to the specified organization.
4857
- * The target organization must be entitled to the application and the entitlement's
4858
- * access rules must allow the current user.
4859
- *
4860
- * @param organizationId - The ID of the organization to switch to
4861
- * @param accessToken - Optional access token for authentication (uses cookie if not provided)
4862
- * @returns New authentication tokens and user/organization details
3272
+ * @param options - Organization ID and the fields to update
3273
+ * @returns The updated organization
4863
3274
  */
4864
- switchOrganization(organizationId: string, accessToken: string): Promise<CompleteAuthorizationFlowResponse>;
3275
+ updateOrganization(options: UpdateAdminOrganizationOptions): Promise<{
3276
+ data: AdminOrganization;
3277
+ } | null>;
4865
3278
  /**
4866
- * Logs out the user by invalidating their refresh token.
4867
- *
4868
- * Revokes the refresh token on the server, preventing further token refreshes
4869
- * and effectively ending the user's session.
4870
- *
4871
- * @param refreshToken - The refresh token to invalidate
3279
+ * Bans a user from the auth system and invalidates all their sessions.
3280
+ * @param userId - The ID of the user to ban
4872
3281
  */
4873
- logout(refreshToken: string): Promise<void>;
3282
+ banUser(userId: string): Promise<void>;
4874
3283
  }
4875
3284
 
4876
3285
  /**
@@ -4958,47 +3367,7 @@ declare class OrganizationService {
4958
3367
  * @param id - The organization ID
4959
3368
  * @returns The organization with members, invitations, and teams
4960
3369
  */
4961
- getOrganization(id: string): Promise<{
4962
- members: {
4963
- id: string;
4964
- organizationId: string;
4965
- role: "org:admin" | "org:member" | "org:reviewer";
4966
- createdAt: Date;
4967
- userId: string;
4968
- teamId?: string | undefined | undefined;
4969
- user: {
4970
- id: string;
4971
- email: string;
4972
- name: string;
4973
- image?: string | undefined;
4974
- };
4975
- }[];
4976
- invitations: {
4977
- id: string;
4978
- organizationId: string;
4979
- email: string;
4980
- role: "org:admin" | "org:member" | "org:reviewer";
4981
- status: better_auth_plugins.InvitationStatus;
4982
- inviterId: string;
4983
- expiresAt: Date;
4984
- createdAt: Date;
4985
- teamId?: string | undefined | undefined;
4986
- }[];
4987
- teams: {
4988
- id: string;
4989
- name: string;
4990
- organizationId: string;
4991
- createdAt: Date;
4992
- updatedAt?: Date | undefined;
4993
- }[];
4994
- } & {
4995
- id: string;
4996
- name: string;
4997
- slug: string;
4998
- createdAt: Date;
4999
- logo?: string | null | undefined | undefined;
5000
- metadata?: any;
5001
- }>;
3370
+ getOrganization(id: string): Promise<any>;
5002
3371
  /**
5003
3372
  * Lists all organizations accessible to the current user.
5004
3373
  *
@@ -5026,63 +3395,13 @@ declare class OrganizationService {
5026
3395
  * @param options.offset - Number of members to skip
5027
3396
  * @returns An array of organization members
5028
3397
  */
5029
- listMembers(options?: ListMembersOptions): Promise<({
5030
- id: string;
5031
- organizationId: string;
5032
- role: "org:admin" | "org:member" | "org:reviewer";
5033
- createdAt: Date;
5034
- userId: string;
5035
- teamId?: string | undefined | undefined;
5036
- user: {
5037
- id: string;
5038
- email: string;
5039
- name: string;
5040
- image?: string | undefined;
5041
- };
5042
- } & {
5043
- user: {
5044
- id: string;
5045
- name: string;
5046
- email: string;
5047
- image: string | null | undefined;
5048
- };
5049
- })[]>;
3398
+ listMembers(options?: ListMembersOptions): Promise<any>;
5050
3399
  /**
5051
3400
  * Gets the currently active organization member for the authenticated user.
5052
3401
  *
5053
3402
  * @returns The active member object
5054
3403
  */
5055
- getActiveMember(): Promise<NonNullable<Omit<{
5056
- id: string;
5057
- organizationId: string;
5058
- role: "org:admin" | "org:member" | "org:reviewer";
5059
- createdAt: Date;
5060
- userId: string;
5061
- teamId?: string | undefined | undefined;
5062
- user: {
5063
- id: string;
5064
- email: string;
5065
- name: string;
5066
- image?: string | undefined;
5067
- };
5068
- } & {
5069
- user: {
5070
- id: string;
5071
- createdAt: Date;
5072
- updatedAt: Date;
5073
- email: string;
5074
- emailVerified: boolean;
5075
- name: string;
5076
- image?: string | null | undefined;
5077
- };
5078
- }, "user"> & {
5079
- user: {
5080
- id: string;
5081
- name: string;
5082
- email: string;
5083
- image: string | undefined;
5084
- };
5085
- }>>;
3404
+ getActiveMember(): Promise<any>;
5086
3405
  /**
5087
3406
  * Invites a user to join the active organization.
5088
3407
  *
@@ -5096,27 +3415,7 @@ declare class OrganizationService {
5096
3415
  * @param options.resend - Whether to resend if invitation already exists
5097
3416
  * @returns The created invitation
5098
3417
  */
5099
- inviteUserToOrganization({ userEmail, role, teamId, resend }: InviteUserToOrganizationOptions): Promise<NonNullable<{
5100
- id: string;
5101
- organizationId: string;
5102
- email: string;
5103
- role: "org:admin" | "org:member" | "org:reviewer";
5104
- status: better_auth_plugins.InvitationStatus;
5105
- inviterId: string;
5106
- expiresAt: Date;
5107
- createdAt: Date;
5108
- teamId?: string | undefined | undefined;
5109
- } | {
5110
- id: string;
5111
- organizationId: string;
5112
- email: string;
5113
- role: "org:admin" | "org:member" | "org:reviewer";
5114
- status: better_auth_plugins.InvitationStatus;
5115
- inviterId: string;
5116
- expiresAt: Date;
5117
- createdAt: Date;
5118
- teamId?: string | undefined | undefined;
5119
- }>>;
3418
+ inviteUserToOrganization({ userEmail, role, teamId, resend }: InviteUserToOrganizationOptions): Promise<any>;
5120
3419
  /**
5121
3420
  * Cancels a pending organization invitation.
5122
3421
  *
@@ -5153,13 +3452,7 @@ declare class OrganizationService {
5153
3452
  * @param payload - Team configuration with a `name` field
5154
3453
  * @returns The created team
5155
3454
  */
5156
- createTeam(payload: CreateTeamPayload): Promise<{
5157
- id: string;
5158
- name: string;
5159
- organizationId: string;
5160
- createdAt: Date;
5161
- updatedAt?: Date | undefined;
5162
- }>;
3455
+ createTeam(payload: CreateTeamPayload): Promise<any>;
5163
3456
  /**
5164
3457
  * Updates an existing team's details.
5165
3458
  *
@@ -5167,13 +3460,7 @@ declare class OrganizationService {
5167
3460
  * @param payload - Team fields to update (currently supports `name`)
5168
3461
  * @returns The updated team
5169
3462
  */
5170
- updateTeam(id: string, payload: UpdateTeamPayload): Promise<{
5171
- id: string;
5172
- name: string;
5173
- organizationId: string;
5174
- createdAt: Date;
5175
- updatedAt?: Date | undefined;
5176
- }>;
3463
+ updateTeam(id: string, payload: UpdateTeamPayload): Promise<any>;
5177
3464
  /**
5178
3465
  * Deletes a team from the active organization.
5179
3466
  *
@@ -5185,25 +3472,14 @@ declare class OrganizationService {
5185
3472
  *
5186
3473
  * @returns An array of teams
5187
3474
  */
5188
- listTeams(): Promise<{
5189
- id: string;
5190
- name: string;
5191
- organizationId: string;
5192
- createdAt: Date;
5193
- updatedAt?: Date | undefined;
5194
- }[]>;
3475
+ listTeams(): Promise<any>;
5195
3476
  /**
5196
3477
  * Lists all members of a specific team.
5197
3478
  *
5198
3479
  * @param id - The team ID
5199
3480
  * @returns An array of team members
5200
3481
  */
5201
- listTeamMembers(id: string): Promise<{
5202
- id: string;
5203
- teamId: string;
5204
- userId: string;
5205
- createdAt: Date;
5206
- }[]>;
3482
+ listTeamMembers(id: string): Promise<any>;
5207
3483
  /**
5208
3484
  * Adds a user to a team.
5209
3485
  *
@@ -5211,12 +3487,7 @@ declare class OrganizationService {
5211
3487
  * @param userId - The user ID to add
5212
3488
  * @returns The added team member
5213
3489
  */
5214
- addTeamMember(teamId: string, userId: string): Promise<{
5215
- id: string;
5216
- teamId: string;
5217
- userId: string;
5218
- createdAt: Date;
5219
- }>;
3490
+ addTeamMember(teamId: string, userId: string): Promise<any>;
5220
3491
  /**
5221
3492
  * Removes a user from a team.
5222
3493
  *
@@ -5322,9 +3593,7 @@ declare class SessionService {
5322
3593
  *
5323
3594
  * @returns The JWT token
5324
3595
  */
5325
- getToken(): Promise<{
5326
- token: string;
5327
- }>;
3596
+ getToken(): Promise<any>;
5328
3597
  /**
5329
3598
  * Initiates social authentication flow with Google or Microsoft.
5330
3599
  *
@@ -5384,9 +3653,7 @@ declare class SessionService {
5384
3653
  * @param nonce - The nonce to retrieve the token for
5385
3654
  * @returns The JWT token for the nonce
5386
3655
  */
5387
- getNoncePayload(nonce: string): Promise<{
5388
- token: string;
5389
- }>;
3656
+ getNoncePayload(nonce: string): Promise<any>;
5390
3657
  }
5391
3658
 
5392
3659
  /**
@@ -5449,9 +3716,60 @@ declare class ApiKeyService {
5449
3716
  *
5450
3717
  * @param id - The API key ID to delete
5451
3718
  */
5452
- deleteApiKey(id: string): Promise<{
5453
- success: boolean;
5454
- }>;
3719
+ deleteApiKey(id: string): Promise<any>;
3720
+ }
3721
+
3722
+ /**
3723
+ * Options for requesting an email OTP.
3724
+ */
3725
+ type SendVerificationOTPOptions = {
3726
+ /**
3727
+ * Application ID used to scope the OTP request to an application's
3728
+ * configured sign-in policy.
3729
+ */
3730
+ applicationId: string;
3731
+ };
3732
+ /**
3733
+ * Options for completing email OTP sign-in.
3734
+ */
3735
+ type EmailOTPSignInOptions = {
3736
+ /**
3737
+ * Application ID used to scope the OTP sign-in to an application's
3738
+ * configured sign-in policy.
3739
+ */
3740
+ applicationId: string;
3741
+ };
3742
+ /**
3743
+ * Service for email OTP authentication operations.
3744
+ *
3745
+ * Provides helpers for sending one-time passcodes used by passwordless
3746
+ * sign-in flows.
3747
+ */
3748
+ declare class EmailOTPService {
3749
+ private client;
3750
+ /**
3751
+ * Creates a new EmailOTPService instance.
3752
+ *
3753
+ * @param client - The API client for making email OTP requests
3754
+ */
3755
+ constructor(client: APIClient);
3756
+ /**
3757
+ * Sends a sign-in verification OTP to an email address.
3758
+ *
3759
+ * @param email - Email address that should receive the OTP
3760
+ * @param options - Request configuration
3761
+ * @returns The underlying email OTP API response
3762
+ */
3763
+ sendVerificationOTP(email: string, options: SendVerificationOTPOptions): Promise<any>;
3764
+ /**
3765
+ * Completes email OTP sign-in with a one-time passcode.
3766
+ *
3767
+ * @param email - Email address that received the OTP
3768
+ * @param otp - One-time passcode from the sign-in email
3769
+ * @param options - Request configuration
3770
+ * @returns The underlying email OTP sign-in API response
3771
+ */
3772
+ signIn(email: string, otp: string, options: EmailOTPSignInOptions): Promise<any>;
5455
3773
  }
5456
3774
 
5457
3775
  /**
@@ -5479,7 +3797,7 @@ declare class EmailRequired extends BaseError {
5479
3797
  /**
5480
3798
  * Main authentication client for interacting with the Auth API.
5481
3799
  *
5482
- * Provides access to session management and organization management services.
3800
+ * Provides access to session, organization, application, API key, and email OTP services.
5483
3801
  *
5484
3802
  * @example
5485
3803
  * ```typescript
@@ -5497,6 +3815,11 @@ declare class EmailRequired extends BaseError {
5497
3815
  * ```
5498
3816
  */
5499
3817
  declare class AuthClient {
3818
+ /**
3819
+ * Configured Better Auth client used by the public service wrappers.
3820
+ *
3821
+ * @internal
3822
+ */
5500
3823
  private client;
5501
3824
  /**
5502
3825
  * Session management service for authentication operations
@@ -5514,6 +3837,18 @@ declare class AuthClient {
5514
3837
  * API key management service for API key operations
5515
3838
  */
5516
3839
  apiKey: ApiKeyService;
3840
+ /**
3841
+ * Email OTP service for passwordless sign-in operations
3842
+ */
3843
+ emailOtp: EmailOTPService;
3844
+ /**
3845
+ * Session assurance service for step-up operations
3846
+ */
3847
+ sessionAssurance: SessionAssuranceService;
3848
+ /**
3849
+ * Admin service for global admin operations
3850
+ */
3851
+ admin: AdminService;
5517
3852
  /**
5518
3853
  * Creates a new AuthClient instance.
5519
3854
  *
@@ -5523,6 +3858,9 @@ declare class AuthClient {
5523
3858
  constructor(apiUrl: string, fetchOptions?: BetterFetchOption);
5524
3859
  }
5525
3860
 
3861
+ type DecodedJWTPayload = Omit<JWTPayload, 'assurance'> & {
3862
+ assurance?: JWTPayloadAssurance;
3863
+ };
5526
3864
  /**
5527
3865
  * Checks if a JWT token has expired or will expire within a specified time window.
5528
3866
  *
@@ -5582,7 +3920,7 @@ declare function validateToken(token: string, apiUrl: string): Promise<boolean>;
5582
3920
  * console.log(payload.exp) // expiration timestamp
5583
3921
  * ```
5584
3922
  */
5585
- declare function extractTokenPayload(token: string): JWTPayload;
3923
+ declare function extractTokenPayload(token: string): DecodedJWTPayload;
5586
3924
 
5587
- export { ApiKeyMetadata, ApplicationError, AuthClient, AuthorizationFlowError, DeviceAccessDeniedError, DeviceAuthorizationPendingError, DeviceAuthorizationSlowDownError, DeviceCodeExpiredError, DeviceTransientServerError, EmailRequired, InvalidCallbackURL, InvalidSocialProvider, JWTPayload, JWTPayloadUser, JWTPayloadWorkspace, RefreshTokenExpiredError, Roles, UserNotLoggedInError, ac, createAPIClient, extractTokenPayload, invitationAdditionalFields, isTokenExpired, memberAdditionalFields, organizationAdditionalFields, rolesAccessControl, userAdditionalFields, validateToken };
5588
- export type { APIClient, ApiKey, ApiKeyWithoutSecret, Application, ApplicationAuthContextResponse, BaseOrganization, CompleteAuthorizationFlowResponse, CreateApiKeyPayload, CreateTeamPayload, DeviceAuthorizationActionResponse, DeviceAuthorizationContextResponse, DeviceAuthorizationResponse, DeviceContextApplication, FullOrganization, Invitation, InviteUserToOrganizationOptions, ListCandidateOrganizationsResponse, ListMembersOptions, Member, ExtendedOrganization as Organization, OrganizationSettings, RemoveUserFromOrganizationOptions, Role, Session, SignInWithEmailAndPasswordOptions, SignInWithSamlOptions, SocialSignInOptions, StartAuthorizationFlowResponse, Strict, Team, TeamMember, UpdateApiKeyPayload, UpdateMemberRoleOptions, UpdateOrganizationPayload, UpdateTeamPayload, User, WhoAmIInclude, WhoAmIOptions, WhoAmIOrganization, WhoAmIResponse };
3925
+ export { AAL, AALBrand, AALs, ACR, ACRBrand, ACRs, AMR, AMRBrand, AMRs, ApiKeyMetadata, ApplicationConfig, ApplicationError, ApplicationSessionAssuranceConfig, ApplicationSessionAssuranceError, AuthClient, AuthMethod, AuthMethodBrand, AuthMethods, AuthorizationFlowError, DEFAULT_APPLICATION_CONFIG, DEFAULT_JWT_ASSURANCE, DEFAULT_SESSION_ASSURANCE_CONFIG, DeviceAccessDeniedError, DeviceAuthorizationPendingError, DeviceAuthorizationSlowDownError, DeviceCodeExpiredError, DeviceTransientServerError, EmailOTPService, EmailRequired, InvalidCallbackURL, InvalidSocialProvider, JWTPayload, JWTPayloadAssurance, JWTPayloadUser, JWTPayloadWorkspace, OAuthBeginStepUpResponse, OAuthCompleteStepUpResponse, OAuthStepUpProvider, RefreshTokenExpiredError, Roles, SENSITIVE_ACTION_ASSURANCE_POLICY, SendOtpResponse, SessionAssurancePolicy, SessionAssuranceRequiredError, SessionAssuranceRequiredPayload, SessionAssuranceResponse, SessionAssuranceService, StepUpOption, UserNotLoggedInError, ac, assuranceFields, canStepUpWithAmr, createAPIClient, extractTokenPayload, getAalRank, invitationAdditionalFields, isAssuranceSufficientForPolicy, isSessionAssuranceSufficient, isTokenExpired, memberAdditionalFields, mergeStepUpAssurance, organizationAdditionalFields, parseSessionAssuranceRequiredPayload, rolesAccessControl, sessionAssurancePluginClient, userAdditionalFields, validateToken };
3926
+ export type { APIClient, AdminOrganization, AdminOrganizationApplication, AdminOrganizationMember, AdminOrganizationMemberRecord, AdminUser, ApiKey, ApiKeyWithoutSecret, Application, ApplicationAuthContextResponse, AssuranceFields, BaseOrganization, BeginOAuthStepUpParams, BillingMode, CompleteAuthorizationFlowResponse, CreateAdminOrganizationOptions, CreateApiKeyPayload, CreateTeamPayload, DecodedJWTPayload, DeviceAuthorizationActionResponse, DeviceAuthorizationContextResponse, DeviceAuthorizationResponse, DeviceContextApplication, EmailOTPSignInOptions, FullOrganization, GetAdminOrganizationOptions, Invitation, InviteUserToOrganizationOptions, JWTPayloadData, ListAdminOrganizationMembersOptions, ListAdminOrganizationMembersResult, ListAdminOrganizationsOptions, ListAdminOrganizationsResult, ListAdminUsersOptions, ListAdminUsersResult, ListCandidateOrganizationsResponse, ListMembersOptions, Member, ExtendedOrganization as Organization, OrganizationSettings, RemoveUserFromOrganizationOptions, Role, SendVerificationOTPOptions, Session, SessionAssuranceActions, SignInWithEmailAndPasswordOptions, SignInWithSamlOptions, SocialSignInOptions, StartAuthorizationFlowResponse, Strict, Team, TeamMember, UpdateAdminOrganizationOptions, UpdateApiKeyPayload, UpdateMemberRoleOptions, UpdateOrganizationPayload, UpdateTeamPayload, User, WhoAmIInclude, WhoAmIOptions, WhoAmIOrganization, WhoAmIResponse };