@neondatabase/auth 0.1.0-beta.9 → 0.3.0-beta

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.
Files changed (46) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +108 -18
  3. package/dist/{adapter-core-Bw9mn_AS.d.mts → adapter-core-B9uDhoYq.d.mts} +270 -375
  4. package/dist/{adapter-core-C_NEMs0b.mjs → adapter-core-D00qcqMo.mjs} +392 -67
  5. package/dist/better-auth-react-adapter-BO4jLN4H.d.mts +2170 -0
  6. package/dist/{better-auth-react-adapter-BbM3jLLv.mjs → better-auth-react-adapter-Xdj-69i9.mjs} +10 -8
  7. package/dist/constants-Cupc_bln.mjs +28 -0
  8. package/dist/{index-BXlAjlSt.d.mts → index-B_Q0Tp1D.d.mts} +0 -1
  9. package/dist/index.d.mts +13 -19
  10. package/dist/index.mjs +2 -1
  11. package/dist/{neon-auth-DdlToh7_.mjs → neon-auth-DBOB8sXF.mjs} +7 -4
  12. package/dist/next/index.d.mts +77 -186
  13. package/dist/next/index.mjs +4 -311
  14. package/dist/next/server/index.d.mts +536 -0
  15. package/dist/next/server/index.mjs +1461 -0
  16. package/dist/react/adapters/index.d.mts +4 -4
  17. package/dist/react/adapters/index.mjs +2 -1
  18. package/dist/react/index.d.mts +6 -5
  19. package/dist/react/index.mjs +5 -4
  20. package/dist/react/ui/index.d.mts +1 -2
  21. package/dist/react/ui/index.mjs +2 -4
  22. package/dist/react/ui/server.mjs +2 -2
  23. package/dist/{supabase-adapter-CAqbpOC7.mjs → supabase-adapter-CIBMebXB.mjs} +28 -45
  24. package/dist/supabase-adapter-CSDRL1ZU.d.mts +2227 -0
  25. package/dist/types/index.d.mts +2 -7
  26. package/dist/ui/.safelist.html +3 -0
  27. package/dist/ui/css.css +2 -2
  28. package/dist/ui/tailwind.css +2 -1
  29. package/dist/ui/theme-inline.css +44 -0
  30. package/dist/ui/theme.css +103 -76
  31. package/dist/ui-CnVnqGns.mjs +3 -0
  32. package/dist/vanilla/adapters/index.d.mts +3 -3
  33. package/dist/vanilla/adapters/index.mjs +2 -1
  34. package/dist/vanilla/index.d.mts +3 -3
  35. package/dist/vanilla/index.mjs +2 -1
  36. package/llms.txt +330 -0
  37. package/package.json +32 -23
  38. package/dist/better-auth-react-adapter-JoscqoDc.d.mts +0 -722
  39. package/dist/better-auth-types-CE4hLv9E.d.mts +0 -9
  40. package/dist/chunk-5DLVHPZS-Bxj7snpZ-DoVNlsyk.mjs +0 -533
  41. package/dist/supabase-adapter-Clxlqg1x.d.mts +0 -127
  42. package/dist/ui-aMoA-9nq.mjs +0 -9449
  43. /package/dist/{adapters-D0mxG3F-.mjs → adapters-CUvhsAvY.mjs} +0 -0
  44. /package/dist/{adapters-Df6Dd3KK.mjs → adapters-CivF9wql.mjs} +0 -0
  45. /package/dist/{index-ClXLQ1fw.d.mts → index-CPnFzULh.d.mts} +0 -0
  46. /package/dist/{index-DCQ5Y2ED.d.mts → index-UW23fDSn.d.mts} +0 -0
@@ -1,24 +1,69 @@
1
+ import * as better_auth_react1 from "better-auth/react";
1
2
  import { createAuthClient } from "better-auth/react";
2
- import * as better_auth_client11 from "better-auth/client";
3
- import { AuthClient, BetterAuthClientOptions } from "better-auth/client";
4
- import * as better_auth_client_plugins5 from "better-auth/client/plugins";
5
- import * as jose0 from "jose";
3
+ import * as better_auth_client0 from "better-auth/client";
4
+ import { BetterAuthClientOptions, createAuthClient as createAuthClient$1 } from "better-auth/client";
6
5
  import * as zod0 from "zod";
7
- import * as better_auth206 from "better-auth";
8
- import * as _better_fetch_fetch131 from "@better-fetch/fetch";
9
- import * as nanostores1 from "nanostores";
10
- import * as better_call0 from "better-call";
11
- import * as better_auth_plugins_email_otp0 from "better-auth/plugins/email-otp";
6
+ import * as jose1 from "jose";
7
+ import { Session, User } from "better-auth/types";
8
+ import * as better_auth_plugins35 from "better-auth/plugins";
9
+ import * as better_auth303 from "better-auth";
10
+ import * as _better_fetch_fetch177 from "@better-fetch/fetch";
11
+ import { BetterFetchError, BetterFetchError as BetterFetchError$1 } from "@better-fetch/fetch";
12
+ import { Invitation, InvitationInput, InvitationStatus, Member, MemberInput, Organization, OrganizationInput, OrganizationRole, Team, TeamInput, TeamMember, TeamMemberInput } from "better-auth/plugins/organization";
13
+ import { JWKOptions, JWSAlgorithms, Jwk, JwtOptions } from "better-auth/plugins/jwt";
14
+ import { AdminOptions, InferAdminRolesFromOption, SessionWithImpersonatedBy, UserWithRole } from "better-auth/plugins/admin";
15
+ import { EmailOTPOptions } from "better-auth/plugins/email-otp";
12
16
 
17
+ //#region src/core/better-auth-types.d.ts
18
+ type BetterAuthSession = Session;
19
+ type BetterAuthUser = User;
20
+ type BetterAuthErrorResponse = BetterFetchError;
21
+ //#endregion
22
+ //#region src/types/index.d.ts
23
+ /**
24
+ * Type representing the Better Auth React client
25
+ */
26
+ type ReactBetterAuthClient = ReturnType<typeof createAuthClient<{
27
+ plugins: SupportedBetterAuthClientPlugins;
28
+ }>>;
29
+ /**
30
+ * Type representing the Better Auth Vanilla client
31
+ */
32
+ type VanillaBetterAuthClient = ReturnType<typeof createAuthClient$1<{
33
+ plugins: SupportedBetterAuthClientPlugins;
34
+ }>>;
35
+ type BetterAuthInstance = VanillaBetterAuthClient | ReactBetterAuthClient;
36
+ //#endregion
13
37
  //#region src/core/adapter-core.d.ts
14
38
  interface NeonAuthAdapterCoreAuthOptions extends Omit<BetterAuthClientOptions, 'plugins'> {}
