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