@uninspired/auth-client 1.0.21 → 2.1.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
@@ -1,25 +1,42 @@
1
+ import * as _$_better_auth_passkey_client0 from "@better-auth/passkey/client";
2
+ import * as _$better_auth_client0 from "better-auth/client";
3
+ import * as _$better_auth_react0 from "better-auth/react";
4
+ import * as _$zod from "zod";
1
5
  import { z } from "zod";
2
6
  import * as _$react from "react";
3
7
  import { PropsWithChildren } from "react";
8
+ import { PostHog } from "posthog-js";
9
+ import { PostHogProvider, useFeatureFlagEnabled, useFeatureFlagVariantKey, usePostHog } from "posthog-js/react/dist/esm/slim/index.js";
4
10
  import { QueryClient } from "@tanstack/react-query";
5
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
11
+ import * as _$better_auth0 from "better-auth";
6
12
  import { Session as Session$1, User } from "better-auth";
13
+ import * as _$better_auth_plugins0 from "better-auth/plugins";
14
+ import * as _$zod_v4_core0 from "zod/v4/core";
15
+ import * as _$_better_auth_passkey0 from "@better-auth/passkey";
7
16
 
8
17
  //#region ../types/src/analytics.d.ts
9
18
  declare const ANALYTICS_PRODUCTS: readonly ["mixd", "momentum", "unpinned", "accounts"];
10
19
  type AnalyticsProduct = (typeof ANALYTICS_PRODUCTS)[number];
11
- declare const ANALYTICS_EVENTS: {
12
- readonly USER_SIGNED_UP: "user signed up";
13
- readonly USER_LOGGED_IN: "user logged in";
14
- readonly TRIAL_STARTED: "trial started";
15
- readonly CHECKOUT_STARTED: "checkout started";
16
- readonly CHECKOUT_COMPLETED: "checkout completed";
17
- readonly FEATURE_USED: "feature used";
18
- };
19
- type AnalyticsEvent = (typeof ANALYTICS_EVENTS)[keyof typeof ANALYTICS_EVENTS];
20
20
  type AuthMethod = "magic_link" | "email_otp" | "passkey";
21
21
  declare function isAnalyticsProduct(value: string): value is AnalyticsProduct;
22
22
  //#endregion
23
+ //#region ../types/src/consent.d.ts
24
+ /**
25
+ * Cookie-consent state shared by the API worker and `@uninspired/auth-client`.
26
+ *
27
+ * The consent cookie is the single source of truth for whether a user has
28
+ * answered the banner. Its absence means "pending" (no decision yet), which is
29
+ * treated exactly like the PII-free tracking baseline everywhere.
30
+ */
31
+ interface TrackingConsent {
32
+ /** PostHog: full mode (cookies + identify) vs the cookieless baseline. */
33
+ analytics: boolean;
34
+ /** Meta Pixel (the only marketing-category tracker). */
35
+ marketing: boolean;
36
+ }
37
+ /** `null` = no decision recorded yet → the banner should be shown. */
38
+ type ConsentState = TrackingConsent | null;
39
+ //#endregion
23
40
  //#region ../types/src/purchases.d.ts