15
39
  declare const supportedBetterAuthClientPlugins: ({
40
+ id: "anonymous-token";
41
+ pathMethods: {
42
+ "/token/anonymous": "GET";
43
+ };
44
+ getActions: ($fetch: _better_fetch_fetch177.BetterFetch) => {
45
+ getAnonymousToken: (fetchOptions?: any) => Promise<{
46
+ data: {
47
+ token: string;
48
+ expires_at: number;
49
+ };
50
+ error: null;
51
+ } | {
52
+ data: null;
53
+ error: {
54
+ message?: string | undefined;
55
+ status: number;
56
+ statusText: string;
57
+ };
58
+ }>;
59
+ };
60
+ } | {
16
61
  id: "better-auth-client";
17
- $InferServerPlugin: ReturnType<(options?: better_auth_client_plugins5.JwtOptions | undefined) => {
62
+ $InferServerPlugin: ReturnType<(<O extends better_auth_plugins35.JwtOptions>(options?: O) => {
18
63
  id: "jwt";
19
- options: better_auth_client_plugins5.JwtOptions | undefined;
64
+ options: NoInfer<O>;
20
65
  endpoints: {
21
- getJwks: better_call0.StrictEndpoint<string, {
66
+ getJwks: better_auth303.StrictEndpoint<string, {
22
67
  method: "GET";
23
68
  metadata: {
24
69
  openapi: {
@@ -94,13 +139,11 @@ declare const supportedBetterAuthClientPlugins: ({
94
139
  };
95
140
  };
96
141
  };
97
- } & {
98
- use: any[];
99
- }, jose0.JSONWebKeySet>;
100
- getToken: better_call0.StrictEndpoint<"/token", {
142
+ }, jose1.JSONWebKeySet>;
143
+ getToken: better_auth303.StrictEndpoint<"/token", {
101
144
  method: "GET";
102
145
  requireHeaders: true;
103
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
146
+ use: ((inputContext: better_auth303.MiddlewareInputContext<better_auth303.MiddlewareOptions>) => Promise<{
104
147
  session: {
105
148
  session: Record<string, any> & {
106
149
  id: string;
@@ -146,35 +189,29 @@ declare const supportedBetterAuthClientPlugins: ({
146
189
  };
147
190
  };
148
191
  };
149
- } & {
150
- use: any[];
151
192
  }, {
152
193
  token: string;
153
194
  }>;
154
- signJWT: better_call0.StrictEndpoint<"/sign-jwt", {
195
+ signJWT: better_auth303.StrictEndpoint<string, {
155
196
  method: "POST";
156
197
  metadata: {
157
- SERVER_ONLY: true;
158
198
  $Infer: {
159
199
  body: {
160
- payload: jose0.JWTPayload;
161
- overrideOptions?: better_auth_client_plugins5.JwtOptions | undefined;
200
+ payload: jose1.JWTPayload;
201
+ overrideOptions?: better_auth_plugins35.JwtOptions | undefined;
162
202
  };
163
203
  };
164
204
  };
165
205
  body: zod0.ZodObject<{
166
206
  payload: zod0.ZodRecord<zod0.ZodString, zod0.ZodAny>;
167
207
  overrideOptions: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodAny>>;
168
- }, better_auth206.$strip>;
169
- } & {
170
- use: any[];
208
+ }, better_auth303.$strip>;
171
209
  }, {
172
210
  token: string;
173
211
  }>;
174
- verifyJWT: better_call0.StrictEndpoint<"/verify-jwt", {
212
+ verifyJWT: better_auth303.StrictEndpoint<string, {
175
213
  method: "POST";
176
214
  metadata: {
177
- SERVER_ONLY: true;
178
215
  $Infer: {
179
216
  body: {
180
217
  token: string;
@@ -192,17 +229,15 @@ declare const supportedBetterAuthClientPlugins: ({
192
229
  body: zod0.ZodObject<{
193
230
  token: zod0.ZodString;
194
231
  issuer: zod0.ZodOptional<zod0.ZodString>;
195
- }, better_auth206.$strip>;
196
- } & {
197
- use: any[];
232
+ }, better_auth303.$strip>;
198
233
  }, {
199
- payload: (jose0.JWTPayload & Required<Pick<jose0.JWTPayload, "sub" | "aud">>) | null;
234
+ payload: (jose1.JWTPayload & Required<Pick<jose1.JWTPayload, "sub" | "aud">>) | null;
200
235
  }>;
201
236
  };
202
237
  hooks: {
203
238
  after: {
204
- matcher(context: better_auth206.HookEndpointContext): boolean;
205
- handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<void>;
239
+ matcher(context: better_auth303.HookEndpointContext): boolean;
240
+ handler: (inputContext: better_auth303.MiddlewareInputContext<better_auth303.MiddlewareOptions>) => Promise<void>;
206
241
  }[];
207
242
  };
208
243
  schema: {
@@ -227,11 +262,11 @@ declare const supportedBetterAuthClientPlugins: ({
227
262
  };
228
263
  };
229
264
  };
230
- }>;
265
+ })>;
231
266
  pathMethods: {
232
267
  [x: string]: "GET";
233
268
  };
234
- getActions: ($fetch: _better_fetch_fetch131.BetterFetch) => {
269
+ getActions: ($fetch: _better_fetch_fetch177.BetterFetch) => {
235
270
  jwks: (fetchOptions?: any) => Promise<{
236
271
  data: null;
237
272
  error: {
@@ -240,7 +275,7 @@ declare const supportedBetterAuthClientPlugins: ({
240
275
  statusText: string;
241
276
  };
242
277
  } | {
243
- data: jose0.JSONWebKeySet;
278
+ data: jose1.JSONWebKeySet;
244
279
  error: null;
245
280
  }>;
246
281
  };
@@ -286,7 +321,7 @@ declare const supportedBetterAuthClientPlugins: ({
286
321
  token: string;
287
322
  ipAddress?: string | null | undefined;
288
323
  userAgent?: string | null | undefined;
289
- } & Record<string, unknown>, ctx: better_auth206.GenericEndpointContext | null): Promise<void>;
324
+ } & Record<string, unknown>, ctx: better_auth303.GenericEndpointContext | null): Promise<void>;
290
325
  };
291
326
  };
292
327
  };
@@ -294,22 +329,22 @@ declare const supportedBetterAuthClientPlugins: ({
294
329
  };
295
330
  hooks: {
296
331
  after: {
297
- matcher(context: better_auth206.HookEndpointContext): boolean;
298
- handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<better_auth_client_plugins5.SessionWithImpersonatedBy[] | undefined>;
332
+ matcher(context: better_auth303.HookEndpointContext): boolean;
333
+ handler: (inputContext: better_auth303.MiddlewareInputContext<better_auth303.MiddlewareOptions>) => Promise<better_auth_plugins35.SessionWithImpersonatedBy[] | undefined>;
299
334
  }[];
300
335
  };
301
336
  endpoints: {
302
- setRole: better_call0.StrictEndpoint<"/admin/set-role", {
337
+ setRole: better_auth303.StrictEndpoint<"/admin/set-role", {
303
338
  method: "POST";
304
339
  body: zod0.ZodObject<{
305
340
  userId: zod0.ZodCoercedString<unknown>;
306
341
  role: zod0.ZodUnion<readonly [zod0.ZodString, zod0.ZodArray<zod0.ZodString>]>;
307
- }, better_auth206.$strip>;
342
+ }, better_auth303.$strip>;
308
343
  requireHeaders: true;
309
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
344
+ use: ((inputContext: better_auth303.MiddlewareInputContext<better_auth303.MiddlewareOptions>) => Promise<{
310
345
  session: {
311
- user: better_auth_client_plugins5.UserWithRole;
312
- session: better_auth206.Session;
346
+ user: better_auth_plugins35.UserWithRole;
347
+ session: better_auth303.Session;
313
348
  };
314
349
  }>)[];
315
350
  metadata: {
@@ -342,20 +377,18 @@ declare const supportedBetterAuthClientPlugins: ({
342
377
  };
343
378
  };
344
379
  };
345
- } & {
346
- use: any[];
347
380
  }, {
348
- user: better_auth_client_plugins5.UserWithRole;
381
+ user: better_auth_plugins35.UserWithRole;
349
382
  }>;
350
- getUser: better_call0.StrictEndpoint<"/admin/get-user", {
383
+ getUser: better_auth303.StrictEndpoint<"/admin/get-user", {
351
384
  method: "GET";
352
385
  query: zod0.ZodObject<{
353
386
  id: zod0.ZodString;
354
- }, better_auth206.$strip>;
355
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
387
+ }, better_auth303.$strip>;
388
+ use: ((inputContext: better_auth303.MiddlewareInputContext<better_auth303.MiddlewareOptions>) => Promise<{
356
389
  session: {
357
- user: better_auth_client_plugins5.UserWithRole;
358
- session: better_auth206.Session;
390
+ user: better_auth_plugins35.UserWithRole;
391
+ session: better_auth303.Session;
359
392
  };
360
393
  }>)[];
361
394
  metadata: {
@@ -382,8 +415,6 @@ declare const supportedBetterAuthClientPlugins: ({
382
415
  };
383
416
  };
384
417
  };
385
- } & {
386
- use: any[];
387
418
  }, {
388
419
  id: string;
389
420
  createdAt: Date;
@@ -393,7 +424,7 @@ declare const supportedBetterAuthClientPlugins: ({
393
424
  name: string;
394
425
  image?: string | null | undefined;
395
426
  }>;
396
- createUser: better_call0.StrictEndpoint<"/admin/create-user", {
427
+ createUser: better_auth303.StrictEndpoint<"/admin/create-user", {
397
428
  method: "POST";
398
429
  body: zod0.ZodObject<{
399
430
  email: zod0.ZodString;
@@ -401,7 +432,7 @@ declare const supportedBetterAuthClientPlugins: ({
401
432
  name: zod0.ZodString;
402
433
  role: zod0.ZodOptional<zod0.ZodUnion<readonly [zod0.ZodString, zod0.ZodArray<zod0.ZodString>]>>;
403
434
  data: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodAny>>;
404
- }, better_auth206.$strip>;
435
+ }, better_auth303.$strip>;
405
436
  metadata: {
406
437
  openapi: {
407
438
  operationId: string;
@@ -435,21 +466,19 @@ declare const supportedBetterAuthClientPlugins: ({
435
466
  };
436
467
  };
437
468
  };
438
- } & {
439
- use: any[];
440
469
  }, {
441
- user: better_auth_client_plugins5.UserWithRole;
470
+ user: better_auth_plugins35.UserWithRole;
442
471
  }>;
443
- adminUpdateUser: better_call0.StrictEndpoint<"/admin/update-user", {
472
+ adminUpdateUser: better_auth303.StrictEndpoint<"/admin/update-user", {
444
473
  method: "POST";
445
474
  body: zod0.ZodObject<{
446
475
  userId: zod0.ZodCoercedString<unknown>;
447
476
  data: zod0.ZodRecord<zod0.ZodAny, zod0.ZodAny>;
448
- }, better_auth206.$strip>;
449
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
477
+ }, better_auth303.$strip>;
478
+ use: ((inputContext: better_auth303.MiddlewareInputContext<better_auth303.MiddlewareOptions>) => Promise<{
450
479
  session: {
451
- user: better_auth_client_plugins5.UserWithRole;
452
- session: better_auth206.Session;
480
+ user: better_auth_plugins35.UserWithRole;
481
+ session: better_auth303.Session;
453
482
  };
454
483
  }>)[];
455
484
  metadata: {
@@ -476,15 +505,13 @@ declare const supportedBetterAuthClientPlugins: ({
476
505
  };
477
506
  };
478
507
  };
479
- } & {
480
- use: any[];
481
- }, better_auth_client_plugins5.UserWithRole>;
482
- listUsers: better_call0.StrictEndpoint<"/admin/list-users", {
508
+ }, better_auth_plugins35.UserWithRole>;
509
+ listUsers: better_auth303.StrictEndpoint<"/admin/list-users", {
483
510
  method: "GET";
484
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
511
+ use: ((inputContext: better_auth303.MiddlewareInputContext<better_auth303.MiddlewareOptions>) => Promise<{
485
512
  session: {
486
- user: better_auth_client_plugins5.UserWithRole;
487
- session: better_auth206.Session;
513
+ user: better_auth_plugins35.UserWithRole;
514
+ session: better_auth303.Session;
488
515
  };
489
516
  }>)[];
490
517
  query: zod0.ZodObject<{
@@ -516,7 +543,7 @@ declare const supportedBetterAuthClientPlugins: ({
516
543
  gte: "gte";
517
544
  contains: "contains";
518
545
  }>>;
519
- }, better_auth206.$strip>;
546
+ }, better_auth303.$strip>;
520
547
  metadata: {
521
548
  openapi: {
522
549
  operationId: string;
@@ -554,10 +581,8 @@ declare const supportedBetterAuthClientPlugins: ({
554
581
  };
555
582
  };
556
583
  };
557
- } & {
558
- use: any[];
559
584
  }, {
560
- users: better_auth_client_plugins5.UserWithRole[];
585
+ users: better_auth_plugins35.UserWithRole[];
561
586
  total: number;
562
587
  limit: number | undefined;
563
588
  offset: number | undefined;
@@ -565,17 +590,17 @@ declare const supportedBetterAuthClientPlugins: ({
565
590
  users: never[];
566
591
  total: number;
567
592
  }>;
568
- listUserSessions: better_call0.StrictEndpoint<"/admin/list-user-sessions", {
593
+ listUserSessions: better_auth303.StrictEndpoint<"/admin/list-user-sessions", {
569
594
  method: "POST";
570
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
595
+ use: ((inputContext: better_auth303.MiddlewareInputContext<better_auth303.MiddlewareOptions>) => Promise<{
571
596
  session: {
572
- user: better_auth_client_plugins5.UserWithRole;
573
- session: better_auth206.Session;
597
+ user: better_auth_plugins35.UserWithRole;
598
+ session: better_auth303.Session;
574
599
  };
575
600
  }>)[];
576
601
  body: zod0.ZodObject<{
577
602
  userId: zod0.ZodCoercedString<unknown>;
578
- }, better_auth206.$strip>;
603
+ }, better_auth303.$strip>;
579
604
  metadata: {
580
605
  openapi: {
581
606
  operationId: string;
@@ -603,20 +628,18 @@ declare const supportedBetterAuthClientPlugins: ({
603
628
  };
604
629
  };
605
630
  };
606
- } & {
607
- use: any[];
608
631
  }, {
609
- sessions: better_auth_client_plugins5.SessionWithImpersonatedBy[];
632
+ sessions: better_auth_plugins35.SessionWithImpersonatedBy[];
610
633
  }>;
611
- unbanUser: better_call0.StrictEndpoint<"/admin/unban-user", {
634
+ unbanUser: better_auth303.StrictEndpoint<"/admin/unban-user", {
612
635
  method: "POST";
613
636
  body: zod0.ZodObject<{
614
637
  userId: zod0.ZodCoercedString<unknown>;
615
- }, better_auth206.$strip>;
616
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
638
+ }, better_auth303.$strip>;
639
+ use: ((inputContext: better_auth303.MiddlewareInputContext<better_auth303.MiddlewareOptions>) => Promise<{
617
640
  session: {
618
- user: better_auth_client_plugins5.UserWithRole;
619
- session: better_auth206.Session;
641
+ user: better_auth_plugins35.UserWithRole;
642
+ session: better_auth303.Session;
620
643
  };
621
644
  }>)[];
622
645
  metadata: {
@@ -643,8 +666,6 @@ declare const supportedBetterAuthClientPlugins: ({
643
666
  };
644
667
  };
645
668
  };
646
- } & {
647
- use: any[];
648
669
  }, {
649
670
  user: {
650
671
  id: string;
@@ -656,17 +677,17 @@ declare const supportedBetterAuthClientPlugins: ({
656
677
  image?: string | null | undefined;
657
678
  } & Record<string, any>;
658
679
  }>;
659
- banUser: better_call0.StrictEndpoint<"/admin/ban-user", {
680
+ banUser: better_auth303.StrictEndpoint<"/admin/ban-user", {
660
681
  method: "POST";
661
682
  body: zod0.ZodObject<{
662
683
  userId: zod0.ZodCoercedString<unknown>;
663
684
  banReason: zod0.ZodOptional<zod0.ZodString>;
664
685
  banExpiresIn: zod0.ZodOptional<zod0.ZodNumber>;
665
- }, better_auth206.$strip>;
666
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
686
+ }, better_auth303.$strip>;
687
+ use: ((inputContext: better_auth303.MiddlewareInputContext<better_auth303.MiddlewareOptions>) => Promise<{
667
688
  session: {
668
- user: better_auth_client_plugins5.UserWithRole;
669
- session: better_auth206.Session;
689
+ user: better_auth_plugins35.UserWithRole;
690
+ session: better_auth303.Session;
670
691
  };
671
692
  }>)[];
672
693
  metadata: {
@@ -693,8 +714,6 @@ declare const supportedBetterAuthClientPlugins: ({
693
714
  };
694
715
  };
695
716
  };
696
- } & {
697
- use: any[];
698
717
  }, {
699
718
  user: {
700
719
  id: string;
@@ -706,15 +725,15 @@ declare const supportedBetterAuthClientPlugins: ({
706
725
  image?: string | null | undefined;
707
726
  } & Record<string, any>;
708
727
  }>;
709
- impersonateUser: better_call0.StrictEndpoint<"/admin/impersonate-user", {
728
+ impersonateUser: better_auth303.StrictEndpoint<"/admin/impersonate-user", {
710
729
  method: "POST";
711
730
  body: zod0.ZodObject<{
712
731
  userId: zod0.ZodCoercedString<unknown>;
713
- }, better_auth206.$strip>;
714
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
732
+ }, better_auth303.$strip>;
733
+ use: ((inputContext: better_auth303.MiddlewareInputContext<better_auth303.MiddlewareOptions>) => Promise<{
715
734
  session: {
716
- user: better_auth_client_plugins5.UserWithRole;
717
- session: better_auth206.Session;
735
+ user: better_auth_plugins35.UserWithRole;
736
+ session: better_auth303.Session;
718
737
  };
719
738
  }>)[];
720
739
  metadata: {
@@ -744,8 +763,6 @@ declare const supportedBetterAuthClientPlugins: ({
744
763
  };
745
764
  };
746
765
  };
747
- } & {
748
- use: any[];
749
766
  }, {
750
767
  session: {
751
768
  id: string;
@@ -757,26 +774,24 @@ declare const supportedBetterAuthClientPlugins: ({
757
774
  ipAddress?: string | null | undefined;
758
775
  userAgent?: string | null | undefined;
759
776
  };
760
- user: better_auth_client_plugins5.UserWithRole;
777
+ user: better_auth_plugins35.UserWithRole;
761
778
  }>;
762
- stopImpersonating: better_call0.StrictEndpoint<"/admin/stop-impersonating", {
779
+ stopImpersonating: better_auth303.StrictEndpoint<"/admin/stop-impersonating", {
763
780
  method: "POST";
764
781
  requireHeaders: true;
765
- } & {
766
- use: any[];
767
782
  }, {
768
- session: better_auth206.Session & Record<string, any>;
769
- user: better_auth206.User & Record<string, any>;
783
+ session: better_auth303.Session & Record<string, any>;
784
+ user: better_auth303.User & Record<string, any>;
770
785
  }>;
771
- revokeUserSession: better_call0.StrictEndpoint<"/admin/revoke-user-session", {
786
+ revokeUserSession: better_auth303.StrictEndpoint<"/admin/revoke-user-session", {
772
787
  method: "POST";
773
788
  body: zod0.ZodObject<{
774
789
  sessionToken: zod0.ZodString;
775
- }, better_auth206.$strip>;
776
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
790
+ }, better_auth303.$strip>;
791
+ use: ((inputContext: better_auth303.MiddlewareInputContext<better_auth303.MiddlewareOptions>) => Promise<{
777
792
  session: {
778
- user: better_auth_client_plugins5.UserWithRole;
779
- session: better_auth206.Session;
793
+ user: better_auth_plugins35.UserWithRole;
794
+ session: better_auth303.Session;
780
795
  };
781
796
  }>)[];
782
797
  metadata: {
@@ -803,20 +818,18 @@ declare const supportedBetterAuthClientPlugins: ({
803
818
  };
804
819
  };
805
820
  };
806
- } & {
807
- use: any[];
808
821
  }, {
809
822
  success: boolean;
810
823
  }>;
811
- revokeUserSessions: better_call0.StrictEndpoint<"/admin/revoke-user-sessions", {
824
+ revokeUserSessions: better_auth303.StrictEndpoint<"/admin/revoke-user-sessions", {
812
825
  method: "POST";
813
826
  body: zod0.ZodObject<{
814
827
  userId: zod0.ZodCoercedString<unknown>;
815
- }, better_auth206.$strip>;
816
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
828
+ }, better_auth303.$strip>;
829
+ use: ((inputContext: better_auth303.MiddlewareInputContext<better_auth303.MiddlewareOptions>) => Promise<{
817
830
  session: {
818
- user: better_auth_client_plugins5.UserWithRole;
819
- session: better_auth206.Session;
831
+ user: better_auth_plugins35.UserWithRole;
832
+ session: better_auth303.Session;
820
833
  };
821
834
  }>)[];
822
835
  metadata: {
@@ -843,20 +856,18 @@ declare const supportedBetterAuthClientPlugins: ({
843
856
  };
844
857
  };
845
858
  };
846
- } & {
847
- use: any[];
848
859
  }, {
849
860
  success: boolean;
850
861
  }>;
851
- removeUser: better_call0.StrictEndpoint<"/admin/remove-user", {
862
+ removeUser: better_auth303.StrictEndpoint<"/admin/remove-user", {
852
863
  method: "POST";
853
864
  body: zod0.ZodObject<{
854
865
  userId: zod0.ZodCoercedString<unknown>;
855
- }, better_auth206.$strip>;
856
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
866
+ }, better_auth303.$strip>;
867
+ use: ((inputContext: better_auth303.MiddlewareInputContext<better_auth303.MiddlewareOptions>) => Promise<{
857
868
  session: {
858
- user: better_auth_client_plugins5.UserWithRole;
859
- session: better_auth206.Session;
869
+ user: better_auth_plugins35.UserWithRole;
870
+ session: better_auth303.Session;
860
871
  };
861
872
  }>)[];
862
873
  metadata: {
@@ -883,21 +894,19 @@ declare const supportedBetterAuthClientPlugins: ({
883
894
  };
884
895
  };
885
896
  };
886
- } & {
887
- use: any[];
888
897
  }, {
889
898
  success: boolean;
890
899
  }>;
891
- setUserPassword: better_call0.StrictEndpoint<"/admin/set-user-password", {
900
+ setUserPassword: better_auth303.StrictEndpoint<"/admin/set-user-password", {
892
901
  method: "POST";
893
902
  body: zod0.ZodObject<{
894
903
  newPassword: zod0.ZodString;
895
904
  userId: zod0.ZodCoercedString<unknown>;
896
- }, better_auth206.$strip>;
897
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
905
+ }, better_auth303.$strip>;
906
+ use: ((inputContext: better_auth303.MiddlewareInputContext<better_auth303.MiddlewareOptions>) => Promise<{
898
907
  session: {
899
- user: better_auth_client_plugins5.UserWithRole;
900
- session: better_auth206.Session;
908
+ user: better_auth_plugins35.UserWithRole;
909
+ session: better_auth303.Session;
901
910
  };
902
911
  }>)[];
903
912
  metadata: {
@@ -924,23 +933,21 @@ declare const supportedBetterAuthClientPlugins: ({
924
933
  };
925
934
  };
926
935
  };
927
- } & {
928
- use: any[];
929
936
  }, {
930
937
  status: boolean;
931
938
  }>;
932
- userHasPermission: better_call0.StrictEndpoint<"/admin/has-permission", {
939
+ userHasPermission: better_auth303.StrictEndpoint<"/admin/has-permission", {
933
940
  method: "POST";
934
941
  body: zod0.ZodIntersection<zod0.ZodObject<{
935
942
  userId: zod0.ZodOptional<zod0.ZodCoercedString<unknown>>;
936
943
  role: zod0.ZodOptional<zod0.ZodString>;
937
- }, better_auth206.$strip>, zod0.ZodUnion<readonly [zod0.ZodObject<{
944
+ }, better_auth303.$strip>, zod0.ZodUnion<readonly [zod0.ZodObject<{
938
945
  permission: zod0.ZodRecord<zod0.ZodString, zod0.ZodArray<zod0.ZodString>>;
939
946
  permissions: zod0.ZodUndefined;
940
- }, better_auth206.$strip>, zod0.ZodObject<{
947
+ }, better_auth303.$strip>, zod0.ZodObject<{
941
948
  permission: zod0.ZodUndefined;
942
949
  permissions: zod0.ZodRecord<zod0.ZodString, zod0.ZodArray<zod0.ZodString>>;
943
- }, better_auth206.$strip>]>>;
950
+ }, better_auth303.$strip>]>>;
944
951
  metadata: {
945
952
  openapi: {
946
953
  description: string;
@@ -990,14 +997,14 @@ declare const supportedBetterAuthClientPlugins: ({
990
997
  $Infer: {
991
998
  body: ({
992
999
  permission: {
993
- readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get" | "update")[] | undefined;
994
- readonly session?: ("list" | "delete" | "revoke")[] | undefined;
1000
+ readonly user?: ("get" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "set-password" | "update")[] | undefined;
1001
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
995
1002
  };
996
1003
  permissions?: never | undefined;
997
1004
  } | {
998
1005
  permissions: {
999
- readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get" | "update")[] | undefined;
1000
- readonly session?: ("list" | "delete" | "revoke")[] | undefined;
1006
+ readonly user?: ("get" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "set-password" | "update")[] | undefined;
1007
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
1001
1008
  };
1002
1009
  permission?: never | undefined;
1003
1010
  }) & {
@@ -1006,8 +1013,6 @@ declare const supportedBetterAuthClientPlugins: ({
1006
1013
  };
1007
1014
  };
1008
1015
  };
1009
- } & {
1010
- use: any[];
1011
1016
  }, {
1012
1017
  error: null;
1013
1018
  success: boolean;
@@ -1034,6 +1039,7 @@ declare const supportedBetterAuthClientPlugins: ({
1034
1039
  readonly YOU_CANNOT_REMOVE_YOURSELF: "You cannot remove yourself";
1035
1040
  readonly YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: "You are not allowed to set a non-existent role value";
1036
1041
  readonly YOU_CANNOT_IMPERSONATE_ADMINS: "You cannot impersonate admins";
1042
+ readonly INVALID_ROLE_TYPE: "Invalid role type";
1037
1043
  };
1038
1044
  schema: {
1039
1045
  user: {
@@ -1070,20 +1076,29 @@ declare const supportedBetterAuthClientPlugins: ({
1070
1076
  };
1071
1077
  };
1072
1078
  };
1073
- options: any;
1079
+ options: NoInfer<{
1080
+ ac: better_auth_plugins35.AccessControl<{
1081
+ readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
1082
+ readonly session: readonly ["list", "revoke", "delete"];
1083
+ }>;
1084
+ roles: {
1085
+ admin: better_auth_plugins35.Role;
1086
+ user: better_auth_plugins35.Role;
1087
+ };
1088
+ }>;
1074
1089
  };
1075
1090
  getActions: () => {
1076
1091
  admin: {
1077
1092
  checkRolePermission: <R extends "user" | "admin">(data: ({
1078
1093
  permission: {
1079
- readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get" | "update")[] | undefined;
1080
- readonly session?: ("list" | "delete" | "revoke")[] | undefined;
1094
+ readonly user?: ("get" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "set-password" | "update")[] | undefined;
1095
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
1081
1096
  };
1082
1097
  permissions?: never | undefined;
1083
1098
  } | {
1084
1099
  permissions: {
1085
- readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get" | "update")[] | undefined;
1086
- readonly session?: ("list" | "delete" | "revoke")[] | undefined;
1100
+ readonly user?: ("get" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "set-password" | "update")[] | undefined;
1101
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
1087
1102
  };
1088
1103
  permission?: never | undefined;
1089
1104
  }) & {
@@ -1097,8 +1112,8 @@ declare const supportedBetterAuthClientPlugins: ({
1097
1112
  };
1098
1113
  } | {
1099
1114
  id: "organization";
1100
- $InferServerPlugin: better_auth_client11.OrganizationPlugin<{
1101
- ac: better_auth_client11.AccessControl<{
1115
+ $InferServerPlugin: better_auth_plugins35.OrganizationPlugin<{
1116
+ ac: better_auth_plugins35.AccessControl<{
1102
1117
  readonly organization: readonly ["update", "delete"];
1103
1118
  readonly member: readonly ["create", "update", "delete"];
1104
1119
  readonly invitation: readonly ["create", "cancel"];
@@ -1106,9 +1121,9 @@ declare const supportedBetterAuthClientPlugins: ({
1106
1121
  readonly ac: readonly ["create", "read", "update", "delete"];
1107
1122
  }>;
1108
1123
  roles: {
1109
- admin: better_auth_client11.Role;
1110
- member: better_auth_client11.Role;
1111
- owner: better_auth_client11.Role;
1124
+ admin: better_auth_plugins35.Role;
1125
+ member: better_auth_plugins35.Role;
1126
+ owner: better_auth_plugins35.Role;
1112
1127
  };
1113
1128
  teams: {
1114
1129
  enabled: false;
@@ -1116,27 +1131,27 @@ declare const supportedBetterAuthClientPlugins: ({
1116
1131
  schema: {
1117
1132
  organization?: {
1118
1133
  additionalFields?: {
1119
- [key: string]: better_auth206.DBFieldAttribute;
1134
+ [key: string]: better_auth303.DBFieldAttribute;
1120
1135
  };
1121
1136
  };
1122
1137
  member?: {
1123
1138
  additionalFields?: {
1124
- [key: string]: better_auth206.DBFieldAttribute;
1139
+ [key: string]: better_auth303.DBFieldAttribute;
1125
1140
  };
1126
1141
  };
1127
1142
  invitation?: {
1128
1143
  additionalFields?: {
1129
- [key: string]: better_auth206.DBFieldAttribute;
1144
+ [key: string]: better_auth303.DBFieldAttribute;
1130
1145
  };
1131
1146
  };
1132
1147
  team?: {
1133
1148
  additionalFields?: {
1134
- [key: string]: better_auth206.DBFieldAttribute;
1149
+ [key: string]: better_auth303.DBFieldAttribute;
1135
1150
  };
1136
1151
  };
1137
1152
  organizationRole?: {
1138
1153
  additionalFields?: {
1139
- [key: string]: better_auth206.DBFieldAttribute;
1154
+ [key: string]: better_auth303.DBFieldAttribute;
1140
1155
  };
1141
1156
  };
1142
1157
  } | undefined;
@@ -1144,7 +1159,7 @@ declare const supportedBetterAuthClientPlugins: ({
1144
1159
  enabled: false;
1145
1160
  };
1146
1161
  }>;
1147
- getActions: ($fetch: _better_fetch_fetch131.BetterFetch, _$store: better_auth206.ClientStore, co: BetterAuthClientOptions | undefined) => {
1162
+ getActions: ($fetch: _better_fetch_fetch177.BetterFetch, _$store: better_auth303.ClientStore, co: BetterAuthClientOptions | undefined) => {
1148
1163
  $Infer: {
1149
1164
  ActiveOrganization: {
1150
1165
  members: {
@@ -1165,7 +1180,7 @@ declare const supportedBetterAuthClientPlugins: ({
1165
1180
  organizationId: string;
1166
1181
  email: string;
1167
1182
  role: "admin" | "member" | "owner";
1168
- status: better_auth_client11.InvitationStatus;
1183
+ status: better_auth_plugins35.InvitationStatus;
1169
1184
  inviterId: string;
1170
1185
  expiresAt: Date;
1171
1186
  createdAt: Date;
@@ -1191,7 +1206,7 @@ declare const supportedBetterAuthClientPlugins: ({
1191
1206
  organizationId: string;
1192
1207
  email: string;
1193
1208
  role: "admin" | "member" | "owner";
1194
- status: better_auth_client11.InvitationStatus;
1209
+ status: better_auth_plugins35.InvitationStatus;
1195
1210
  inviterId: string;
1196
1211
  expiresAt: Date;
1197
1212
  createdAt: Date;
@@ -1221,19 +1236,19 @@ declare const supportedBetterAuthClientPlugins: ({
1221
1236
  checkRolePermission: <R extends "admin" | "member" | "owner">(data: ({
1222
1237
  permission: {
1223
1238
  readonly organization?: ("delete" | "update")[] | undefined;
1224
- readonly member?: ("create" | "delete" | "update")[] | undefined;
1225
- readonly invitation?: ("create" | "cancel")[] | undefined;
1226
- readonly team?: ("create" | "delete" | "update")[] | undefined;
1227
- readonly ac?: ("create" | "delete" | "update" | "read")[] | undefined;
1239
+ readonly member?: ("delete" | "create" | "update")[] | undefined;
1240
+ readonly invitation?: ("cancel" | "create")[] | undefined;
1241
+ readonly team?: ("delete" | "create" | "update")[] | undefined;
1242
+ readonly ac?: ("delete" | "create" | "update" | "read")[] | undefined;
1228
1243
  };
1229
1244
  permissions?: never | undefined;
1230
1245
  } | {
1231
1246
  permissions: {
1232
1247
  readonly organization?: ("delete" | "update")[] | undefined;
1233
- readonly member?: ("create" | "delete" | "update")[] | undefined;
1234
- readonly invitation?: ("create" | "cancel")[] | undefined;
1235
- readonly team?: ("create" | "delete" | "update")[] | undefined;
1236
- readonly ac?: ("create" | "delete" | "update" | "read")[] | undefined;
1248
+ readonly member?: ("delete" | "create" | "update")[] | undefined;
1249
+ readonly invitation?: ("cancel" | "create")[] | undefined;
1250
+ readonly team?: ("delete" | "create" | "update")[] | undefined;
1251
+ readonly ac?: ("delete" | "create" | "update" | "read")[] | undefined;
1237
1252
  };
1238
1253
  permission?: never | undefined;
1239
1254
  }) & {
@@ -1241,93 +1256,61 @@ declare const supportedBetterAuthClientPlugins: ({
1241
1256
  }) => boolean;
1242
1257
  };
1243
1258
  };
1244
- getAtoms: ($fetch: _better_fetch_fetch131.BetterFetch) => {
1245
- $listOrg: nanostores1.PreinitializedWritableAtom<boolean> & object;
1246
- $activeOrgSignal: nanostores1.PreinitializedWritableAtom<boolean> & object;
1247
- $activeMemberSignal: nanostores1.PreinitializedWritableAtom<boolean> & object;
1248
- $activeMemberRoleSignal: nanostores1.PreinitializedWritableAtom<boolean> & object;
1249
- activeOrganization: nanostores1.PreinitializedWritableAtom<{
1250
- data: better_auth206.Prettify<{
1259
+ getAtoms: ($fetch: _better_fetch_fetch177.BetterFetch) => {
1260
+ $listOrg: better_auth_react1.PreinitializedWritableAtom<boolean> & object;
1261
+ $activeOrgSignal: better_auth_react1.PreinitializedWritableAtom<boolean> & object;
1262
+ $activeMemberSignal: better_auth_react1.PreinitializedWritableAtom<boolean> & object;
1263
+ $activeMemberRoleSignal: better_auth_react1.PreinitializedWritableAtom<boolean> & object;
1264
+ activeOrganization: better_auth_client0.AuthQueryAtom<better_auth303.Prettify<{
1265
+ id: string;
1266
+ name: string;
1267
+ slug: string;
1268
+ createdAt: Date;
1269
+ logo?: string | null | undefined | undefined;
1270
+ metadata?: any;
1271
+ } & {
1272
+ members: {
1251
1273
  id: string;
1252
- name: string;
1253
- slug: string;
1274
+ organizationId: string;
1275
+ role: "admin" | "member" | "owner";
1254
1276
  createdAt: Date;
1255
- logo?: string | null | undefined | undefined;
1256
- metadata?: any;
1257
- } & {
1258
- members: {
1259
- id: string;
1260
- organizationId: string;
1261
- role: "admin" | "member" | "owner";
1262
- createdAt: Date;
1263
- userId: string;
1264
- user: {
1265
- id: string;
1266
- email: string;
1267
- name: string;
1268
- image?: string | undefined;
1269
- };
1270
- }[];
1271
- invitations: {
1277
+ userId: string;
1278
+ user: {
1272
1279
  id: string;
1273
- organizationId: string;
1274
1280
  email: string;
1275
- role: "admin" | "member" | "owner";
1276
- status: better_auth_client11.InvitationStatus;
1277
- inviterId: string;
1278
- expiresAt: Date;
1279
- createdAt: Date;
1280
- }[];
1281
- }> | null;
1282
- error: null | _better_fetch_fetch131.BetterFetchError;
1283
- isPending: boolean;
1284
- isRefetching: boolean;
1285
- refetch: (queryParams?: {
1286
- query?: better_auth206.SessionQueryParams;
1287
- } | undefined) => Promise<void>;
1288
- }> & object;
1289
- listOrganizations: nanostores1.PreinitializedWritableAtom<{
1290
- data: {
1291
- id: string;
1292
- name: string;
1293
- slug: string;
1294
- createdAt: Date;
1295
- logo?: string | null | undefined | undefined;
1296
- metadata?: any;
1297
- }[] | null;
1298
- error: null | _better_fetch_fetch131.BetterFetchError;
1299
- isPending: boolean;
1300
- isRefetching: boolean;
1301
- refetch: (queryParams?: {
1302
- query?: better_auth206.SessionQueryParams;
1303
- } | undefined) => Promise<void>;
1304
- }> & object;
1305
- activeMember: nanostores1.PreinitializedWritableAtom<{
1306
- data: {
1281
+ name: string;
1282
+ image?: string | undefined;
1283
+ };
1284
+ }[];
1285
+ invitations: {
1307
1286
  id: string;
1308
1287
  organizationId: string;
1309
- userId: string;
1310
- role: string;
1288
+ email: string;
1289
+ role: "admin" | "member" | "owner";
1290
+ status: better_auth_plugins35.InvitationStatus;
1291
+ inviterId: string;
1292
+ expiresAt: Date;
1311
1293
  createdAt: Date;
1312
- } | null;
1313
- error: null | _better_fetch_fetch131.BetterFetchError;
1314
- isPending: boolean;
1315
- isRefetching: boolean;
1316
- refetch: (queryParams?: {
1317
- query?: better_auth206.SessionQueryParams;
1318
- } | undefined) => Promise<void>;
1319
- }> & object;
1320
- activeMemberRole: nanostores1.PreinitializedWritableAtom<{
1321
- data: {
1322
- role: string;
1323
- } | null;
1324
- error: null | _better_fetch_fetch131.BetterFetchError;
1325
- isPending: boolean;
1326
- isRefetching: boolean;
1327
- refetch: (queryParams?: {
1328
- query?: better_auth206.SessionQueryParams;
1329
- } | undefined) => Promise<void>;
1330
- }> & object;
1294
+ }[];
1295
+ }>>;
1296
+ listOrganizations: better_auth_client0.AuthQueryAtom<{
1297
+ id: string;
1298
+ name: string;
1299
+ slug: string;
1300
+ createdAt: Date;
1301
+ logo?: string | null | undefined | undefined;
1302
+ metadata?: any;
1303
+ }[]>;
1304
+ activeMember: better_auth_client0.AuthQueryAtom<{
1305
+ id: string;
1306
+ organizationId: string;
1307
+ userId: string;
1308
+ role: string;
1309
+ createdAt: Date;
1310
+ }>;
1311
+ activeMemberRole: better_auth_client0.AuthQueryAtom<{
1312
+ role: string;
1313
+ }>;
1331
1314
  };
1332
1315
  pathMethods: {
1333
1316
  "/organization/get-full-organization": "GET";
@@ -1351,13 +1334,13 @@ declare const supportedBetterAuthClientPlugins: ({
1351
1334
  })[];
1352
1335
  } | {
1353
1336
  id: "email-otp";
1354
- $InferServerPlugin: ReturnType<(options: better_auth_plugins_email_otp0.EmailOTPOptions) => {
1337
+ $InferServerPlugin: ReturnType<(options: better_auth_plugins35.EmailOTPOptions) => {
1355
1338
  id: "email-otp";
1356
- init(ctx: better_auth206.AuthContext): {
1339
+ init(ctx: better_auth303.AuthContext): {
1357
1340
  options: {
1358
1341
  emailVerification: {
1359
1342
  sendVerificationEmail(data: {
1360
- user: better_auth206.User;
1343
+ user: better_auth303.User;
1361
1344
  url: string;
1362
1345
  token: string;
1363
1346
  }, request: Request | undefined): Promise<void>;
@@ -1365,7 +1348,7 @@ declare const supportedBetterAuthClientPlugins: ({
1365
1348
  };
1366
1349
  } | undefined;
1367
1350
  endpoints: {
1368
- sendVerificationOTP: better_call0.StrictEndpoint<"/email-otp/send-verification-otp", {
1351
+ sendVerificationOTP: better_auth303.StrictEndpoint<"/email-otp/send-verification-otp", {
1369
1352
  method: "POST";
1370
1353
  body: zod0.ZodObject<{
1371
1354
  email: zod0.ZodString;
@@ -1374,7 +1357,7 @@ declare const supportedBetterAuthClientPlugins: ({
1374
1357
  "email-verification": "email-verification";
1375
1358
  "forget-password": "forget-password";
1376
1359
  }>;
1377
- }, better_auth206.$strip>;
1360
+ }, better_auth303.$strip>;
1378
1361
  metadata: {
1379
1362
  openapi: {
1380
1363
  operationId: string;
@@ -1398,12 +1381,10 @@ declare const supportedBetterAuthClientPlugins: ({
1398
1381
  };
1399
1382
  };
1400
1383
  };
1401
- } & {
1402
- use: any[];
1403
1384
  }, {
1404
1385
  success: boolean;
1405
1386
  }>;
1406
- createVerificationOTP: better_call0.StrictEndpoint<"/email-otp/create-verification-otp", {
1387
+ createVerificationOTP: better_auth303.StrictEndpoint<string, {
1407
1388
  method: "POST";
1408
1389
  body: zod0.ZodObject<{
1409
1390
  email: zod0.ZodString;
@@ -1412,9 +1393,8 @@ declare const supportedBetterAuthClientPlugins: ({
1412
1393
  "email-verification": "email-verification";
1413
1394
  "forget-password": "forget-password";
1414
1395
  }>;
1415
- }, better_auth206.$strip>;
1396
+ }, better_auth303.$strip>;
1416
1397
  metadata: {
1417
- SERVER_ONLY: true;
1418
1398
  openapi: {
1419
1399
  operationId: string;
1420
1400
  description: string;
@@ -1432,10 +1412,8 @@ declare const supportedBetterAuthClientPlugins: ({
1432
1412
  };
1433
1413
  };
1434
1414
  };
1435
- } & {
1436
- use: any[];
1437
1415
  }, string>;
1438
- getVerificationOTP: better_call0.StrictEndpoint<"/email-otp/get-verification-otp", {
1416
+ getVerificationOTP: better_auth303.StrictEndpoint<string, {
1439
1417
  method: "GET";
1440
1418
  query: zod0.ZodObject<{
1441
1419
  email: zod0.ZodString;
@@ -1444,9 +1422,8 @@ declare const supportedBetterAuthClientPlugins: ({
1444
1422
  "email-verification": "email-verification";
1445
1423
  "forget-password": "forget-password";
1446
1424
  }>;
1447
- }, better_auth206.$strip>;
1425
+ }, better_auth303.$strip>;
1448
1426
  metadata: {
1449
- SERVER_ONLY: true;
1450
1427
  openapi: {
1451
1428
  operationId: string;
1452
1429
  description: string;
@@ -1472,14 +1449,12 @@ declare const supportedBetterAuthClientPlugins: ({
1472
1449
  };
1473
1450
  };
1474
1451
  };
1475
- } & {
1476
- use: any[];
1477
1452
  }, {
1478
1453
  otp: null;
1479
1454
  } | {
1480
1455
  otp: string;
1481
1456
  }>;
1482
- checkVerificationOTP: better_call0.StrictEndpoint<"/email-otp/check-verification-otp", {
1457
+ checkVerificationOTP: better_auth303.StrictEndpoint<"/email-otp/check-verification-otp", {
1483
1458
  method: "POST";
1484
1459
  body: zod0.ZodObject<{
1485
1460
  email: zod0.ZodString;
@@ -1489,7 +1464,7 @@ declare const supportedBetterAuthClientPlugins: ({
1489
1464
  "forget-password": "forget-password";
1490
1465
  }>;
1491
1466
  otp: zod0.ZodString;
1492
- }, better_auth206.$strip>;
1467
+ }, better_auth303.$strip>;
1493
1468
  metadata: {
1494
1469
  openapi: {
1495
1470
  operationId: string;
@@ -1513,17 +1488,15 @@ declare const supportedBetterAuthClientPlugins: ({
1513
1488
  };
1514
1489
  };
1515
1490
  };
1516
- } & {
1517
- use: any[];
1518
1491
  }, {
1519
1492
  success: boolean;
1520
1493
  }>;
1521
- verifyEmailOTP: better_call0.StrictEndpoint<"/email-otp/verify-email", {
1494
+ verifyEmailOTP: better_auth303.StrictEndpoint<"/email-otp/verify-email", {
1522
1495
  method: "POST";
1523
1496
  body: zod0.ZodObject<{
1524
1497
  email: zod0.ZodString;
1525
1498
  otp: zod0.ZodString;
1526
- }, better_auth206.$strip>;
1499
+ }, better_auth303.$strip>;
1527
1500
  metadata: {
1528
1501
  openapi: {
1529
1502
  description: string;
@@ -1557,8 +1530,6 @@ declare const supportedBetterAuthClientPlugins: ({
1557
1530
  };
1558
1531
  };
1559
1532
  };
1560
- } & {
1561
- use: any[];
1562
1533
  }, {
1563
1534
  status: boolean;
1564
1535
  token: string;
@@ -1584,12 +1555,12 @@ declare const supportedBetterAuthClientPlugins: ({
1584
1555
  updatedAt: Date;
1585
1556
  };
1586
1557
  }>;
1587
- signInEmailOTP: better_call0.StrictEndpoint<"/sign-in/email-otp", {
1558
+ signInEmailOTP: better_auth303.StrictEndpoint<"/sign-in/email-otp", {
1588
1559
  method: "POST";
1589
1560
  body: zod0.ZodObject<{
1590
1561
  email: zod0.ZodString;
1591
1562
  otp: zod0.ZodString;
1592
- }, better_auth206.$strip>;
1563
+ }, better_auth303.$strip>;
1593
1564
  metadata: {
1594
1565
  openapi: {
1595
1566
  operationId: string;
@@ -1618,8 +1589,6 @@ declare const supportedBetterAuthClientPlugins: ({
1618
1589
  };
1619
1590
  };
1620
1591
  };
1621
- } & {
1622
- use: any[];
1623
1592
  }, {
1624
1593
  token: string;
1625
1594
  user: {
@@ -1632,11 +1601,11 @@ declare const supportedBetterAuthClientPlugins: ({
1632
1601
  updatedAt: Date;
1633
1602
  };
1634
1603
  }>;
1635
- forgetPasswordEmailOTP: better_call0.StrictEndpoint<"/forget-password/email-otp", {
1604
+ forgetPasswordEmailOTP: better_auth303.StrictEndpoint<"/forget-password/email-otp", {
1636
1605
  method: "POST";
1637
1606
  body: zod0.ZodObject<{
1638
1607
  email: zod0.ZodString;
1639
- }, better_auth206.$strip>;
1608
+ }, better_auth303.$strip>;
1640
1609
  metadata: {
1641
1610
  openapi: {
1642
1611
  operationId: string;
@@ -1661,18 +1630,16 @@ declare const supportedBetterAuthClientPlugins: ({
1661
1630
  };
1662
1631
  };
1663
1632
  };
1664
- } & {
1665
- use: any[];
1666
1633
  }, {
1667
1634
  success: boolean;
1668
1635
  }>;
1669
- resetPasswordEmailOTP: better_call0.StrictEndpoint<"/email-otp/reset-password", {
1636
+ resetPasswordEmailOTP: better_auth303.StrictEndpoint<"/email-otp/reset-password", {
1670
1637
  method: "POST";
1671
1638
  body: zod0.ZodObject<{
1672
1639
  email: zod0.ZodString;
1673
1640
  otp: zod0.ZodString;
1674
1641
  password: zod0.ZodString;
1675
- }, better_auth206.$strip>;
1642
+ }, better_auth303.$strip>;
1676
1643
  metadata: {
1677
1644
  openapi: {
1678
1645
  operationId: string;
@@ -1696,16 +1663,14 @@ declare const supportedBetterAuthClientPlugins: ({
1696
1663
  };
1697
1664
  };
1698
1665
  };
1699
- } & {
1700
- use: any[];
1701
1666
  }, {
1702
1667
  success: boolean;
1703
1668
  }>;
1704
1669
  };
1705
1670
  hooks: {
1706
1671
  after: {
1707
- matcher(context: better_auth206.HookEndpointContext): boolean;
1708
- handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<void>;
1672
+ matcher(context: better_auth303.HookEndpointContext): boolean;
1673
+ handler: (inputContext: better_auth303.MiddlewareInputContext<better_auth303.MiddlewareOptions>) => Promise<void>;
1709
1674
  }[];
1710
1675
  };
1711
1676
  $ERROR_CODES: {
@@ -1730,89 +1695,12 @@ declare const supportedBetterAuthClientPlugins: ({
1730
1695
  window: number;
1731
1696
  max: number;
1732
1697
  })[];
1698
+ options: better_auth_plugins35.EmailOTPOptions;
1733
1699
  }>;
1734
1700
  atomListeners: {
1735
1701
  matcher: (path: string) => path is "/email-otp/verify-email" | "/sign-in/email-otp";
1736
1702
  signal: "$sessionSignal";
1737
1703
  }[];
1738
- } | {
1739
- id: "anonymous";
1740
- $InferServerPlugin: ReturnType<(options?: better_auth_client_plugins5.AnonymousOptions | undefined) => {
1741
- id: "anonymous";
1742
- endpoints: {
1743
- signInAnonymous: better_call0.StrictEndpoint<"/sign-in/anonymous", {
1744
- method: "POST";
1745
- metadata: {
1746
- openapi: {
1747
- description: string;
1748
- responses: {
1749
- 200: {
1750
- description: string;
1751
- content: {
1752
- "application/json": {
1753
- schema: {
1754
- type: "object";
1755
- properties: {
1756
- user: {
1757
- $ref: string;
1758
- };
1759
- session: {
1760
- $ref: string;
1761
- };
1762
- };
1763
- };
1764
- };
1765
- };
1766
- };
1767
- };
1768
- };
1769
- };
1770
- } & {
1771
- use: any[];
1772
- }, {
1773
- token: string;
1774
- user: {
1775
- id: string;
1776
- email: string;
1777
- emailVerified: boolean;
1778
- name: string;
1779
- createdAt: Date;
1780
- updatedAt: Date;
1781
- };
1782
- } | null>;
1783
- };
1784
- hooks: {
1785
- after: {
1786
- matcher(ctx: better_auth206.HookEndpointContext): boolean;
1787
- handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<void>;
1788
- }[];
1789
- };
1790
- schema: {
1791
- user: {
1792
- fields: {
1793
- isAnonymous: {
1794
- type: "boolean";
1795
- required: false;
1796
- input: false;
1797
- defaultValue: false;
1798
- };
1799
- };
1800
- };
1801
- };
1802
- $ERROR_CODES: {
1803
- readonly INVALID_EMAIL_FORMAT: "Email was not generated in a valid format";
1804
- readonly FAILED_TO_CREATE_USER: "Failed to create user";
1805
- readonly COULD_NOT_CREATE_SESSION: "Could not create session";
1806
- readonly ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY: "Anonymous users cannot sign in again anonymously";
1807
- };
1808
- }>;
1809
- pathMethods: {
1810
- "/sign-in/anonymous": "POST";
1811
- };
1812
- atomListeners: {
1813
- matcher: (path: string) => path is "/sign-in/anonymous";
1814
- signal: "$sessionSignal";
1815
- }[];
1816
1704
  })[];
1817
1705
  type SupportedBetterAuthClientPlugins = typeof supportedBetterAuthClientPlugins;
1818
1706
  declare abstract class NeonAuthAdapterCore {
@@ -1827,8 +1715,15 @@ declare abstract class NeonAuthAdapterCore {
1827
1715
  * See CLAUDE.md for architecture details and API mappings.
1828
1716
  */
1829
1717
  constructor(betterAuthClientOptions: NeonAuthAdapterCoreAuthOptions);
1830
- abstract getBetterAuthInstance?(): AuthClient<BetterAuthClientOptions> | ReturnType<typeof createAuthClient>;
1831
- abstract getJWTToken(): Promise<string | null>;
1718
+ abstract getBetterAuthInstance(): BetterAuthInstance;
1719
+ /**
1720
+ * Get JWT token for authenticated or anonymous access.
1721
+ * Single source of truth for token retrieval logic.
1722
+ *
1723
+ * @param allowAnonymous - When true, fetches anonymous token if no session exists
1724
+ * @returns JWT token string or null if unavailable
1725
+ */
1726
+ getJWTToken(allowAnonymous: boolean): Promise<string | null>;
1832
1727
  }
1833
1728
  //#endregion
1834
- export { NeonAuthAdapterCoreAuthOptions as n, SupportedBetterAuthClientPlugins as r, NeonAuthAdapterCore as t };
1729
+ export { BetterAuthSession as A, Team as C, UserWithRole as D, TeamMemberInput as E, VanillaBetterAuthClient as O, SessionWithImpersonatedBy as S, TeamMember as T, MemberInput as _, BetterAuthInstance as a, OrganizationRole as b, InferAdminRolesFromOption as c, InvitationStatus as d, JWKOptions as f, Member as g, JwtOptions as h, AdminOptions as i, BetterAuthUser as j, BetterAuthErrorResponse as k, Invitation as l, Jwk as m, NeonAuthAdapterCoreAuthOptions as n, BetterFetchError$1 as o, JWSAlgorithms as p, SupportedBetterAuthClientPlugins as r, EmailOTPOptions as s, NeonAuthAdapterCore as t, InvitationInput as u, Organization as v, TeamInput as w, ReactBetterAuthClient as x, OrganizationInput as y };