24
41
  declare const userPurchasesSchema: z.ZodObject<{
25
42
  stripe: z.ZodArray<z.ZodObject<{
@@ -89,35 +106,6 @@ interface Session {
89
106
  };
90
107
  }
91
108
  //#endregion
92
- //#region ../types/src/meta.d.ts
93
- declare const metaTrackEventSchema: z.ZodObject<{
94
- event_name: z.ZodEnum<{
95
- ViewContent: "ViewContent";
96
- InitiateCheckout: "InitiateCheckout";
97
- }>;
98
- content_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
99
- content_type: z.ZodOptional<z.ZodString>;
100
- event_source_url: z.ZodOptional<z.ZodString>;
101
- value: z.ZodOptional<z.ZodNumber>;
102
- currency: z.ZodOptional<z.ZodString>;
103
- event_id: z.ZodOptional<z.ZodString>;
104
- }, z.core.$strip>;
105
- type MetaTrackEventInput = z.infer<typeof metaTrackEventSchema>;
106
- type MetaAttributionCookies = {
107
- fbc?: string;
108
- fbp?: string;
109
- };
110
- declare function parseMetaAttributionFromCookieHeader(cookieHeader: string | undefined): MetaAttributionCookies;
111
- declare function buildFbcFromFbclid(fbclid: string, seenAtMs?: number): string;
112
- //#endregion
113
- //#region src/metaAttribution.d.ts
114
- declare function getMetaCookieDomain(frontendUrl: string): string | undefined;
115
- declare function readMetaAttributionCookies(): MetaAttributionCookies;
116
- declare function captureMetaClickId(options: {
117
- frontendUrl: string;
118
- stripFbclidFromUrl?: boolean;
119
- }): MetaAttributionCookies;
120
- //#endregion
121
109
  //#region src/AuthClient.d.ts
122
110
  declare class AuthClient {
123
111
  #private;
@@ -126,13 +114,6 @@ declare class AuthClient {
126
114
  signInAnonymously: () => Promise<Session | null>;
127
115
  signOut: (onSuccess?: () => void) => Promise<void>;
128
116
  getPurchases: () => Promise<UserPurchases | null>;
129
- trackMetaEvent: (payload: MetaTrackEventInput) => Promise<void>;
130
- trackViewContent: (options: {
131
- contentIds: string[];
132
- contentType?: string;
133
- eventSourceUrl?: string;
134
- }) => Promise<void>;
135
- getMetaAttribution: () => MetaAttributionCookies;
136
117
  getLoginUrl: (options?: {
137
118
  redirectUrl?: string;
138
119
  appName?: string;
@@ -146,7 +127,1590 @@ declare class AuthClient {
146
127
  }) => string;
147
128
  }
148
129
  //#endregion
130
+ //#region src/betterAuthClient.d.ts
131
+ declare function createBetterAuthClient(baseURL: string): _$better_auth_react0.ReactAuthClient<{
132
+ baseURL: string;
133
+ plugins: ({
134
+ id: "anonymous";
135
+ version: string;
136
+ $InferServerPlugin: ReturnType<(options?: _$better_auth_plugins0.AnonymousOptions | undefined) => {
137
+ id: "anonymous";
138
+ version: string;
139
+ endpoints: {
140
+ signInAnonymous: _$better_auth0.StrictEndpoint<"/sign-in/anonymous", {
141
+ method: "POST";
142
+ metadata: {
143
+ openapi: {
144
+ description: string;
145
+ responses: {
146
+ 200: {
147
+ description: string;
148
+ content: {
149
+ "application/json": {
150
+ schema: {
151
+ type: "object";
152
+ properties: {
153
+ user: {
154
+ $ref: string;
155
+ };
156
+ session: {
157
+ $ref: string;
158
+ };
159
+ };
160
+ };
161
+ };
162
+ };
163
+ };
164
+ };
165
+ };
166
+ };
167
+ }, {
168
+ token: string;
169
+ user: Record<string, any> & {
170
+ id: string;
171
+ createdAt: Date;
172
+ updatedAt: Date;
173
+ email: string;
174
+ emailVerified: boolean;
175
+ name: string;
176
+ image?: string | null | undefined;
177
+ };
178
+ }>;
179
+ deleteAnonymousUser: _$better_auth0.StrictEndpoint<"/delete-anonymous-user", {
180
+ method: "POST";
181
+ use: _$better_auth0.Middleware<_$better_auth0.MiddlewareOptions, (inputContext: _$better_auth0.MiddlewareInputContext<_$better_auth0.MiddlewareOptions>) => Promise<{
182
+ session: {
183
+ session: Record<string, any> & {
184
+ id: string;
185
+ createdAt: Date;
186
+ updatedAt: Date;
187
+ userId: string;
188
+ expiresAt: Date;
189
+ token: string;
190
+ ipAddress?: string | null | undefined;
191
+ userAgent?: string | null | undefined;
192
+ };
193
+ user: Record<string, any> & {
194
+ id: string;
195
+ createdAt: Date;
196
+ updatedAt: Date;
197
+ email: string;
198
+ emailVerified: boolean;
199
+ name: string;
200
+ image?: string | null | undefined;
201
+ };
202
+ };
203
+ }>>[];
204
+ metadata: {
205
+ openapi: {
206
+ description: string;
207
+ responses: {
208
+ 200: {
209
+ description: string;
210
+ content: {
211
+ "application/json": {
212
+ schema: {
213
+ type: "object";
214
+ properties: {
215
+ success: {
216
+ type: string;
217
+ };
218
+ };
219
+ };
220
+ };
221
+ };
222
+ };
223
+ "400": {
224
+ description: string;
225
+ content: {
226
+ "application/json": {
227
+ schema: {
228
+ type: "object";
229
+ properties: {
230
+ message: {
231
+ type: string;
232
+ };
233
+ };
234
+ };
235
+ required: string[];
236
+ };
237
+ };
238
+ };
239
+ "500": {
240
+ description: string;
241
+ content: {
242
+ "application/json": {
243
+ schema: {
244
+ type: "object";
245
+ properties: {
246
+ message: {
247
+ type: string;
248
+ };
249
+ };
250
+ required: string[];
251
+ };
252
+ };
253
+ };
254
+ };
255
+ };
256
+ };
257
+ };
258
+ }, {
259
+ success: boolean;
260
+ }>;
261
+ };
262
+ hooks: {
263
+ before: {
264
+ matcher(ctx: _$better_auth0.HookEndpointContext): boolean;
265
+ handler: _$better_auth0.Middleware<_$better_auth0.MiddlewareOptions, (inputContext: _$better_auth0.MiddlewareInputContext<_$better_auth0.MiddlewareOptions>) => Promise<void>>;
266
+ }[];
267
+ after: {
268
+ matcher(ctx: _$better_auth0.HookEndpointContext): boolean;
269
+ handler: _$better_auth0.Middleware<_$better_auth0.MiddlewareOptions, (inputContext: _$better_auth0.MiddlewareInputContext<_$better_auth0.MiddlewareOptions>) => Promise<void>>;
270
+ }[];
271
+ };
272
+ options: _$better_auth_plugins0.AnonymousOptions | undefined;
273
+ schema: {
274
+ user: {
275
+ fields: {
276
+ isAnonymous: {
277
+ type: "boolean";
278
+ required: false;
279
+ input: false;
280
+ defaultValue: false;
281
+ };
282
+ };
283
+ };
284
+ };
285
+ $ERROR_CODES: {
286
+ FAILED_TO_CREATE_USER: _$better_auth0.RawError<"FAILED_TO_CREATE_USER">;
287
+ INVALID_EMAIL_FORMAT: _$better_auth0.RawError<"INVALID_EMAIL_FORMAT">;
288
+ COULD_NOT_CREATE_SESSION: _$better_auth0.RawError<"COULD_NOT_CREATE_SESSION">;
289
+ ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY: _$better_auth0.RawError<"ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY">;
290
+ FAILED_TO_DELETE_ANONYMOUS_USER: _$better_auth0.RawError<"FAILED_TO_DELETE_ANONYMOUS_USER">;
291
+ FAILED_TO_DELETE_ANONYMOUS_USER_SESSIONS: _$better_auth0.RawError<"FAILED_TO_DELETE_ANONYMOUS_USER_SESSIONS">;
292
+ USER_IS_NOT_ANONYMOUS: _$better_auth0.RawError<"USER_IS_NOT_ANONYMOUS">;
293
+ DELETE_ANONYMOUS_USER_DISABLED: _$better_auth0.RawError<"DELETE_ANONYMOUS_USER_DISABLED">;
294
+ };
295
+ }>;
296
+ pathMethods: {
297
+ "/sign-in/anonymous": "POST";
298
+ "/delete-anonymous-user": "POST";
299
+ };
300
+ atomListeners: {
301
+ matcher: (path: string) => path is "/sign-in/anonymous";
302
+ signal: "$sessionSignal";
303
+ }[];
304
+ $ERROR_CODES: {
305
+ FAILED_TO_CREATE_USER: _$better_auth0.RawError<"FAILED_TO_CREATE_USER">;
306
+ INVALID_EMAIL_FORMAT: _$better_auth0.RawError<"INVALID_EMAIL_FORMAT">;
307
+ COULD_NOT_CREATE_SESSION: _$better_auth0.RawError<"COULD_NOT_CREATE_SESSION">;
308
+ ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY: _$better_auth0.RawError<"ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY">;
309
+ FAILED_TO_DELETE_ANONYMOUS_USER: _$better_auth0.RawError<"FAILED_TO_DELETE_ANONYMOUS_USER">;
310
+ FAILED_TO_DELETE_ANONYMOUS_USER_SESSIONS: _$better_auth0.RawError<"FAILED_TO_DELETE_ANONYMOUS_USER_SESSIONS">;
311
+ USER_IS_NOT_ANONYMOUS: _$better_auth0.RawError<"USER_IS_NOT_ANONYMOUS">;
312
+ DELETE_ANONYMOUS_USER_DISABLED: _$better_auth0.RawError<"DELETE_ANONYMOUS_USER_DISABLED">;
313
+ };
314
+ } | {
315
+ id: "magic-link";
316
+ version: string;
317
+ $InferServerPlugin: ReturnType<(options: _$better_auth_plugins0.MagicLinkOptions) => {
318
+ id: "magic-link";
319
+ version: string;
320
+ endpoints: {
321
+ signInMagicLink: _$better_auth0.StrictEndpoint<"/sign-in/magic-link", {
322
+ method: "POST";
323
+ requireHeaders: true;
324
+ use: _$better_auth0.Middleware<_$better_auth0.MiddlewareOptions, (inputContext: _$better_auth0.MiddlewareInputContext<_$better_auth0.MiddlewareOptions>) => Promise<void>>[];
325
+ body: _$zod.ZodObject<{
326
+ email: _$zod.ZodEmail;
327
+ name: _$zod.ZodOptional<_$zod.ZodString>;
328
+ callbackURL: _$zod.ZodOptional<_$zod.ZodString>;
329
+ newUserCallbackURL: _$zod.ZodOptional<_$zod.ZodString>;
330
+ errorCallbackURL: _$zod.ZodOptional<_$zod.ZodString>;
331
+ metadata: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodAny>>;
332
+ }, _$zod_v4_core0.$strip>;
333
+ metadata: {
334
+ openapi: {
335
+ operationId: string;
336
+ description: string;
337
+ responses: {
338
+ 200: {
339
+ description: string;
340
+ content: {
341
+ "application/json": {
342
+ schema: {
343
+ type: "object";
344
+ properties: {
345
+ status: {
346
+ type: string;
347
+ };
348
+ };
349
+ };
350
+ };
351
+ };
352
+ };
353
+ };
354
+ };
355
+ };
356
+ }, {
357
+ status: boolean;
358
+ }>;
359
+ magicLinkVerify: _$better_auth0.StrictEndpoint<"/magic-link/verify", {
360
+ method: "GET";
361
+ query: _$zod.ZodObject<{
362
+ token: _$zod.ZodString;
363
+ callbackURL: _$zod.ZodOptional<_$zod.ZodString>;
364
+ errorCallbackURL: _$zod.ZodOptional<_$zod.ZodString>;
365
+ newUserCallbackURL: _$zod.ZodOptional<_$zod.ZodString>;
366
+ }, _$zod_v4_core0.$strip>;
367
+ use: _$better_auth0.Middleware<_$better_auth0.MiddlewareOptions, (inputContext: _$better_auth0.MiddlewareInputContext<_$better_auth0.MiddlewareOptions>) => Promise<void>>[];
368
+ requireHeaders: true;
369
+ metadata: {
370
+ openapi: {
371
+ operationId: string;
372
+ description: string;
373
+ responses: {
374
+ 200: {
375
+ description: string;
376
+ content: {
377
+ "application/json": {
378
+ schema: {
379
+ type: "object";
380
+ properties: {
381
+ session: {
382
+ $ref: string;
383
+ };
384
+ user: {
385
+ $ref: string;
386
+ };
387
+ };
388
+ };
389
+ };
390
+ };
391
+ };
392
+ };
393
+ };
394
+ };
395
+ }, {
396
+ token: string;
397
+ user: {
398
+ id: string;
399
+ createdAt: Date;
400
+ updatedAt: Date;
401
+ email: string;
402
+ emailVerified: boolean;
403
+ name: string;
404
+ image?: string | null | undefined;
405
+ };
406
+ session: {
407
+ id: string;
408
+ createdAt: Date;
409
+ updatedAt: Date;
410
+ userId: string;
411
+ expiresAt: Date;
412
+ token: string;
413
+ ipAddress?: string | null | undefined;
414
+ userAgent?: string | null | undefined;
415
+ };
416
+ }>;
417
+ };
418
+ rateLimit: {
419
+ pathMatcher(path: string): boolean;
420
+ window: number;
421
+ max: number;
422
+ }[];
423
+ options: _$better_auth_plugins0.MagicLinkOptions;
424
+ }>;
425
+ } | {
426
+ id: "email-otp";
427
+ version: string;
428
+ $InferServerPlugin: ReturnType<(options: _$better_auth_plugins0.EmailOTPOptions) => {
429
+ id: "email-otp";
430
+ version: string;
431
+ init(ctx: _$better_auth0.AuthContext): {
432
+ options: {
433
+ emailVerification: {
434
+ sendVerificationEmail(data: {
435
+ user: _$better_auth0.User;
436
+ url: string;
437
+ token: string;
438
+ }, request: Request | undefined): Promise<void>;
439
+ };
440
+ };
441
+ } | undefined;
442
+ endpoints: {
443
+ sendVerificationOTP: _$better_auth0.StrictEndpoint<"/email-otp/send-verification-otp", {
444
+ method: "POST";
445
+ use: _$better_auth0.Middleware<_$better_auth0.MiddlewareOptions, (inputContext: _$better_auth0.MiddlewareInputContext<_$better_auth0.MiddlewareOptions>) => Promise<void>>[];
446
+ body: _$zod.ZodObject<{
447
+ email: _$zod.ZodString;
448
+ type: _$zod.ZodEnum<{
449
+ "sign-in": "sign-in";
450
+ "change-email": "change-email";
451
+ "email-verification": "email-verification";
452
+ "forget-password": "forget-password";
453
+ }>;
454
+ }, _$zod_v4_core0.$strip>;
455
+ metadata: {
456
+ openapi: {
457
+ operationId: string;
458
+ description: string;
459
+ responses: {
460
+ 200: {
461
+ description: string;
462
+ content: {
463
+ "application/json": {
464
+ schema: {
465
+ type: "object";
466
+ properties: {
467
+ success: {
468
+ type: string;
469
+ };
470
+ };
471
+ };
472
+ };
473
+ };
474
+ };
475
+ };
476
+ };
477
+ };
478
+ }, {
479
+ success: boolean;
480
+ }>;
481
+ createVerificationOTP: _$better_auth0.StrictEndpoint<string, {
482
+ method: "POST";
483
+ body: _$zod.ZodObject<{
484
+ email: _$zod.ZodString;
485
+ type: _$zod.ZodEnum<{
486
+ "sign-in": "sign-in";
487
+ "change-email": "change-email";
488
+ "email-verification": "email-verification";
489
+ "forget-password": "forget-password";
490
+ }>;
491
+ }, _$zod_v4_core0.$strip>;
492
+ metadata: {
493
+ openapi: {
494
+ operationId: string;
495
+ description: string;
496
+ responses: {
497
+ 200: {
498
+ description: string;
499
+ content: {
500
+ "application/json": {
501
+ schema: {
502
+ type: "string";
503
+ };
504
+ };
505
+ };
506
+ };
507
+ };
508
+ };
509
+ };
510
+ }, string>;
511
+ getVerificationOTP: _$better_auth0.StrictEndpoint<string, {
512
+ method: "GET";
513
+ query: _$zod.ZodObject<{
514
+ email: _$zod.ZodString;
515
+ type: _$zod.ZodEnum<{
516
+ "sign-in": "sign-in";
517
+ "change-email": "change-email";
518
+ "email-verification": "email-verification";
519
+ "forget-password": "forget-password";
520
+ }>;
521
+ }, _$zod_v4_core0.$strip>;
522
+ metadata: {
523
+ openapi: {
524
+ operationId: string;
525
+ description: string;
526
+ responses: {
527
+ "200": {
528
+ description: string;
529
+ content: {
530
+ "application/json": {
531
+ schema: {
532
+ type: "object";
533
+ properties: {
534
+ otp: {
535
+ type: string;
536
+ nullable: boolean;
537
+ description: string;
538
+ };
539
+ };
540
+ required: string[];
541
+ };
542
+ };
543
+ };
544
+ };
545
+ };
546
+ };
547
+ };
548
+ }, {
549
+ otp: null;
550
+ } | {
551
+ otp: string;
552
+ }>;
553
+ checkVerificationOTP: _$better_auth0.StrictEndpoint<"/email-otp/check-verification-otp", {
554
+ method: "POST";
555
+ body: _$zod.ZodObject<{
556
+ email: _$zod.ZodString;
557
+ type: _$zod.ZodEnum<{
558
+ "sign-in": "sign-in";
559
+ "change-email": "change-email";
560
+ "email-verification": "email-verification";
561
+ "forget-password": "forget-password";
562
+ }>;
563
+ otp: _$zod.ZodString;
564
+ }, _$zod_v4_core0.$strip>;
565
+ metadata: {
566
+ openapi: {
567
+ operationId: string;
568
+ description: string;
569
+ responses: {
570
+ 200: {
571
+ description: string;
572
+ content: {
573
+ "application/json": {
574
+ schema: {
575
+ type: "object";
576
+ properties: {
577
+ success: {
578
+ type: string;
579
+ };
580
+ };
581
+ };
582
+ };
583
+ };
584
+ };
585
+ };
586
+ };
587
+ };
588
+ }, {
589
+ success: boolean;
590
+ }>;
591
+ verifyEmailOTP: _$better_auth0.StrictEndpoint<"/email-otp/verify-email", {
592
+ method: "POST";
593
+ body: _$zod.ZodObject<{
594
+ email: _$zod.ZodString;
595
+ otp: _$zod.ZodString;
596
+ }, _$zod_v4_core0.$strip>;
597
+ metadata: {
598
+ openapi: {
599
+ description: string;
600
+ responses: {
601
+ 200: {
602
+ description: string;
603
+ content: {
604
+ "application/json": {
605
+ schema: {
606
+ type: "object";
607
+ properties: {
608
+ status: {
609
+ type: string;
610
+ description: string;
611
+ enum: boolean[];
612
+ };
613
+ token: {
614
+ type: string;
615
+ nullable: boolean;
616
+ description: string;
617
+ };
618
+ user: {
619
+ $ref: string;
620
+ };
621
+ };
622
+ required: string[];
623
+ };
624
+ };
625
+ };
626
+ };
627
+ };
628
+ };
629
+ };
630
+ }, {
631
+ status: boolean;
632
+ token: string;
633
+ user: {
634
+ id: string;
635
+ createdAt: Date;
636
+ updatedAt: Date;
637
+ email: string;
638
+ emailVerified: boolean;
639
+ name: string;
640
+ image?: string | null | undefined;
641
+ } & Record<string, any>;
642
+ } | {
643
+ status: boolean;
644
+ token: null;
645
+ user: {
646
+ id: string;
647
+ createdAt: Date;
648
+ updatedAt: Date;
649
+ email: string;
650
+ emailVerified: boolean;
651
+ name: string;
652
+ image?: string | null | undefined;
653
+ } & Record<string, any>;
654
+ }>;
655
+ signInEmailOTP: _$better_auth0.StrictEndpoint<"/sign-in/email-otp", {
656
+ method: "POST";
657
+ body: _$zod.ZodIntersection<_$zod.ZodObject<{
658
+ email: _$zod.ZodString;
659
+ otp: _$zod.ZodString;
660
+ name: _$zod.ZodOptional<_$zod.ZodString>;
661
+ image: _$zod.ZodOptional<_$zod.ZodString>;
662
+ }, _$zod_v4_core0.$strip>, _$zod.ZodRecord<_$zod.ZodString, _$zod.ZodAny>>;
663
+ metadata: {
664
+ openapi: {
665
+ operationId: string;
666
+ description: string;
667
+ responses: {
668
+ 200: {
669
+ description: string;
670
+ content: {
671
+ "application/json": {
672
+ schema: {
673
+ type: "object";
674
+ properties: {
675
+ token: {
676
+ type: string;
677
+ description: string;
678
+ };
679
+ user: {
680
+ $ref: string;
681
+ };
682
+ };
683
+ required: string[];
684
+ };
685
+ };
686
+ };
687
+ };
688
+ };
689
+ };
690
+ };
691
+ }, {
692
+ token: string;
693
+ user: {
694
+ id: string;
695
+ createdAt: Date;
696
+ updatedAt: Date;
697
+ email: string;
698
+ emailVerified: boolean;
699
+ name: string;
700
+ image?: string | null | undefined;
701
+ };
702
+ }>;
703
+ requestPasswordResetEmailOTP: _$better_auth0.StrictEndpoint<"/email-otp/request-password-reset", {
704
+ method: "POST";
705
+ body: _$zod.ZodObject<{
706
+ email: _$zod.ZodString;
707
+ }, _$zod_v4_core0.$strip>;
708
+ metadata: {
709
+ openapi: {
710
+ operationId: string;
711
+ description: string;
712
+ responses: {
713
+ 200: {
714
+ description: string;
715
+ content: {
716
+ "application/json": {
717
+ schema: {
718
+ type: "object";
719
+ properties: {
720
+ success: {
721
+ type: string;
722
+ description: string;
723
+ };
724
+ };
725
+ };
726
+ };
727
+ };
728
+ };
729
+ };
730
+ };
731
+ };
732
+ }, {
733
+ success: boolean;
734
+ }>;
735
+ forgetPasswordEmailOTP: _$better_auth0.StrictEndpoint<"/forget-password/email-otp", {
736
+ method: "POST";
737
+ body: _$zod.ZodObject<{
738
+ email: _$zod.ZodString;
739
+ }, _$zod_v4_core0.$strip>;
740
+ metadata: {
741
+ openapi: {
742
+ operationId: string;
743
+ description: string;
744
+ responses: {
745
+ 200: {
746
+ description: string;
747
+ content: {
748
+ "application/json": {
749
+ schema: {
750
+ type: "object";
751
+ properties: {
752
+ success: {
753
+ type: string;
754
+ description: string;
755
+ };
756
+ };
757
+ };
758
+ };
759
+ };
760
+ };
761
+ };
762
+ };
763
+ };
764
+ }, {
765
+ success: boolean;
766
+ }>;
767
+ resetPasswordEmailOTP: _$better_auth0.StrictEndpoint<"/email-otp/reset-password", {
768
+ method: "POST";
769
+ body: _$zod.ZodObject<{
770
+ email: _$zod.ZodString;
771
+ otp: _$zod.ZodString;
772
+ password: _$zod.ZodString;
773
+ }, _$zod_v4_core0.$strip>;
774
+ metadata: {
775
+ openapi: {
776
+ operationId: string;
777
+ description: string;
778
+ responses: {
779
+ 200: {
780
+ description: string;
781
+ content: {
782
+ "application/json": {
783
+ schema: {
784
+ type: "object";
785
+ properties: {
786
+ success: {
787
+ type: string;
788
+ };
789
+ };
790
+ };
791
+ };
792
+ };
793
+ };
794
+ };
795
+ };
796
+ };
797
+ }, {
798
+ success: boolean;
799
+ }>;
800
+ requestEmailChangeEmailOTP: _$better_auth0.StrictEndpoint<"/email-otp/request-email-change", {
801
+ method: "POST";
802
+ body: _$zod.ZodObject<{
803
+ newEmail: _$zod.ZodString;
804
+ otp: _$zod.ZodOptional<_$zod.ZodString>;
805
+ }, _$zod_v4_core0.$strip>;
806
+ use: _$better_auth0.Middleware<_$better_auth0.MiddlewareOptions, (inputContext: _$better_auth0.MiddlewareInputContext<_$better_auth0.MiddlewareOptions>) => Promise<{
807
+ session: {
808
+ session: Record<string, any> & {
809
+ id: string;
810
+ createdAt: Date;
811
+ updatedAt: Date;
812
+ userId: string;
813
+ expiresAt: Date;
814
+ token: string;
815
+ ipAddress?: string | null | undefined;
816
+ userAgent?: string | null | undefined;
817
+ };
818
+ user: Record<string, any> & {
819
+ id: string;
820
+ createdAt: Date;
821
+ updatedAt: Date;
822
+ email: string;
823
+ emailVerified: boolean;
824
+ name: string;
825
+ image?: string | null | undefined;
826
+ };
827
+ };
828
+ }>>[];
829
+ metadata: {
830
+ openapi: {
831
+ operationId: string;
832
+ description: string;
833
+ responses: {
834
+ 200: {
835
+ description: string;
836
+ content: {
837
+ "application/json": {
838
+ schema: {
839
+ type: "object";
840
+ properties: {
841
+ success: {
842
+ type: string;
843
+ };
844
+ };
845
+ };
846
+ };
847
+ };
848
+ };
849
+ };
850
+ };
851
+ };
852
+ }, {
853
+ success: boolean;
854
+ }>;
855
+ changeEmailEmailOTP: _$better_auth0.StrictEndpoint<"/email-otp/change-email", {
856
+ method: "POST";
857
+ body: _$zod.ZodObject<{
858
+ newEmail: _$zod.ZodString;
859
+ otp: _$zod.ZodString;
860
+ }, _$zod_v4_core0.$strip>;
861
+ use: _$better_auth0.Middleware<_$better_auth0.MiddlewareOptions, (inputContext: _$better_auth0.MiddlewareInputContext<_$better_auth0.MiddlewareOptions>) => Promise<{
862
+ session: {
863
+ session: Record<string, any> & {
864
+ id: string;
865
+ createdAt: Date;
866
+ updatedAt: Date;
867
+ userId: string;
868
+ expiresAt: Date;
869
+ token: string;
870
+ ipAddress?: string | null | undefined;
871
+ userAgent?: string | null | undefined;
872
+ };
873
+ user: Record<string, any> & {
874
+ id: string;
875
+ createdAt: Date;
876
+ updatedAt: Date;
877
+ email: string;
878
+ emailVerified: boolean;
879
+ name: string;
880
+ image?: string | null | undefined;
881
+ };
882
+ };
883
+ }>>[];
884
+ metadata: {
885
+ openapi: {
886
+ operationId: string;
887
+ description: string;
888
+ responses: {
889
+ 200: {
890
+ description: string;
891
+ content: {
892
+ "application/json": {
893
+ schema: {
894
+ type: "object";
895
+ properties: {
896
+ success: {
897
+ type: string;
898
+ };
899
+ };
900
+ };
901
+ };
902
+ };
903
+ };
904
+ };
905
+ };
906
+ };
907
+ }, {
908
+ success: boolean;
909
+ }>;
910
+ };
911
+ hooks: {
912
+ after: {
913
+ matcher(context: _$better_auth0.HookEndpointContext): boolean;
914
+ handler: _$better_auth0.Middleware<_$better_auth0.MiddlewareOptions, (inputContext: _$better_auth0.MiddlewareInputContext<_$better_auth0.MiddlewareOptions>) => Promise<void>>;
915
+ }[];
916
+ };
917
+ rateLimit: ({
918
+ pathMatcher(path: string): path is "/email-otp/send-verification-otp";
919
+ window: number;
920
+ max: number;
921
+ } | {
922
+ pathMatcher(path: string): path is "/email-otp/check-verification-otp";
923
+ window: number;
924
+ max: number;
925
+ } | {
926
+ pathMatcher(path: string): path is "/email-otp/verify-email";
927
+ window: number;
928
+ max: number;
929
+ } | {
930
+ pathMatcher(path: string): path is "/sign-in/email-otp";
931
+ window: number;
932
+ max: number;
933
+ } | {
934
+ pathMatcher(path: string): path is "/email-otp/request-password-reset";
935
+ window: number;
936
+ max: number;
937
+ } | {
938
+ pathMatcher(path: string): path is "/email-otp/reset-password";
939
+ window: number;
940
+ max: number;
941
+ } | {
942
+ pathMatcher(path: string): path is "/forget-password/email-otp";
943
+ window: number;
944
+ max: number;
945
+ } | {
946
+ pathMatcher(path: string): path is "/email-otp/request-email-change";
947
+ window: number;
948
+ max: number;
949
+ } | {
950
+ pathMatcher(path: string): path is "/email-otp/change-email";
951
+ window: number;
952
+ max: number;
953
+ })[];
954
+ options: _$better_auth_plugins0.EmailOTPOptions;
955
+ $ERROR_CODES: {
956
+ OTP_EXPIRED: _$better_auth0.RawError<"OTP_EXPIRED">;
957
+ INVALID_OTP: _$better_auth0.RawError<"INVALID_OTP">;
958
+ TOO_MANY_ATTEMPTS: _$better_auth0.RawError<"TOO_MANY_ATTEMPTS">;
959
+ };
960
+ }>;
961
+ atomListeners: {
962
+ matcher: (path: string) => path is "/email-otp/verify-email" | "/sign-in/email-otp" | "/email-otp/request-email-change";
963
+ signal: "$sessionSignal";
964
+ }[];
965
+ $ERROR_CODES: {
966
+ OTP_EXPIRED: _$better_auth0.RawError<"OTP_EXPIRED">;
967
+ INVALID_OTP: _$better_auth0.RawError<"INVALID_OTP">;
968
+ TOO_MANY_ATTEMPTS: _$better_auth0.RawError<"TOO_MANY_ATTEMPTS">;
969
+ };
970
+ } | {
971
+ id: "passkey";
972
+ version: string;
973
+ $InferServerPlugin: ReturnType<(options?: _$_better_auth_passkey0.PasskeyOptions | undefined) => {
974
+ id: "passkey";
975
+ version: string;
976
+ endpoints: {
977
+ generatePasskeyRegistrationOptions: _$better_auth0.StrictEndpoint<"/passkey/generate-register-options", {
978
+ method: "GET";
979
+ use: _$better_auth0.Middleware<_$better_auth0.MiddlewareOptions, (inputContext: _$better_auth0.MiddlewareInputContext<_$better_auth0.MiddlewareOptions>) => Promise<{
980
+ session: {
981
+ session: Record<string, any> & {
982
+ id: string;
983
+ createdAt: Date;
984
+ updatedAt: Date;
985
+ userId: string;
986
+ expiresAt: Date;
987
+ token: string;
988
+ ipAddress?: string | null | undefined;
989
+ userAgent?: string | null | undefined;
990
+ };
991
+ user: Record<string, any> & {
992
+ id: string;
993
+ createdAt: Date;
994
+ updatedAt: Date;
995
+ email: string;
996
+ emailVerified: boolean;
997
+ name: string;
998
+ image?: string | null | undefined;
999
+ };
1000
+ };
1001
+ }>>[];
1002
+ query: _$zod.ZodOptional<_$zod.ZodObject<{
1003
+ authenticatorAttachment: _$zod.ZodOptional<_$zod.ZodEnum<{
1004
+ platform: "platform";
1005
+ "cross-platform": "cross-platform";
1006
+ }>>;
1007
+ name: _$zod.ZodOptional<_$zod.ZodString>;
1008
+ context: _$zod.ZodOptional<_$zod.ZodString>;
1009
+ }, _$zod_v4_core0.$strip>>;
1010
+ metadata: {
1011
+ openapi: {
1012
+ operationId: string;
1013
+ description: string;
1014
+ parameters: _$better_auth0.OpenAPIParameter[];
1015
+ responses: {
1016
+ 200: {
1017
+ description: string;
1018
+ content: {
1019
+ "application/json": {
1020
+ schema: {
1021
+ type: "object";
1022
+ properties: {
1023
+ challenge: {
1024
+ type: string;
1025
+ };
1026
+ rp: {
1027
+ type: string;
1028
+ properties: {
1029
+ name: {
1030
+ type: string;
1031
+ };
1032
+ id: {
1033
+ type: string;
1034
+ };
1035
+ };
1036
+ };
1037
+ user: {
1038
+ type: string;
1039
+ properties: {
1040
+ id: {
1041
+ type: string;
1042
+ };
1043
+ name: {
1044
+ type: string;
1045
+ };
1046
+ displayName: {
1047
+ type: string;
1048
+ };
1049
+ };
1050
+ };
1051
+ pubKeyCredParams: {
1052
+ type: string;
1053
+ items: {
1054
+ type: string;
1055
+ properties: {
1056
+ type: {
1057
+ type: string;
1058
+ };
1059
+ alg: {
1060
+ type: string;
1061
+ };
1062
+ };
1063
+ };
1064
+ };
1065
+ timeout: {
1066
+ type: string;
1067
+ };
1068
+ excludeCredentials: {
1069
+ type: string;
1070
+ items: {
1071
+ type: string;
1072
+ properties: {
1073
+ id: {
1074
+ type: string;
1075
+ };
1076
+ type: {
1077
+ type: string;
1078
+ };
1079
+ transports: {
1080
+ type: string;
1081
+ items: {
1082
+ type: string;
1083
+ };
1084
+ };
1085
+ };
1086
+ };
1087
+ };
1088
+ authenticatorSelection: {
1089
+ type: string;
1090
+ properties: {
1091
+ authenticatorAttachment: {
1092
+ type: string;
1093
+ };
1094
+ requireResidentKey: {
1095
+ type: string;
1096
+ };
1097
+ userVerification: {
1098
+ type: string;
1099
+ };
1100
+ };
1101
+ };
1102
+ attestation: {
1103
+ type: string;
1104
+ };
1105
+ extensions: {
1106
+ type: string;
1107
+ };
1108
+ };
1109
+ };
1110
+ };
1111
+ };
1112
+ };
1113
+ };
1114
+ };
1115
+ };
1116
+ }, _$_better_auth_passkey_client0.PublicKeyCredentialCreationOptionsJSON>;
1117
+ generatePasskeyAuthenticationOptions: _$better_auth0.StrictEndpoint<"/passkey/generate-authenticate-options", {
1118
+ method: "GET";
1119
+ metadata: {
1120
+ openapi: {
1121
+ operationId: string;
1122
+ description: string;
1123
+ responses: {
1124
+ 200: {
1125
+ description: string;
1126
+ content: {
1127
+ "application/json": {
1128
+ schema: {
1129
+ type: "object";
1130
+ properties: {
1131
+ challenge: {
1132
+ type: string;
1133
+ };
1134
+ rp: {
1135
+ type: string;
1136
+ properties: {
1137
+ name: {
1138
+ type: string;
1139
+ };
1140
+ id: {
1141
+ type: string;
1142
+ };
1143
+ };
1144
+ };
1145
+ user: {
1146
+ type: string;
1147
+ properties: {
1148
+ id: {
1149
+ type: string;
1150
+ };
1151
+ name: {
1152
+ type: string;
1153
+ };
1154
+ displayName: {
1155
+ type: string;
1156
+ };
1157
+ };
1158
+ };
1159
+ timeout: {
1160
+ type: string;
1161
+ };
1162
+ allowCredentials: {
1163
+ type: string;
1164
+ items: {
1165
+ type: string;
1166
+ properties: {
1167
+ id: {
1168
+ type: string;
1169
+ };
1170
+ type: {
1171
+ type: string;
1172
+ };
1173
+ transports: {
1174
+ type: string;
1175
+ items: {
1176
+ type: string;
1177
+ };
1178
+ };
1179
+ };
1180
+ };
1181
+ };
1182
+ userVerification: {
1183
+ type: string;
1184
+ };
1185
+ authenticatorSelection: {
1186
+ type: string;
1187
+ properties: {
1188
+ authenticatorAttachment: {
1189
+ type: string;
1190
+ };
1191
+ requireResidentKey: {
1192
+ type: string;
1193
+ };
1194
+ userVerification: {
1195
+ type: string;
1196
+ };
1197
+ };
1198
+ };
1199
+ extensions: {
1200
+ type: string;
1201
+ };
1202
+ };
1203
+ };
1204
+ };
1205
+ };
1206
+ };
1207
+ };
1208
+ };
1209
+ };
1210
+ }, _$_better_auth_passkey_client0.PublicKeyCredentialRequestOptionsJSON>;
1211
+ verifyPasskeyRegistration: _$better_auth0.StrictEndpoint<"/passkey/verify-registration", {
1212
+ method: "POST";
1213
+ body: _$zod.ZodObject<{
1214
+ response: _$zod.ZodAny;
1215
+ name: _$zod.ZodOptional<_$zod.ZodString>;
1216
+ createSession: _$zod.ZodOptional<_$zod.ZodBoolean>;
1217
+ }, _$zod_v4_core0.$strip>;
1218
+ use: _$better_auth0.Middleware<_$better_auth0.MiddlewareOptions, (inputContext: _$better_auth0.MiddlewareInputContext<_$better_auth0.MiddlewareOptions>) => Promise<{
1219
+ session: {
1220
+ session: Record<string, any> & {
1221
+ id: string;
1222
+ createdAt: Date;
1223
+ updatedAt: Date;
1224
+ userId: string;
1225
+ expiresAt: Date;
1226
+ token: string;
1227
+ ipAddress?: string | null | undefined;
1228
+ userAgent?: string | null | undefined;
1229
+ };
1230
+ user: Record<string, any> & {
1231
+ id: string;
1232
+ createdAt: Date;
1233
+ updatedAt: Date;
1234
+ email: string;
1235
+ emailVerified: boolean;
1236
+ name: string;
1237
+ image?: string | null | undefined;
1238
+ };
1239
+ };
1240
+ }>>[];
1241
+ metadata: {
1242
+ openapi: {
1243
+ operationId: string;
1244
+ description: string;
1245
+ responses: {
1246
+ 200: {
1247
+ description: string;
1248
+ content: {
1249
+ "application/json": {
1250
+ schema: {
1251
+ readonly type: "object";
1252
+ readonly allOf: readonly [{
1253
+ readonly $ref: "#/components/schemas/Passkey";
1254
+ }, {
1255
+ readonly type: "object";
1256
+ readonly properties: {
1257
+ readonly session: {
1258
+ readonly $ref: "#/components/schemas/Session";
1259
+ };
1260
+ readonly user: {
1261
+ readonly $ref: "#/components/schemas/User";
1262
+ };
1263
+ };
1264
+ }];
1265
+ };
1266
+ };
1267
+ };
1268
+ };
1269
+ 400: {
1270
+ description: string;
1271
+ };
1272
+ };
1273
+ };
1274
+ };
1275
+ }, _$_better_auth_passkey0.Passkey>;
1276
+ verifyPasskeyAuthentication: _$better_auth0.StrictEndpoint<"/passkey/verify-authentication", {
1277
+ method: "POST";
1278
+ body: _$zod.ZodObject<{
1279
+ response: _$zod.ZodRecord<_$zod.ZodAny, _$zod.ZodAny>;
1280
+ }, _$zod_v4_core0.$strip>;
1281
+ metadata: {
1282
+ openapi: {
1283
+ operationId: string;
1284
+ description: string;
1285
+ responses: {
1286
+ 200: {
1287
+ description: string;
1288
+ content: {
1289
+ "application/json": {
1290
+ schema: {
1291
+ type: "object";
1292
+ properties: {
1293
+ session: {
1294
+ $ref: string;
1295
+ };
1296
+ user: {
1297
+ $ref: string;
1298
+ };
1299
+ };
1300
+ };
1301
+ };
1302
+ };
1303
+ };
1304
+ };
1305
+ };
1306
+ $Infer: {
1307
+ body: {
1308
+ response: _$_better_auth_passkey_client0.AuthenticationResponseJSON;
1309
+ };
1310
+ };
1311
+ };
1312
+ }, {
1313
+ session: {
1314
+ id: string;
1315
+ createdAt: Date;
1316
+ updatedAt: Date;
1317
+ userId: string;
1318
+ expiresAt: Date;
1319
+ token: string;
1320
+ ipAddress?: string | null | undefined;
1321
+ userAgent?: string | null | undefined;
1322
+ };
1323
+ user: {
1324
+ id: string;
1325
+ createdAt: Date;
1326
+ updatedAt: Date;
1327
+ email: string;
1328
+ emailVerified: boolean;
1329
+ name: string;
1330
+ image?: string | null | undefined;
1331
+ };
1332
+ }>;
1333
+ listPasskeys: _$better_auth0.StrictEndpoint<"/passkey/list-user-passkeys", {
1334
+ method: "GET";
1335
+ use: _$better_auth0.Middleware<_$better_auth0.MiddlewareOptions, (inputContext: _$better_auth0.MiddlewareInputContext<_$better_auth0.MiddlewareOptions>) => Promise<{
1336
+ session: {
1337
+ session: Record<string, any> & {
1338
+ id: string;
1339
+ createdAt: Date;
1340
+ updatedAt: Date;
1341
+ userId: string;
1342
+ expiresAt: Date;
1343
+ token: string;
1344
+ ipAddress?: string | null | undefined;
1345
+ userAgent?: string | null | undefined;
1346
+ };
1347
+ user: Record<string, any> & {
1348
+ id: string;
1349
+ createdAt: Date;
1350
+ updatedAt: Date;
1351
+ email: string;
1352
+ emailVerified: boolean;
1353
+ name: string;
1354
+ image?: string | null | undefined;
1355
+ };
1356
+ };
1357
+ }>>[];
1358
+ metadata: {
1359
+ openapi: {
1360
+ description: string;
1361
+ responses: {
1362
+ "200": {
1363
+ description: string;
1364
+ content: {
1365
+ "application/json": {
1366
+ schema: {
1367
+ type: "array";
1368
+ items: {
1369
+ $ref: string;
1370
+ required: string[];
1371
+ };
1372
+ description: string;
1373
+ };
1374
+ };
1375
+ };
1376
+ };
1377
+ };
1378
+ };
1379
+ };
1380
+ }, _$_better_auth_passkey0.Passkey[]>;
1381
+ deletePasskey: _$better_auth0.StrictEndpoint<"/passkey/delete-passkey", {
1382
+ method: "POST";
1383
+ body: _$zod.ZodObject<{
1384
+ id: _$zod.ZodString;
1385
+ }, _$zod_v4_core0.$strip>;
1386
+ use: (_$better_auth0.Middleware<_$better_auth0.MiddlewareOptions, (inputContext: _$better_auth0.MiddlewareInputContext<_$better_auth0.MiddlewareOptions>) => Promise<{
1387
+ session: {
1388
+ session: Record<string, any> & {
1389
+ id: string;
1390
+ createdAt: Date;
1391
+ updatedAt: Date;
1392
+ userId: string;
1393
+ expiresAt: Date;
1394
+ token: string;
1395
+ ipAddress?: string | null | undefined;
1396
+ userAgent?: string | null | undefined;
1397
+ };
1398
+ user: Record<string, any> & {
1399
+ id: string;
1400
+ createdAt: Date;
1401
+ updatedAt: Date;
1402
+ email: string;
1403
+ emailVerified: boolean;
1404
+ name: string;
1405
+ image?: string | null | undefined;
1406
+ };
1407
+ };
1408
+ }>> | _$better_auth0.Middleware<_$better_auth0.MiddlewareOptions, (inputContext: _$better_auth0.MiddlewareInputContext<_$better_auth0.MiddlewareOptions>) => Promise<{
1409
+ verifiedResource: {};
1410
+ }>>)[];
1411
+ metadata: {
1412
+ openapi: {
1413
+ description: string;
1414
+ responses: {
1415
+ "200": {
1416
+ description: string;
1417
+ content: {
1418
+ "application/json": {
1419
+ schema: {
1420
+ type: "object";
1421
+ properties: {
1422
+ status: {
1423
+ type: string;
1424
+ description: string;
1425
+ };
1426
+ };
1427
+ required: string[];
1428
+ };
1429
+ };
1430
+ };
1431
+ };
1432
+ };
1433
+ };
1434
+ };
1435
+ }, {
1436
+ status: boolean;
1437
+ }>;
1438
+ updatePasskey: _$better_auth0.StrictEndpoint<"/passkey/update-passkey", {
1439
+ method: "POST";
1440
+ body: _$zod.ZodObject<{
1441
+ id: _$zod.ZodString;
1442
+ name: _$zod.ZodString;
1443
+ }, _$zod_v4_core0.$strip>;
1444
+ use: (_$better_auth0.Middleware<_$better_auth0.MiddlewareOptions, (inputContext: _$better_auth0.MiddlewareInputContext<_$better_auth0.MiddlewareOptions>) => Promise<{
1445
+ session: {
1446
+ session: Record<string, any> & {
1447
+ id: string;
1448
+ createdAt: Date;
1449
+ updatedAt: Date;
1450
+ userId: string;
1451
+ expiresAt: Date;
1452
+ token: string;
1453
+ ipAddress?: string | null | undefined;
1454
+ userAgent?: string | null | undefined;
1455
+ };
1456
+ user: Record<string, any> & {
1457
+ id: string;
1458
+ createdAt: Date;
1459
+ updatedAt: Date;
1460
+ email: string;
1461
+ emailVerified: boolean;
1462
+ name: string;
1463
+ image?: string | null | undefined;
1464
+ };
1465
+ };
1466
+ }>> | _$better_auth0.Middleware<_$better_auth0.MiddlewareOptions, (inputContext: _$better_auth0.MiddlewareInputContext<_$better_auth0.MiddlewareOptions>) => Promise<{
1467
+ verifiedResource: {};
1468
+ }>>)[];
1469
+ metadata: {
1470
+ openapi: {
1471
+ description: string;
1472
+ responses: {
1473
+ "200": {
1474
+ description: string;
1475
+ content: {
1476
+ "application/json": {
1477
+ schema: {
1478
+ type: "object";
1479
+ properties: {
1480
+ passkey: {
1481
+ $ref: string;
1482
+ };
1483
+ };
1484
+ required: string[];
1485
+ };
1486
+ };
1487
+ };
1488
+ };
1489
+ };
1490
+ };
1491
+ };
1492
+ }, {
1493
+ passkey: _$_better_auth_passkey0.Passkey;
1494
+ }>;
1495
+ };
1496
+ schema: {
1497
+ passkey: {
1498
+ fields: {
1499
+ name: {
1500
+ type: "string";
1501
+ required: false;
1502
+ };
1503
+ publicKey: {
1504
+ type: "string";
1505
+ required: true;
1506
+ };
1507
+ userId: {
1508
+ type: "string";
1509
+ references: {
1510
+ model: string;
1511
+ field: string;
1512
+ };
1513
+ required: true;
1514
+ index: true;
1515
+ };
1516
+ credentialID: {
1517
+ type: "string";
1518
+ required: true;
1519
+ index: true;
1520
+ };
1521
+ counter: {
1522
+ type: "number";
1523
+ required: true;
1524
+ };
1525
+ deviceType: {
1526
+ type: "string";
1527
+ required: true;
1528
+ };
1529
+ backedUp: {
1530
+ type: "boolean";
1531
+ required: true;
1532
+ };
1533
+ transports: {
1534
+ type: "string";
1535
+ required: false;
1536
+ };
1537
+ createdAt: {
1538
+ type: "date";
1539
+ required: false;
1540
+ };
1541
+ aaguid: {
1542
+ type: "string";
1543
+ required: false;
1544
+ };
1545
+ };
1546
+ };
1547
+ };
1548
+ $ERROR_CODES: {
1549
+ CHALLENGE_NOT_FOUND: _$better_auth0.RawError<"CHALLENGE_NOT_FOUND">;
1550
+ YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: _$better_auth0.RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
1551
+ FAILED_TO_VERIFY_REGISTRATION: _$better_auth0.RawError<"FAILED_TO_VERIFY_REGISTRATION">;
1552
+ PASSKEY_NOT_FOUND: _$better_auth0.RawError<"PASSKEY_NOT_FOUND">;
1553
+ AUTHENTICATION_FAILED: _$better_auth0.RawError<"AUTHENTICATION_FAILED">;
1554
+ UNABLE_TO_CREATE_SESSION: _$better_auth0.RawError<"UNABLE_TO_CREATE_SESSION">;
1555
+ USER_NOT_FOUND: _$better_auth0.RawError<"USER_NOT_FOUND">;
1556
+ FAILED_TO_UPDATE_PASSKEY: _$better_auth0.RawError<"FAILED_TO_UPDATE_PASSKEY">;
1557
+ PREVIOUSLY_REGISTERED: _$better_auth0.RawError<"PREVIOUSLY_REGISTERED">;
1558
+ REGISTRATION_CANCELLED: _$better_auth0.RawError<"REGISTRATION_CANCELLED">;
1559
+ AUTH_CANCELLED: _$better_auth0.RawError<"AUTH_CANCELLED">;
1560
+ UNKNOWN_ERROR: _$better_auth0.RawError<"UNKNOWN_ERROR">;
1561
+ SESSION_REQUIRED: _$better_auth0.RawError<"SESSION_REQUIRED">;
1562
+ RESOLVE_USER_REQUIRED: _$better_auth0.RawError<"RESOLVE_USER_REQUIRED">;
1563
+ RESOLVED_USER_INVALID: _$better_auth0.RawError<"RESOLVED_USER_INVALID">;
1564
+ };
1565
+ options: _$_better_auth_passkey0.PasskeyOptions | undefined;
1566
+ }>;
1567
+ getActions: ($fetch: _$better_auth_client0.BetterFetch, $store: _$better_auth0.ClientStore) => {
1568
+ signIn: {
1569
+ passkey: (opts?: {
1570
+ autoFill?: boolean;
1571
+ extensions?: _$_better_auth_passkey_client0.AuthenticationExtensionsClientInputs;
1572
+ returnWebAuthnResponse?: boolean;
1573
+ fetchOptions?: _$better_auth0.ClientFetchOption;
1574
+ } | undefined, options?: _$better_auth0.ClientFetchOption | undefined) => Promise<{
1575
+ data: null;
1576
+ error: {
1577
+ message?: string | undefined;
1578
+ status: number;
1579
+ statusText: string;
1580
+ };
1581
+ } | {
1582
+ data: {
1583
+ session: _$better_auth0.Session;
1584
+ user: _$better_auth0.User;
1585
+ };
1586
+ error: null;
1587
+ } | {
1588
+ data: null;
1589
+ error: {
1590
+ code: string;
1591
+ message: string;
1592
+ status: number;
1593
+ statusText: string;
1594
+ };
1595
+ } | {
1596
+ webauthn: {
1597
+ response: _$_better_auth_passkey_client0.AuthenticationResponseJSON;
1598
+ clientExtensionResults: _$_better_auth_passkey_client0.AuthenticationExtensionsClientOutputs;
1599
+ };
1600
+ data: null;
1601
+ error: {
1602
+ message?: string | undefined;
1603
+ status: number;
1604
+ statusText: string;
1605
+ };
1606
+ } | {
1607
+ webauthn: {
1608
+ response: _$_better_auth_passkey_client0.AuthenticationResponseJSON;
1609
+ clientExtensionResults: _$_better_auth_passkey_client0.AuthenticationExtensionsClientOutputs;
1610
+ };
1611
+ data: {
1612
+ session: _$better_auth0.Session;
1613
+ user: _$better_auth0.User;
1614
+ };
1615
+ error: null;
1616
+ }>;
1617
+ };
1618
+ passkey: {
1619
+ addPasskey: (opts?: {
1620
+ fetchOptions?: _$better_auth0.ClientFetchOption;
1621
+ name?: string;
1622
+ authenticatorAttachment?: "platform" | "cross-platform";
1623
+ context?: string | null;
1624
+ createSession?: boolean;
1625
+ extensions?: _$_better_auth_passkey_client0.AuthenticationExtensionsClientInputs;
1626
+ useAutoRegister?: boolean;
1627
+ returnWebAuthnResponse?: boolean;
1628
+ } | undefined, fetchOpts?: _$better_auth0.ClientFetchOption | undefined) => Promise<{
1629
+ data: null;
1630
+ error: {
1631
+ message?: string | undefined;
1632
+ status: number;
1633
+ statusText: string;
1634
+ };
1635
+ } | {
1636
+ data: _$_better_auth_passkey0.Passkey & {
1637
+ session?: _$better_auth0.Session;
1638
+ user?: _$better_auth0.User;
1639
+ };
1640
+ error: null;
1641
+ } | {
1642
+ webauthn: {
1643
+ response: _$_better_auth_passkey_client0.RegistrationResponseJSON;
1644
+ clientExtensionResults: _$_better_auth_passkey_client0.AuthenticationExtensionsClientOutputs;
1645
+ };
1646
+ data: _$_better_auth_passkey0.Passkey & {
1647
+ session?: _$better_auth0.Session;
1648
+ user?: _$better_auth0.User;
1649
+ };
1650
+ error: null;
1651
+ } | {
1652
+ data: null;
1653
+ error: {
1654
+ code: string;
1655
+ message: string;
1656
+ status: number;
1657
+ statusText: string;
1658
+ };
1659
+ }>;
1660
+ };
1661
+ $Infer: {
1662
+ Passkey: _$_better_auth_passkey0.Passkey;
1663
+ };
1664
+ };
1665
+ getAtoms($fetch: _$better_auth_client0.BetterFetch): {
1666
+ listPasskeys: _$better_auth_client0.AuthQueryAtom<_$_better_auth_passkey0.Passkey[]>;
1667
+ $listPasskeys: _$better_auth_client0.PreinitializedWritableAtom<any> & object;
1668
+ };
1669
+ pathMethods: {
1670
+ "/passkey/register": "POST";
1671
+ "/passkey/authenticate": "POST";
1672
+ };
1673
+ atomListeners: ({
1674
+ matcher(path: string): path is "/passkey/delete-passkey" | "/passkey/update-passkey" | "/passkey/verify-registration" | "/sign-out";
1675
+ signal: "$listPasskeys";
1676
+ } | {
1677
+ matcher: (path: string) => path is "/passkey/verify-authentication";
1678
+ signal: "$sessionSignal";
1679
+ })[];
1680
+ $ERROR_CODES: {
1681
+ CHALLENGE_NOT_FOUND: _$better_auth0.RawError<"CHALLENGE_NOT_FOUND">;
1682
+ YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: _$better_auth0.RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
1683
+ FAILED_TO_VERIFY_REGISTRATION: _$better_auth0.RawError<"FAILED_TO_VERIFY_REGISTRATION">;
1684
+ PASSKEY_NOT_FOUND: _$better_auth0.RawError<"PASSKEY_NOT_FOUND">;
1685
+ AUTHENTICATION_FAILED: _$better_auth0.RawError<"AUTHENTICATION_FAILED">;
1686
+ UNABLE_TO_CREATE_SESSION: _$better_auth0.RawError<"UNABLE_TO_CREATE_SESSION">;
1687
+ USER_NOT_FOUND: _$better_auth0.RawError<"USER_NOT_FOUND">;
1688
+ FAILED_TO_UPDATE_PASSKEY: _$better_auth0.RawError<"FAILED_TO_UPDATE_PASSKEY">;
1689
+ PREVIOUSLY_REGISTERED: _$better_auth0.RawError<"PREVIOUSLY_REGISTERED">;
1690
+ REGISTRATION_CANCELLED: _$better_auth0.RawError<"REGISTRATION_CANCELLED">;
1691
+ AUTH_CANCELLED: _$better_auth0.RawError<"AUTH_CANCELLED">;
1692
+ UNKNOWN_ERROR: _$better_auth0.RawError<"UNKNOWN_ERROR">;
1693
+ SESSION_REQUIRED: _$better_auth0.RawError<"SESSION_REQUIRED">;
1694
+ RESOLVE_USER_REQUIRED: _$better_auth0.RawError<"RESOLVE_USER_REQUIRED">;
1695
+ RESOLVED_USER_INVALID: _$better_auth0.RawError<"RESOLVED_USER_INVALID">;
1696
+ };
1697
+ })[];
1698
+ }>;
1699
+ type BetterAuthClient = ReturnType<typeof createBetterAuthClient>;
1700
+ //#endregion
149
1701
  //#region src/analytics.d.ts
1702
+ /**
1703
+ * Re-exported as a local binding: re-exporting the const directly from the
1704
+ * bundled `@us-auth/types` package trips the declaration bundler.
1705
+ */
1706
+ declare const ANALYTICS_EVENTS: {
1707
+ readonly USER_SIGNED_UP: "user signed up";
1708
+ readonly USER_LOGGED_IN: "user logged in";
1709
+ readonly TRIAL_STARTED: "trial started";
1710
+ readonly CHECKOUT_STARTED: "checkout started";
1711
+ readonly CHECKOUT_COMPLETED: "checkout completed";
1712
+ readonly FEATURE_USED: "feature used";
1713
+ };
150
1714
  interface PostHogAnalyticsClient {
151
1715
  capture: (event: string, properties?: Record<string, unknown>) => void;
152
1716
  register?: (properties: Record<string, unknown>) => void;
@@ -161,6 +1725,178 @@ declare function captureCheckoutStarted(ph: PostHogAnalyticsClient | null | unde
161
1725
  product?: AnalyticsProduct;
162
1726
  }): void;
163
1727
  //#endregion
1728
+ //#region src/consent/store.d.ts
1729
+ type Listener = () => void;
1730
+ /**
1731
+ * The imperative consent API. This is the single source of truth for the
1732
+ * banner and works without React.
1733
+ */
1734
+ declare function getConsent(): ConsentState;
1735
+ declare function isConsentPending(): boolean;
1736
+ declare function subscribeConsent(listener: Listener): () => void;
1737
+ /** Overrides the cookie domain; `undefined` derives it, `""` forces host-only. */
1738
+ declare function configureConsentDomain(domain: string | undefined): void;
1739
+ /** Parent domain for consent and legacy-tracking cookie expiry. */
1740
+ declare function resolveConsentCookieDomain(): string | undefined;
1741
+ /** Writes the decision and notifies subscribers. The only consent writer. */
1742
+ declare function setConsent(consent: TrackingConsent): void;
1743
+ /** Re-reads the cookie and notifies only when the decision changed. */
1744
+ declare function refreshConsent(): void;
1745
+ //#endregion
1746
+ //#region src/consent/useTrackingConsent.d.ts
1747
+ interface TrackingConsentApi {
1748
+ consent: ConsentState;
1749
+ pending: boolean;
1750
+ setConsent: (consent: {
1751
+ analytics: boolean;
1752
+ marketing: boolean;
1753
+ }) => void;
1754
+ }
1755
+ /**
1756
+ * Banner-facing hook. Works without `TrackingProvider` because it reads the
1757
+ * consent store directly.
1758
+ */
1759
+ declare function useTrackingConsent(): TrackingConsentApi;
1760
+ //#endregion
1761
+ //#region src/tracking/consentAction.d.ts
1762
+ /**
1763
+ * Pure mapping from consent state to the PostHog consent action.
1764
+ * Kept separate from the PostHog import so it is trivially testable.
1765
+ */
1766
+ declare function posthogConsentAction(consent: ConsentState): "opt_in" | "opt_out";
1767
+ //#endregion
1768
+ //#region src/tracking/posthog.d.ts
1769
+ interface PostHogConfigInput {
1770
+ apiKey: string;
1771
+ apiHost: string;
1772
+ uiHost?: string;
1773
+ }
1774
+ declare function getOrInitPostHog(config: PostHogConfigInput): PostHog | null;
1775
+ /** Returns the PostHog singleton initialized by `TrackingProvider`, if any. */
1776
+ declare function getPostHog(): PostHog | null;
1777
+ /**
1778
+ * Mirrors the `uninspired_consent` decision into PostHog's own consent state.
1779
+ *
1780
+ * - granted → `opt_in_capturing()` upgrades to cookies + identify live
1781
+ * - pending → `opt_out_capturing()` keeps capturing cookielessly
1782
+ * - denied → same as pending (cookieless capture continues)
1783
+ */
1784
+ declare function syncPostHogConsent(ph: PostHog | null, consent: ConsentState): void;
1785
+ //#endregion
1786
+ //#region src/tracking/TrackingClient.d.ts
1787
+ interface TrackingClientOptions {
1788
+ product: AnalyticsProduct;
1789
+ /** `null` disables PostHog entirely (product apps without analytics config). */
1790
+ posthog: PostHogConfigInput | null;
1791
+ metaPixelId?: string;
1792
+ /** `undefined` derives the domain, `""` forces a host-only cookie. */
1793
+ consentCookieDomain?: string;
1794
+ }
1795
+ interface ViewContentOptions {
1796
+ contentId: string;
1797
+ value?: number;
1798
+ currency?: string;
1799
+ }
1800
+ interface InitiateCheckoutOptions {
1801
+ contentIds?: string[];
1802
+ value?: number;
1803
+ currency?: string;
1804
+ }
1805
+ interface PurchaseOptions {
1806
+ value?: number;
1807
+ currency?: string;
1808
+ contentIds?: string[];
1809
+ /** Paddle transaction id — lets Meta dedupe repeated browser events. */
1810
+ eventId?: string;
1811
+ }
1812
+ /**
1813
+ * Owns PostHog initialization and the Meta Pixel lifecycle for an app.
1814
+ *
1815
+ * PostHog capture always works (cookieless while pending/denied, full when
1816
+ * granted); `identify` and every Meta call are consent-gated.
1817
+ */
1818
+ declare class TrackingClient {
1819
+ #private;
1820
+ readonly ph: PostHog | null;
1821
+ readonly product: AnalyticsProduct;
1822
+ constructor(options: TrackingClientOptions);
1823
+ start(): void;
1824
+ stop(): void;
1825
+ getConsent(): ConsentState;
1826
+ setConsent(consent: TrackingConsent): void;
1827
+ capture(event: string, properties?: Record<string, unknown>): void;
1828
+ captureException(error: unknown, properties?: Record<string, unknown>): void;
1829
+ identify(userId: string): void;
1830
+ reset(): void;
1831
+ getFeatureFlag(key: string): boolean | string | undefined;
1832
+ registerProduct(product: AnalyticsProduct): void;
1833
+ captureFeatureUsed(featureName: string, extra?: Record<string, unknown>): void;
1834
+ captureCheckoutStarted(options: {
1835
+ plan: string;
1836
+ product?: AnalyticsProduct;
1837
+ }): void;
1838
+ trackPageView(): void;
1839
+ trackViewContent({
1840
+ contentId,
1841
+ value,
1842
+ currency
1843
+ }: ViewContentOptions): void;
1844
+ trackInitiateCheckout({
1845
+ contentIds,
1846
+ value,
1847
+ currency
1848
+ }?: InitiateCheckoutOptions): void;
1849
+ trackPurchase({
1850
+ value,
1851
+ currency,
1852
+ contentIds,
1853
+ eventId
1854
+ }?: PurchaseOptions): void;
1855
+ }
1856
+ //#endregion
1857
+ //#region src/tracking/TrackingProvider.d.ts
1858
+ interface TrackingProviderProps extends TrackingClientOptions, PropsWithChildren {}
1859
+ /**
1860
+ * Mount once per app, above `AuthProvider`. Owns PostHog init and the Meta
1861
+ * Pixel lifecycle, both driven by the shared consent cookie.
1862
+ */
1863
+ declare const TrackingProvider: ({
1864
+ children,
1865
+ ...options
1866
+ }: TrackingProviderProps) => _$react.JSX.Element;
1867
+ //#endregion
1868
+ //#region src/tracking/useTracking.d.ts
1869
+ /**
1870
+ * Returns the app's `TrackingClient`, or `null` when no `TrackingProvider`
1871
+ * wraps the tree (in which case all analytics no-op).
1872
+ */
1873
+ declare function useTracking(): TrackingClient | null;
1874
+ //#endregion
1875
+ //#region src/tracking/metaPixel.d.ts
1876
+ /** Injects the Meta Pixel base code and fires an initial PageView. Idempotent. */
1877
+ declare function loadMetaPixel(pixelId: string): void;
1878
+ declare function isMetaPixelLoaded(): boolean;
1879
+ /**
1880
+ * Tells an already-loaded pixel to stop sending when marketing consent is
1881
+ * withdrawn. Does not unload the script or clear cookies.
1882
+ */
1883
+ declare function revokeMetaPixelConsent(): void;
1884
+ /** Fires a standard pixel event; `eventId` lets Meta dedupe on reloads. */
1885
+ declare function trackMetaPixel(event: string, params?: Record<string, unknown>, eventId?: string): void;
1886
+ //#endregion
1887
+ //#region src/tracking/redaction.d.ts
1888
+ type RedactableEvent = {
1889
+ properties?: Record<string, unknown>;
1890
+ };
1891
+ /**
1892
+ * Strips URL query strings and short-link passphrases from every event before
1893
+ * it leaves the browser. Together with `mask_all_text` this keeps autocapture
1894
+ * and pageviews PII-free without disabling them.
1895
+ *
1896
+ * Applies in every consent mode: it is PII hygiene, not a consent mitigation.
1897
+ */
1898
+ declare function redactBeforeSend<T extends RedactableEvent | null>(event: T): T;
1899
+ //#endregion
164
1900
  //#region src/react/AuthContext.d.ts
165
1901
  type AuthContextType = {
166
1902
  session: Session | null;
@@ -172,9 +1908,6 @@ type AuthContextType = {
172
1908
  signOut: AuthClient["signOut"];
173
1909
  getLoginUrl: AuthClient["getLoginUrl"];
174
1910
  getCheckoutUrl: AuthClient["getCheckoutUrl"];
175
- trackMetaEvent: AuthClient["trackMetaEvent"];
176
- trackViewContent: AuthClient["trackViewContent"];
177
- getMetaAttribution: AuthClient["getMetaAttribution"];
178
1911
  captureFeatureUsed: (featureName: string, extra?: Record<string, unknown>) => void;
179
1912
  captureCheckoutStarted: (options: {
180
1913
  plan: string;
@@ -206,7 +1939,7 @@ declare const AuthProvider: ({
206
1939
  initialPurchases,
207
1940
  authClient: providedAuthClient,
208
1941
  queryClient: providedQueryClient
209
- }: AuthProviderProps) => _$react_jsx_runtime0.JSX.Element;
1942
+ }: AuthProviderProps) => _$react.JSX.Element;
210
1943
  //#endregion
211
1944
  //#region src/react/useAuth.d.ts
212
1945
  declare function useAuth(): {
@@ -219,9 +1952,6 @@ declare function useAuth(): {
219
1952
  signOut: AuthClient["signOut"];
220
1953
  getLoginUrl: AuthClient["getLoginUrl"];
221
1954
  getCheckoutUrl: AuthClient["getCheckoutUrl"];
222
- trackMetaEvent: AuthClient["trackMetaEvent"];
223
- trackViewContent: AuthClient["trackViewContent"];
224
- getMetaAttribution: AuthClient["getMetaAttribution"];
225
1955
  captureFeatureUsed: (featureName: string, extra?: Record<string, unknown>) => void;
226
1956
  captureCheckoutStarted: (options: {
227
1957
  plan: string;
@@ -233,5 +1963,65 @@ declare function useAuth(): {
233
1963
  isLoggedIn: boolean;
234
1964
  };
235
1965
  //#endregion
236
- export { ANALYTICS_EVENTS, ANALYTICS_PRODUCTS, type AnalyticsEvent, type AnalyticsProduct, AuthClient, AuthContext, AuthContextType, type AuthMethod, AuthProvider, AuthProviderProps, type MetaAttributionCookies, PostHogAnalyticsClient, type Session, type UserPurchases, buildFbcFromFbclid, captureCheckoutStarted, captureFeatureUsed, captureMetaClickId, getMetaCookieDomain, isAnalyticsProduct, parseMetaAttributionFromCookieHeader, readMetaAttributionCookies, registerProduct, useAuth };
1966
+ //#region src/react/useEmailOtpLoginFlow.d.ts
1967
+ type EmailOtpAuthClient = {
1968
+ emailOtp: {
1969
+ sendVerificationOtp: (input: {
1970
+ email: string;
1971
+ type: "sign-in";
1972
+ }) => Promise<{
1973
+ error?: unknown;
1974
+ }>;
1975
+ };
1976
+ signIn: {
1977
+ emailOtp: (input: {
1978
+ email: string;
1979
+ otp: string;
1980
+ }) => Promise<{
1981
+ error?: unknown;
1982
+ }>;
1983
+ };
1984
+ };
1985
+ type EmailOtpLoginFlowOptions = {
1986
+ authClient: EmailOtpAuthClient;
1987
+ onVerified: () => void | Promise<void>;
1988
+ onSendSuccess?: () => void;
1989
+ onSendError?: (error: unknown) => void;
1990
+ onVerifyError?: (error: unknown) => void;
1991
+ resendCooldownSeconds?: number;
1992
+ };
1993
+ declare function useEmailOtpLoginFlow({
1994
+ authClient,
1995
+ onVerified,
1996
+ onSendSuccess,
1997
+ onSendError,
1998
+ onVerifyError,
1999
+ resendCooldownSeconds
2000
+ }: EmailOtpLoginFlowOptions): {
2001
+ step: "email" | "otp";
2002
+ email: string;
2003
+ setEmail: _$react.Dispatch<_$react.SetStateAction<string>>;
2004
+ otp: string;
2005
+ setOtp: _$react.Dispatch<_$react.SetStateAction<string>>;
2006
+ emailValid: boolean;
2007
+ otpValid: boolean;
2008
+ submitting: boolean;
2009
+ verifying: boolean;
2010
+ resending: boolean;
2011
+ remainingSeconds: number;
2012
+ isCoolingDown: boolean;
2013
+ submitEmail: () => Promise<void>;
2014
+ resendOtp: () => Promise<void>;
2015
+ verifyOtp: () => Promise<void>;
2016
+ backToEmail: () => void;
2017
+ setNow: _$react.Dispatch<_$react.SetStateAction<number>>;
2018
+ availableAt: number;
2019
+ };
2020
+ //#endregion
2021
+ //#region src/react/resendCooldown.d.ts
2022
+ declare const RESEND_COOLDOWN_SECONDS = 30;
2023
+ declare function remainingCooldownSeconds(availableAt: number, now: number): number;
2024
+ declare function resendButtonLabel(label: string, remainingSeconds: number): string;
2025
+ //#endregion
2026
+ export { ANALYTICS_EVENTS, type AnalyticsProduct, AuthClient, AuthContext, AuthContextType, type AuthMethod, AuthProvider, AuthProviderProps, type BetterAuthClient, EmailOtpAuthClient, EmailOtpLoginFlowOptions, type InitiateCheckoutOptions, PostHogAnalyticsClient, type PostHogConfigInput, PostHogProvider, type PurchaseOptions, RESEND_COOLDOWN_SECONDS, type Session, TrackingClient, type TrackingClientOptions, type TrackingConsentApi, TrackingProvider, type TrackingProviderProps, type UserPurchases, type ViewContentOptions, captureCheckoutStarted, captureFeatureUsed, configureConsentDomain, createBetterAuthClient, getConsent, getOrInitPostHog, getPostHog, isAnalyticsProduct, isConsentPending, isMetaPixelLoaded, loadMetaPixel, posthogConsentAction, redactBeforeSend, refreshConsent, registerProduct, remainingCooldownSeconds, resendButtonLabel, resolveConsentCookieDomain, revokeMetaPixelConsent, setConsent, subscribeConsent, syncPostHogConsent, trackMetaPixel, useAuth, useEmailOtpLoginFlow, useFeatureFlagEnabled, useFeatureFlagVariantKey, usePostHog, useTracking, useTrackingConsent };
237
2027
  //# sourceMappingURL=index.d.ts.map