@neondatabase/auth 0.1.0-beta.2 → 0.1.0-beta.21

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 (45) hide show
  1. package/README.md +112 -18
  2. package/dist/{adapter-core-BDOw-gBC.mjs → adapter-core-PD5NQpLE.mjs} +392 -69
  3. package/dist/{adapter-core-C12KoaiU.d.mts → adapter-core-y53SWo8w.d.mts} +181 -627
  4. package/dist/{better-auth-react-adapter-FnBHa2nr.mjs → better-auth-react-adapter-B0XIXPUH.mjs} +10 -8
  5. package/dist/better-auth-react-adapter-B7zoQmoL.d.mts +2170 -0
  6. package/dist/chunk-VCZJYX65-CLnrj1o7-D6ZQkcc_.mjs +543 -0
  7. package/dist/constants-2bpp2_-f.mjs +30 -0
  8. package/dist/index.d.mts +4 -98
  9. package/dist/index.mjs +2 -1
  10. package/dist/{neon-auth-C9XTFffv.mjs → neon-auth-DUbqaO2v.mjs} +7 -4
  11. package/dist/neon-auth-oDgy6lQm.d.mts +107 -0
  12. package/dist/next/index.d.mts +76 -303
  13. package/dist/next/index.mjs +6 -174
  14. package/dist/next/server/index.d.mts +433 -0
  15. package/dist/next/server/index.mjs +731 -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 +5 -5
  19. package/dist/react/index.mjs +5 -92
  20. package/dist/react/ui/index.d.mts +1 -1
  21. package/dist/react/ui/index.mjs +3 -91
  22. package/dist/react/ui/server.mjs +1 -1
  23. package/dist/{supabase-adapter-ggmqWgPe.mjs → supabase-adapter-Bdw6aPGx.mjs} +72 -167
  24. package/dist/supabase-adapter-Dm56RKRF.d.mts +2258 -0
  25. package/dist/types/index.d.mts +3 -0
  26. package/dist/types/index.mjs +3 -0
  27. package/dist/ui/.safelist.html +3 -0
  28. package/dist/ui/css.css +2 -2
  29. package/dist/ui/tailwind.css +4 -3
  30. package/dist/ui/theme-inline.css +44 -0
  31. package/dist/ui/theme.css +221 -118
  32. package/dist/ui-CrxGg6vQ.mjs +12113 -0
  33. package/dist/vanilla/adapters/index.d.mts +3 -3
  34. package/dist/vanilla/adapters/index.mjs +2 -1
  35. package/dist/vanilla/index.d.mts +3 -3
  36. package/dist/vanilla/index.mjs +2 -1
  37. package/llms.txt +172 -0
  38. package/package.json +22 -11
  39. package/dist/better-auth-react-adapter-BXL48HIU.d.mts +0 -722
  40. package/dist/supabase-adapter-crabDnl2.d.mts +0 -128
  41. package/dist/ui-CNFBSekF.mjs +0 -401
  42. /package/dist/{adapters-Dkx0zoMR.mjs → adapters-B7YKkjaL.mjs} +0 -0
  43. /package/dist/{index-C-svZlpj.d.mts → index-CPnFzULh.d.mts} +0 -0
  44. /package/dist/{index-DuDD6cIY.d.mts → index-CzsGMS7C.d.mts} +0 -0
  45. /package/dist/{index-UW23fDSn.d.mts → index-OEBbnNdr.d.mts} +0 -0
@@ -1,21 +1,60 @@
1
1
  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_plugins7 from "better-auth/client/plugins";
5
- import * as jose0 from "jose";
6
- import * as better_auth220 from "better-auth";
7
- import * as _better_fetch_fetch138 from "@better-fetch/fetch";
8
- import * as nanostores1 from "nanostores";
9
- import * as better_call0 from "better-call";
2
+ import * as better_auth_client35 from "better-auth/client";
3
+ import { BetterAuthClientOptions, createAuthClient as createAuthClient$1 } from "better-auth/client";
10
4
  import * as zod0 from "zod";
5
+ import * as jose2 from "jose";
6
+ import { Session, User } from "better-auth/types";
7
+ import * as better_auth454 from "better-auth";
8
+ import * as _better_fetch_fetch266 from "@better-fetch/fetch";
9
+ import { BetterFetchError, BetterFetchError as BetterFetchError$1 } from "@better-fetch/fetch";
10
+ import * as better_auth_plugins17 from "better-auth/plugins";
11
+ import * as nanostores7 from "nanostores";
12
+ import * as better_call0 from "better-call";
13
+ import { Invitation, InvitationInput, InvitationStatus, Member, MemberInput, Organization, OrganizationInput, OrganizationRole, Team, TeamInput, TeamMember, TeamMemberInput } from "better-auth/plugins/organization";
14
+ import { JWKOptions, JWSAlgorithms, Jwk, JwtOptions } from "better-auth/plugins/jwt";
15
+ import { AdminOptions, InferAdminRolesFromOption, SessionWithImpersonatedBy, UserWithRole } from "better-auth/plugins/admin";
16
+ import { EmailOTPOptions } from "better-auth/plugins/email-otp";
11
17
 
18
+ //#region src/core/better-auth-types.d.ts
19
+ type BetterAuthSession = Session;
20
+ type BetterAuthUser = User;
21
+ type BetterAuthErrorResponse = BetterFetchError;
22
+ //#endregion
23
+ //#region src/types/index.d.ts
24
+ type BetterAuthInstance = ReturnType<typeof createAuthClient$1<{
25
+ plugins: SupportedBetterAuthClientPlugins;
26
+ }> | typeof createAuthClient<{
27
+ plugins: SupportedBetterAuthClientPlugins;
28
+ }>>;
29
+ //#endregion
12
30
  //#region src/core/adapter-core.d.ts
13
31
  interface NeonAuthAdapterCoreAuthOptions extends Omit<BetterAuthClientOptions, 'plugins'> {}
14
32
  declare const supportedBetterAuthClientPlugins: ({
33
+ id: "anonymous-token";
34
+ pathMethods: {
35
+ "/token/anonymous": "GET";
36
+ };
37
+ getActions: ($fetch: _better_fetch_fetch266.BetterFetch) => {
38
+ getAnonymousToken: (fetchOptions?: any) => Promise<{
39
+ data: {
40
+ token: string;
41
+ expires_at: number;
42
+ };
43
+ error: null;
44
+ } | {
45
+ data: null;
46
+ error: {
47
+ message?: string | undefined;
48
+ status: number;
49
+ statusText: string;
50
+ };
51
+ }>;
52
+ };
53
+ } | {
15
54
  id: "better-auth-client";
16
- $InferServerPlugin: ReturnType<(options?: better_auth_client_plugins7.JwtOptions | undefined) => {
55
+ $InferServerPlugin: ReturnType<(options?: better_auth_plugins17.JwtOptions | undefined) => {
17
56
  id: "jwt";
18
- options: better_auth_client_plugins7.JwtOptions | undefined;
57
+ options: better_auth_plugins17.JwtOptions | undefined;
19
58
  endpoints: {
20
59
  getJwks: better_call0.StrictEndpoint<string, {
21
60
  method: "GET";
@@ -95,7 +134,7 @@ declare const supportedBetterAuthClientPlugins: ({
95
134
  };
96
135
  } & {
97
136
  use: any[];
98
- }, jose0.JSONWebKeySet>;
137
+ }, jose2.JSONWebKeySet>;
99
138
  getToken: better_call0.StrictEndpoint<"/token", {
100
139
  method: "GET";
101
140
  requireHeaders: true;
@@ -156,15 +195,15 @@ declare const supportedBetterAuthClientPlugins: ({
156
195
  SERVER_ONLY: true;
157
196
  $Infer: {
158
197
  body: {
159
- payload: jose0.JWTPayload;
160
- overrideOptions?: better_auth_client_plugins7.JwtOptions | undefined;
198
+ payload: jose2.JWTPayload;
199
+ overrideOptions?: better_auth_plugins17.JwtOptions | undefined;
161
200
  };
162
201
  };
163
202
  };
164
203
  body: zod0.ZodObject<{
165
204
  payload: zod0.ZodRecord<zod0.ZodString, zod0.ZodAny>;
166
205
  overrideOptions: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodAny>>;
167
- }, better_auth220.$strip>;
206
+ }, better_auth454.$strip>;
168
207
  } & {
169
208
  use: any[];
170
209
  }, {
@@ -191,16 +230,16 @@ declare const supportedBetterAuthClientPlugins: ({
191
230
  body: zod0.ZodObject<{
192
231
  token: zod0.ZodString;
193
232
  issuer: zod0.ZodOptional<zod0.ZodString>;
194
- }, better_auth220.$strip>;
233
+ }, better_auth454.$strip>;
195
234
  } & {
196
235
  use: any[];
197
236
  }, {
198
- payload: (jose0.JWTPayload & Required<Pick<jose0.JWTPayload, "sub" | "aud">>) | null;
237
+ payload: (jose2.JWTPayload & Required<Pick<jose2.JWTPayload, "sub" | "aud">>) | null;
199
238
  }>;
200
239
  };
201
240
  hooks: {
202
241
  after: {
203
- matcher(context: better_auth220.HookEndpointContext): boolean;
242
+ matcher(context: better_auth454.HookEndpointContext): boolean;
204
243
  handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<void>;
205
244
  }[];
206
245
  };
@@ -230,7 +269,7 @@ declare const supportedBetterAuthClientPlugins: ({
230
269
  pathMethods: {
231
270
  [x: string]: "GET";
232
271
  };
233
- getActions: ($fetch: _better_fetch_fetch138.BetterFetch) => {
272
+ getActions: ($fetch: _better_fetch_fetch266.BetterFetch) => {
234
273
  jwks: (fetchOptions?: any) => Promise<{
235
274
  data: null;
236
275
  error: {
@@ -239,7 +278,7 @@ declare const supportedBetterAuthClientPlugins: ({
239
278
  statusText: string;
240
279
  };
241
280
  } | {
242
- data: jose0.JSONWebKeySet;
281
+ data: jose2.JSONWebKeySet;
243
282
  error: null;
244
283
  }>;
245
284
  };
@@ -285,7 +324,7 @@ declare const supportedBetterAuthClientPlugins: ({
285
324
  token: string;
286
325
  ipAddress?: string | null | undefined;
287
326
  userAgent?: string | null | undefined;
288
- } & Record<string, unknown>, ctx: better_auth220.GenericEndpointContext | undefined): Promise<void>;
327
+ } & Record<string, unknown>, ctx: better_auth454.GenericEndpointContext | null): Promise<void>;
289
328
  };
290
329
  };
291
330
  };
@@ -293,8 +332,8 @@ declare const supportedBetterAuthClientPlugins: ({
293
332
  };
294
333
  hooks: {
295
334
  after: {
296
- matcher(context: better_auth220.HookEndpointContext): boolean;
297
- handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<better_auth_client_plugins7.SessionWithImpersonatedBy[] | undefined>;
335
+ matcher(context: better_auth454.HookEndpointContext): boolean;
336
+ handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<better_auth_plugins17.SessionWithImpersonatedBy[] | undefined>;
298
337
  }[];
299
338
  };
300
339
  endpoints: {
@@ -303,12 +342,12 @@ declare const supportedBetterAuthClientPlugins: ({
303
342
  body: zod0.ZodObject<{
304
343
  userId: zod0.ZodCoercedString<unknown>;
305
344
  role: zod0.ZodUnion<readonly [zod0.ZodString, zod0.ZodArray<zod0.ZodString>]>;
306
- }, better_auth220.$strip>;
345
+ }, better_auth454.$strip>;
307
346
  requireHeaders: true;
308
347
  use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
309
348
  session: {
310
- user: better_auth_client_plugins7.UserWithRole;
311
- session: better_auth220.Session;
349
+ user: better_auth_plugins17.UserWithRole;
350
+ session: better_auth454.Session;
312
351
  };
313
352
  }>)[];
314
353
  metadata: {
@@ -344,17 +383,17 @@ declare const supportedBetterAuthClientPlugins: ({
344
383
  } & {
345
384
  use: any[];
346
385
  }, {
347
- user: better_auth_client_plugins7.UserWithRole;
386
+ user: better_auth_plugins17.UserWithRole;
348
387
  }>;
349
388
  getUser: better_call0.StrictEndpoint<"/admin/get-user", {
350
389
  method: "GET";
351
390
  query: zod0.ZodObject<{
352
391
  id: zod0.ZodString;
353
- }, better_auth220.$strip>;
392
+ }, better_auth454.$strip>;
354
393
  use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
355
394
  session: {
356
- user: better_auth_client_plugins7.UserWithRole;
357
- session: better_auth220.Session;
395
+ user: better_auth_plugins17.UserWithRole;
396
+ session: better_auth454.Session;
358
397
  };
359
398
  }>)[];
360
399
  metadata: {
@@ -400,7 +439,7 @@ declare const supportedBetterAuthClientPlugins: ({
400
439
  name: zod0.ZodString;
401
440
  role: zod0.ZodOptional<zod0.ZodUnion<readonly [zod0.ZodString, zod0.ZodArray<zod0.ZodString>]>>;
402
441
  data: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodAny>>;
403
- }, better_auth220.$strip>;
442
+ }, better_auth454.$strip>;
404
443
  metadata: {
405
444
  openapi: {
406
445
  operationId: string;
@@ -437,18 +476,18 @@ declare const supportedBetterAuthClientPlugins: ({
437
476
  } & {
438
477
  use: any[];
439
478
  }, {
440
- user: better_auth_client_plugins7.UserWithRole;
479
+ user: better_auth_plugins17.UserWithRole;
441
480
  }>;
442
481
  adminUpdateUser: better_call0.StrictEndpoint<"/admin/update-user", {
443
482
  method: "POST";
444
483
  body: zod0.ZodObject<{
445
484
  userId: zod0.ZodCoercedString<unknown>;
446
485
  data: zod0.ZodRecord<zod0.ZodAny, zod0.ZodAny>;
447
- }, better_auth220.$strip>;
486
+ }, better_auth454.$strip>;
448
487
  use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
449
488
  session: {
450
- user: better_auth_client_plugins7.UserWithRole;
451
- session: better_auth220.Session;
489
+ user: better_auth_plugins17.UserWithRole;
490
+ session: better_auth454.Session;
452
491
  };
453
492
  }>)[];
454
493
  metadata: {
@@ -477,13 +516,13 @@ declare const supportedBetterAuthClientPlugins: ({
477
516
  };
478
517
  } & {
479
518
  use: any[];
480
- }, better_auth_client_plugins7.UserWithRole>;
519
+ }, better_auth_plugins17.UserWithRole>;
481
520
  listUsers: better_call0.StrictEndpoint<"/admin/list-users", {
482
521
  method: "GET";
483
522
  use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
484
523
  session: {
485
- user: better_auth_client_plugins7.UserWithRole;
486
- session: better_auth220.Session;
524
+ user: better_auth_plugins17.UserWithRole;
525
+ session: better_auth454.Session;
487
526
  };
488
527
  }>)[];
489
528
  query: zod0.ZodObject<{
@@ -515,7 +554,7 @@ declare const supportedBetterAuthClientPlugins: ({
515
554
  gte: "gte";
516
555
  contains: "contains";
517
556
  }>>;
518
- }, better_auth220.$strip>;
557
+ }, better_auth454.$strip>;
519
558
  metadata: {
520
559
  openapi: {
521
560
  operationId: string;
@@ -556,7 +595,7 @@ declare const supportedBetterAuthClientPlugins: ({
556
595
  } & {
557
596
  use: any[];
558
597
  }, {
559
- users: better_auth_client_plugins7.UserWithRole[];
598
+ users: better_auth_plugins17.UserWithRole[];
560
599
  total: number;
561
600
  limit: number | undefined;
562
601
  offset: number | undefined;
@@ -568,13 +607,13 @@ declare const supportedBetterAuthClientPlugins: ({
568
607
  method: "POST";
569
608
  use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
570
609
  session: {
571
- user: better_auth_client_plugins7.UserWithRole;
572
- session: better_auth220.Session;
610
+ user: better_auth_plugins17.UserWithRole;
611
+ session: better_auth454.Session;
573
612
  };
574
613
  }>)[];
575
614
  body: zod0.ZodObject<{
576
615
  userId: zod0.ZodCoercedString<unknown>;
577
- }, better_auth220.$strip>;
616
+ }, better_auth454.$strip>;
578
617
  metadata: {
579
618
  openapi: {
580
619
  operationId: string;
@@ -605,17 +644,17 @@ declare const supportedBetterAuthClientPlugins: ({
605
644
  } & {
606
645
  use: any[];
607
646
  }, {
608
- sessions: better_auth_client_plugins7.SessionWithImpersonatedBy[];
647
+ sessions: better_auth_plugins17.SessionWithImpersonatedBy[];
609
648
  }>;
610
649
  unbanUser: better_call0.StrictEndpoint<"/admin/unban-user", {
611
650
  method: "POST";
612
651
  body: zod0.ZodObject<{
613
652
  userId: zod0.ZodCoercedString<unknown>;
614
- }, better_auth220.$strip>;
653
+ }, better_auth454.$strip>;
615
654
  use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
616
655
  session: {
617
- user: better_auth_client_plugins7.UserWithRole;
618
- session: better_auth220.Session;
656
+ user: better_auth_plugins17.UserWithRole;
657
+ session: better_auth454.Session;
619
658
  };
620
659
  }>)[];
621
660
  metadata: {
@@ -661,11 +700,11 @@ declare const supportedBetterAuthClientPlugins: ({
661
700
  userId: zod0.ZodCoercedString<unknown>;
662
701
  banReason: zod0.ZodOptional<zod0.ZodString>;
663
702
  banExpiresIn: zod0.ZodOptional<zod0.ZodNumber>;
664
- }, better_auth220.$strip>;
703
+ }, better_auth454.$strip>;
665
704
  use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
666
705
  session: {
667
- user: better_auth_client_plugins7.UserWithRole;
668
- session: better_auth220.Session;
706
+ user: better_auth_plugins17.UserWithRole;
707
+ session: better_auth454.Session;
669
708
  };
670
709
  }>)[];
671
710
  metadata: {
@@ -709,11 +748,11 @@ declare const supportedBetterAuthClientPlugins: ({
709
748
  method: "POST";
710
749
  body: zod0.ZodObject<{
711
750
  userId: zod0.ZodCoercedString<unknown>;
712
- }, better_auth220.$strip>;
751
+ }, better_auth454.$strip>;
713
752
  use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
714
753
  session: {
715
- user: better_auth_client_plugins7.UserWithRole;
716
- session: better_auth220.Session;
754
+ user: better_auth_plugins17.UserWithRole;
755
+ session: better_auth454.Session;
717
756
  };
718
757
  }>)[];
719
758
  metadata: {
@@ -756,15 +795,7 @@ declare const supportedBetterAuthClientPlugins: ({
756
795
  ipAddress?: string | null | undefined;
757
796
  userAgent?: string | null | undefined;
758
797
  };
759
- user: {
760
- id: string;
761
- createdAt: Date;
762
- updatedAt: Date;
763
- email: string;
764
- emailVerified: boolean;
765
- name: string;
766
- image?: string | null | undefined;
767
- };
798
+ user: better_auth_plugins17.UserWithRole;
768
799
  }>;
769
800
  stopImpersonating: better_call0.StrictEndpoint<"/admin/stop-impersonating", {
770
801
  method: "POST";
@@ -772,18 +803,18 @@ declare const supportedBetterAuthClientPlugins: ({
772
803
  } & {
773
804
  use: any[];
774
805
  }, {
775
- session: better_auth220.Session & Record<string, any>;
776
- user: better_auth220.User & Record<string, any>;
806
+ session: better_auth454.Session & Record<string, any>;
807
+ user: better_auth454.User & Record<string, any>;
777
808
  }>;
778
809
  revokeUserSession: better_call0.StrictEndpoint<"/admin/revoke-user-session", {
779
810
  method: "POST";
780
811
  body: zod0.ZodObject<{
781
812
  sessionToken: zod0.ZodString;
782
- }, better_auth220.$strip>;
813
+ }, better_auth454.$strip>;
783
814
  use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
784
815
  session: {
785
- user: better_auth_client_plugins7.UserWithRole;
786
- session: better_auth220.Session;
816
+ user: better_auth_plugins17.UserWithRole;
817
+ session: better_auth454.Session;
787
818
  };
788
819
  }>)[];
789
820
  metadata: {
@@ -819,11 +850,11 @@ declare const supportedBetterAuthClientPlugins: ({
819
850
  method: "POST";
820
851
  body: zod0.ZodObject<{
821
852
  userId: zod0.ZodCoercedString<unknown>;
822
- }, better_auth220.$strip>;
853
+ }, better_auth454.$strip>;
823
854
  use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
824
855
  session: {
825
- user: better_auth_client_plugins7.UserWithRole;
826
- session: better_auth220.Session;
856
+ user: better_auth_plugins17.UserWithRole;
857
+ session: better_auth454.Session;
827
858
  };
828
859
  }>)[];
829
860
  metadata: {
@@ -859,11 +890,11 @@ declare const supportedBetterAuthClientPlugins: ({
859
890
  method: "POST";
860
891
  body: zod0.ZodObject<{
861
892
  userId: zod0.ZodCoercedString<unknown>;
862
- }, better_auth220.$strip>;
893
+ }, better_auth454.$strip>;
863
894
  use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
864
895
  session: {
865
- user: better_auth_client_plugins7.UserWithRole;
866
- session: better_auth220.Session;
896
+ user: better_auth_plugins17.UserWithRole;
897
+ session: better_auth454.Session;
867
898
  };
868
899
  }>)[];
869
900
  metadata: {
@@ -900,11 +931,11 @@ declare const supportedBetterAuthClientPlugins: ({
900
931
  body: zod0.ZodObject<{
901
932
  newPassword: zod0.ZodString;
902
933
  userId: zod0.ZodCoercedString<unknown>;
903
- }, better_auth220.$strip>;
934
+ }, better_auth454.$strip>;
904
935
  use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
905
936
  session: {
906
- user: better_auth_client_plugins7.UserWithRole;
907
- session: better_auth220.Session;
937
+ user: better_auth_plugins17.UserWithRole;
938
+ session: better_auth454.Session;
908
939
  };
909
940
  }>)[];
910
941
  metadata: {
@@ -941,13 +972,13 @@ declare const supportedBetterAuthClientPlugins: ({
941
972
  body: zod0.ZodIntersection<zod0.ZodObject<{
942
973
  userId: zod0.ZodOptional<zod0.ZodCoercedString<unknown>>;
943
974
  role: zod0.ZodOptional<zod0.ZodString>;
944
- }, better_auth220.$strip>, zod0.ZodUnion<readonly [zod0.ZodObject<{
975
+ }, better_auth454.$strip>, zod0.ZodUnion<readonly [zod0.ZodObject<{
945
976
  permission: zod0.ZodRecord<zod0.ZodString, zod0.ZodArray<zod0.ZodString>>;
946
977
  permissions: zod0.ZodUndefined;
947
- }, better_auth220.$strip>, zod0.ZodObject<{
978
+ }, better_auth454.$strip>, zod0.ZodObject<{
948
979
  permission: zod0.ZodUndefined;
949
980
  permissions: zod0.ZodRecord<zod0.ZodString, zod0.ZodArray<zod0.ZodString>>;
950
- }, better_auth220.$strip>]>>;
981
+ }, better_auth454.$strip>]>>;
951
982
  metadata: {
952
983
  openapi: {
953
984
  description: string;
@@ -997,14 +1028,14 @@ declare const supportedBetterAuthClientPlugins: ({
997
1028
  $Infer: {
998
1029
  body: ({
999
1030
  permission: {
1000
- readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get" | "update")[] | undefined;
1001
- readonly session?: ("list" | "delete" | "revoke")[] | undefined;
1031
+ readonly user?: ("get" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "set-password" | "update")[] | undefined;
1032
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
1002
1033
  };
1003
1034
  permissions?: never | undefined;
1004
1035
  } | {
1005
1036
  permissions: {
1006
- readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get" | "update")[] | undefined;
1007
- readonly session?: ("list" | "delete" | "revoke")[] | undefined;
1037
+ readonly user?: ("get" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "set-password" | "update")[] | undefined;
1038
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
1008
1039
  };
1009
1040
  permission?: never | undefined;
1010
1041
  }) & {
@@ -1040,6 +1071,7 @@ declare const supportedBetterAuthClientPlugins: ({
1040
1071
  readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: "You are not allowed to update users";
1041
1072
  readonly YOU_CANNOT_REMOVE_YOURSELF: "You cannot remove yourself";
1042
1073
  readonly YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: "You are not allowed to set a non-existent role value";
1074
+ readonly YOU_CANNOT_IMPERSONATE_ADMINS: "You cannot impersonate admins";
1043
1075
  };
1044
1076
  schema: {
1045
1077
  user: {
@@ -1082,14 +1114,14 @@ declare const supportedBetterAuthClientPlugins: ({
1082
1114
  admin: {
1083
1115
  checkRolePermission: <R extends "user" | "admin">(data: ({
1084
1116
  permission: {
1085
- readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get" | "update")[] | undefined;
1086
- readonly session?: ("list" | "delete" | "revoke")[] | undefined;
1117
+ readonly user?: ("get" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "set-password" | "update")[] | undefined;
1118
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
1087
1119
  };
1088
1120
  permissions?: never | undefined;
1089
1121
  } | {
1090
1122
  permissions: {
1091
- readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get" | "update")[] | undefined;
1092
- readonly session?: ("list" | "delete" | "revoke")[] | undefined;
1123
+ readonly user?: ("get" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "set-password" | "update")[] | undefined;
1124
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
1093
1125
  };
1094
1126
  permission?: never | undefined;
1095
1127
  }) & {
@@ -1103,8 +1135,8 @@ declare const supportedBetterAuthClientPlugins: ({
1103
1135
  };
1104
1136
  } | {
1105
1137
  id: "organization";
1106
- $InferServerPlugin: better_auth_client11.OrganizationPlugin<{
1107
- ac: better_auth_client11.AccessControl<{
1138
+ $InferServerPlugin: better_auth_client35.OrganizationPlugin<{
1139
+ ac: better_auth_client35.AccessControl<{
1108
1140
  readonly organization: readonly ["update", "delete"];
1109
1141
  readonly member: readonly ["create", "update", "delete"];
1110
1142
  readonly invitation: readonly ["create", "cancel"];
@@ -1112,9 +1144,9 @@ declare const supportedBetterAuthClientPlugins: ({
1112
1144
  readonly ac: readonly ["create", "read", "update", "delete"];
1113
1145
  }>;
1114
1146
  roles: {
1115
- admin: better_auth_client11.Role;
1116
- member: better_auth_client11.Role;
1117
- owner: better_auth_client11.Role;
1147
+ admin: better_auth_client35.Role;
1148
+ member: better_auth_client35.Role;
1149
+ owner: better_auth_client35.Role;
1118
1150
  };
1119
1151
  teams: {
1120
1152
  enabled: false;
@@ -1122,27 +1154,27 @@ declare const supportedBetterAuthClientPlugins: ({
1122
1154
  schema: {
1123
1155
  organization?: {
1124
1156
  additionalFields?: {
1125
- [key: string]: better_auth220.DBFieldAttribute;
1157
+ [key: string]: better_auth454.DBFieldAttribute;
1126
1158
  };
1127
1159
  };
1128
1160
  member?: {
1129
1161
  additionalFields?: {
1130
- [key: string]: better_auth220.DBFieldAttribute;
1162
+ [key: string]: better_auth454.DBFieldAttribute;
1131
1163
  };
1132
1164
  };
1133
1165
  invitation?: {
1134
1166
  additionalFields?: {
1135
- [key: string]: better_auth220.DBFieldAttribute;
1167
+ [key: string]: better_auth454.DBFieldAttribute;
1136
1168
  };
1137
1169
  };
1138
1170
  team?: {
1139
1171
  additionalFields?: {
1140
- [key: string]: better_auth220.DBFieldAttribute;
1172
+ [key: string]: better_auth454.DBFieldAttribute;
1141
1173
  };
1142
1174
  };
1143
1175
  organizationRole?: {
1144
1176
  additionalFields?: {
1145
- [key: string]: better_auth220.DBFieldAttribute;
1177
+ [key: string]: better_auth454.DBFieldAttribute;
1146
1178
  };
1147
1179
  };
1148
1180
  } | undefined;
@@ -1150,7 +1182,7 @@ declare const supportedBetterAuthClientPlugins: ({
1150
1182
  enabled: false;
1151
1183
  };
1152
1184
  }>;
1153
- getActions: ($fetch: _better_fetch_fetch138.BetterFetch, _$store: better_auth220.ClientStore, co: BetterAuthClientOptions | undefined) => {
1185
+ getActions: ($fetch: _better_fetch_fetch266.BetterFetch, _$store: better_auth454.ClientStore, co: BetterAuthClientOptions | undefined) => {
1154
1186
  $Infer: {
1155
1187
  ActiveOrganization: {
1156
1188
  members: {
@@ -1171,7 +1203,7 @@ declare const supportedBetterAuthClientPlugins: ({
1171
1203
  organizationId: string;
1172
1204
  email: string;
1173
1205
  role: "admin" | "member" | "owner";
1174
- status: better_auth_client11.InvitationStatus;
1206
+ status: better_auth_client35.InvitationStatus;
1175
1207
  inviterId: string;
1176
1208
  expiresAt: Date;
1177
1209
  createdAt: Date;
@@ -1197,7 +1229,7 @@ declare const supportedBetterAuthClientPlugins: ({
1197
1229
  organizationId: string;
1198
1230
  email: string;
1199
1231
  role: "admin" | "member" | "owner";
1200
- status: better_auth_client11.InvitationStatus;
1232
+ status: better_auth_client35.InvitationStatus;
1201
1233
  inviterId: string;
1202
1234
  expiresAt: Date;
1203
1235
  createdAt: Date;
@@ -1227,19 +1259,19 @@ declare const supportedBetterAuthClientPlugins: ({
1227
1259
  checkRolePermission: <R extends "admin" | "member" | "owner">(data: ({
1228
1260
  permission: {
1229
1261
  readonly organization?: ("delete" | "update")[] | undefined;
1230
- readonly member?: ("create" | "delete" | "update")[] | undefined;
1231
- readonly invitation?: ("create" | "cancel")[] | undefined;
1232
- readonly team?: ("create" | "delete" | "update")[] | undefined;
1233
- readonly ac?: ("create" | "delete" | "update" | "read")[] | undefined;
1262
+ readonly member?: ("delete" | "create" | "update")[] | undefined;
1263
+ readonly invitation?: ("cancel" | "create")[] | undefined;
1264
+ readonly team?: ("delete" | "create" | "update")[] | undefined;
1265
+ readonly ac?: ("delete" | "create" | "update" | "read")[] | undefined;
1234
1266
  };
1235
1267
  permissions?: never | undefined;
1236
1268
  } | {
1237
1269
  permissions: {
1238
1270
  readonly organization?: ("delete" | "update")[] | undefined;
1239
- readonly member?: ("create" | "delete" | "update")[] | undefined;
1240
- readonly invitation?: ("create" | "cancel")[] | undefined;
1241
- readonly team?: ("create" | "delete" | "update")[] | undefined;
1242
- readonly ac?: ("create" | "delete" | "update" | "read")[] | undefined;
1271
+ readonly member?: ("delete" | "create" | "update")[] | undefined;
1272
+ readonly invitation?: ("cancel" | "create")[] | undefined;
1273
+ readonly team?: ("delete" | "create" | "update")[] | undefined;
1274
+ readonly ac?: ("delete" | "create" | "update" | "read")[] | undefined;
1243
1275
  };
1244
1276
  permission?: never | undefined;
1245
1277
  }) & {
@@ -1247,13 +1279,13 @@ declare const supportedBetterAuthClientPlugins: ({
1247
1279
  }) => boolean;
1248
1280
  };
1249
1281
  };
1250
- getAtoms: ($fetch: _better_fetch_fetch138.BetterFetch) => {
1251
- $listOrg: nanostores1.PreinitializedWritableAtom<boolean> & object;
1252
- $activeOrgSignal: nanostores1.PreinitializedWritableAtom<boolean> & object;
1253
- $activeMemberSignal: nanostores1.PreinitializedWritableAtom<boolean> & object;
1254
- $activeMemberRoleSignal: nanostores1.PreinitializedWritableAtom<boolean> & object;
1255
- activeOrganization: nanostores1.PreinitializedWritableAtom<{
1256
- data: better_auth220.Prettify<{
1282
+ getAtoms: ($fetch: _better_fetch_fetch266.BetterFetch) => {
1283
+ $listOrg: nanostores7.PreinitializedWritableAtom<boolean> & object;
1284
+ $activeOrgSignal: nanostores7.PreinitializedWritableAtom<boolean> & object;
1285
+ $activeMemberSignal: nanostores7.PreinitializedWritableAtom<boolean> & object;
1286
+ $activeMemberRoleSignal: nanostores7.PreinitializedWritableAtom<boolean> & object;
1287
+ activeOrganization: nanostores7.PreinitializedWritableAtom<{
1288
+ data: better_auth454.Prettify<{
1257
1289
  id: string;
1258
1290
  name: string;
1259
1291
  slug: string;
@@ -1279,20 +1311,20 @@ declare const supportedBetterAuthClientPlugins: ({
1279
1311
  organizationId: string;
1280
1312
  email: string;
1281
1313
  role: "admin" | "member" | "owner";
1282
- status: better_auth_client11.InvitationStatus;
1314
+ status: better_auth_client35.InvitationStatus;
1283
1315
  inviterId: string;
1284
1316
  expiresAt: Date;
1285
1317
  createdAt: Date;
1286
1318
  }[];
1287
1319
  }> | null;
1288
- error: null | _better_fetch_fetch138.BetterFetchError;
1320
+ error: null | _better_fetch_fetch266.BetterFetchError;
1289
1321
  isPending: boolean;
1290
1322
  isRefetching: boolean;
1291
1323
  refetch: (queryParams?: {
1292
- query?: better_auth220.SessionQueryParams;
1324
+ query?: better_auth454.SessionQueryParams;
1293
1325
  } | undefined) => Promise<void>;
1294
1326
  }> & object;
1295
- listOrganizations: nanostores1.PreinitializedWritableAtom<{
1327
+ listOrganizations: nanostores7.PreinitializedWritableAtom<{
1296
1328
  data: {
1297
1329
  id: string;
1298
1330
  name: string;
@@ -1301,14 +1333,14 @@ declare const supportedBetterAuthClientPlugins: ({
1301
1333
  logo?: string | null | undefined | undefined;
1302
1334
  metadata?: any;
1303
1335
  }[] | null;
1304
- error: null | _better_fetch_fetch138.BetterFetchError;
1336
+ error: null | _better_fetch_fetch266.BetterFetchError;
1305
1337
  isPending: boolean;
1306
1338
  isRefetching: boolean;
1307
1339
  refetch: (queryParams?: {
1308
- query?: better_auth220.SessionQueryParams;
1340
+ query?: better_auth454.SessionQueryParams;
1309
1341
  } | undefined) => Promise<void>;
1310
1342
  }> & object;
1311
- activeMember: nanostores1.PreinitializedWritableAtom<{
1343
+ activeMember: nanostores7.PreinitializedWritableAtom<{
1312
1344
  data: {
1313
1345
  id: string;
1314
1346
  organizationId: string;
@@ -1316,22 +1348,22 @@ declare const supportedBetterAuthClientPlugins: ({
1316
1348
  role: string;
1317
1349
  createdAt: Date;
1318
1350
  } | null;
1319
- error: null | _better_fetch_fetch138.BetterFetchError;
1351
+ error: null | _better_fetch_fetch266.BetterFetchError;
1320
1352
  isPending: boolean;
1321
1353
  isRefetching: boolean;
1322
1354
  refetch: (queryParams?: {
1323
- query?: better_auth220.SessionQueryParams;
1355
+ query?: better_auth454.SessionQueryParams;
1324
1356
  } | undefined) => Promise<void>;
1325
1357
  }> & object;
1326
- activeMemberRole: nanostores1.PreinitializedWritableAtom<{
1358
+ activeMemberRole: nanostores7.PreinitializedWritableAtom<{
1327
1359
  data: {
1328
1360
  role: string;
1329
1361
  } | null;
1330
- error: null | _better_fetch_fetch138.BetterFetchError;
1362
+ error: null | _better_fetch_fetch266.BetterFetchError;
1331
1363
  isPending: boolean;
1332
1364
  isRefetching: boolean;
1333
1365
  refetch: (queryParams?: {
1334
- query?: better_auth220.SessionQueryParams;
1366
+ query?: better_auth454.SessionQueryParams;
1335
1367
  } | undefined) => Promise<void>;
1336
1368
  }> & object;
1337
1369
  };
@@ -1357,13 +1389,13 @@ declare const supportedBetterAuthClientPlugins: ({
1357
1389
  })[];
1358
1390
  } | {
1359
1391
  id: "email-otp";
1360
- $InferServerPlugin: {
1392
+ $InferServerPlugin: ReturnType<(options: better_auth_plugins17.EmailOTPOptions) => {
1361
1393
  id: "email-otp";
1362
- init(ctx: better_auth220.AuthContext): {
1394
+ init(ctx: better_auth454.AuthContext): {
1363
1395
  options: {
1364
1396
  emailVerification: {
1365
1397
  sendVerificationEmail(data: {
1366
- user: better_auth220.User;
1398
+ user: better_auth454.User;
1367
1399
  url: string;
1368
1400
  token: string;
1369
1401
  }, request: Request | undefined): Promise<void>;
@@ -1380,7 +1412,7 @@ declare const supportedBetterAuthClientPlugins: ({
1380
1412
  "email-verification": "email-verification";
1381
1413
  "forget-password": "forget-password";
1382
1414
  }>;
1383
- }, better_auth220.$strip>;
1415
+ }, better_auth454.$strip>;
1384
1416
  metadata: {
1385
1417
  openapi: {
1386
1418
  operationId: string;
@@ -1418,7 +1450,7 @@ declare const supportedBetterAuthClientPlugins: ({
1418
1450
  "email-verification": "email-verification";
1419
1451
  "forget-password": "forget-password";
1420
1452
  }>;
1421
- }, better_auth220.$strip>;
1453
+ }, better_auth454.$strip>;
1422
1454
  metadata: {
1423
1455
  SERVER_ONLY: true;
1424
1456
  openapi: {
@@ -1450,7 +1482,7 @@ declare const supportedBetterAuthClientPlugins: ({
1450
1482
  "email-verification": "email-verification";
1451
1483
  "forget-password": "forget-password";
1452
1484
  }>;
1453
- }, better_auth220.$strip>;
1485
+ }, better_auth454.$strip>;
1454
1486
  metadata: {
1455
1487
  SERVER_ONLY: true;
1456
1488
  openapi: {
@@ -1495,7 +1527,7 @@ declare const supportedBetterAuthClientPlugins: ({
1495
1527
  "forget-password": "forget-password";
1496
1528
  }>;
1497
1529
  otp: zod0.ZodString;
1498
- }, better_auth220.$strip>;
1530
+ }, better_auth454.$strip>;
1499
1531
  metadata: {
1500
1532
  openapi: {
1501
1533
  operationId: string;
@@ -1529,7 +1561,7 @@ declare const supportedBetterAuthClientPlugins: ({
1529
1561
  body: zod0.ZodObject<{
1530
1562
  email: zod0.ZodString;
1531
1563
  otp: zod0.ZodString;
1532
- }, better_auth220.$strip>;
1564
+ }, better_auth454.$strip>;
1533
1565
  metadata: {
1534
1566
  openapi: {
1535
1567
  description: string;
@@ -1595,7 +1627,7 @@ declare const supportedBetterAuthClientPlugins: ({
1595
1627
  body: zod0.ZodObject<{
1596
1628
  email: zod0.ZodString;
1597
1629
  otp: zod0.ZodString;
1598
- }, better_auth220.$strip>;
1630
+ }, better_auth454.$strip>;
1599
1631
  metadata: {
1600
1632
  openapi: {
1601
1633
  operationId: string;
@@ -1642,7 +1674,7 @@ declare const supportedBetterAuthClientPlugins: ({
1642
1674
  method: "POST";
1643
1675
  body: zod0.ZodObject<{
1644
1676
  email: zod0.ZodString;
1645
- }, better_auth220.$strip>;
1677
+ }, better_auth454.$strip>;
1646
1678
  metadata: {
1647
1679
  openapi: {
1648
1680
  operationId: string;
@@ -1678,7 +1710,7 @@ declare const supportedBetterAuthClientPlugins: ({
1678
1710
  email: zod0.ZodString;
1679
1711
  otp: zod0.ZodString;
1680
1712
  password: zod0.ZodString;
1681
- }, better_auth220.$strip>;
1713
+ }, better_auth454.$strip>;
1682
1714
  metadata: {
1683
1715
  openapi: {
1684
1716
  operationId: string;
@@ -1710,7 +1742,7 @@ declare const supportedBetterAuthClientPlugins: ({
1710
1742
  };
1711
1743
  hooks: {
1712
1744
  after: {
1713
- matcher(context: better_auth220.HookEndpointContext): boolean;
1745
+ matcher(context: better_auth454.HookEndpointContext): boolean;
1714
1746
  handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<void>;
1715
1747
  }[];
1716
1748
  };
@@ -1736,496 +1768,11 @@ declare const supportedBetterAuthClientPlugins: ({
1736
1768
  window: number;
1737
1769
  max: number;
1738
1770
  })[];
1739
- };
1740
- atomListeners: {
1741
- matcher: (path: string) => path is "/email-otp/verify-email" | "/sign-in/email-otp";
1742
- signal: "$sessionSignal";
1743
- }[];
1744
- } | {
1745
- id: "anonymous";
1746
- $InferServerPlugin: ReturnType<(options?: better_auth_client_plugins7.AnonymousOptions | undefined) => {
1747
- id: "anonymous";
1748
- endpoints: {
1749
- signInAnonymous: better_call0.StrictEndpoint<"/sign-in/anonymous", {
1750
- method: "POST";
1751
- metadata: {
1752
- openapi: {
1753
- description: string;
1754
- responses: {
1755
- 200: {
1756
- description: string;
1757
- content: {
1758
- "application/json": {
1759
- schema: {
1760
- type: "object";
1761
- properties: {
1762
- user: {
1763
- $ref: string;
1764
- };
1765
- session: {
1766
- $ref: string;
1767
- };
1768
- };
1769
- };
1770
- };
1771
- };
1772
- };
1773
- };
1774
- };
1775
- };
1776
- } & {
1777
- use: any[];
1778
- }, {
1779
- token: string;
1780
- user: {
1781
- id: string;
1782
- email: string;
1783
- emailVerified: boolean;
1784
- name: string;
1785
- createdAt: Date;
1786
- updatedAt: Date;
1787
- };
1788
- } | null>;
1789
- };
1790
- hooks: {
1791
- after: {
1792
- matcher(ctx: better_auth220.HookEndpointContext): boolean;
1793
- handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<void>;
1794
- }[];
1795
- };
1796
- schema: {
1797
- user: {
1798
- fields: {
1799
- isAnonymous: {
1800
- type: "boolean";
1801
- required: false;
1802
- input: false;
1803
- defaultValue: false;
1804
- };
1805
- };
1806
- };
1807
- };
1808
- $ERROR_CODES: {
1809
- readonly INVALID_EMAIL_FORMAT: "Email was not generated in a valid format";
1810
- readonly FAILED_TO_CREATE_USER: "Failed to create user";
1811
- readonly COULD_NOT_CREATE_SESSION: "Could not create session";
1812
- readonly ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY: "Anonymous users cannot sign in again anonymously";
1813
- };
1814
1771
  }>;
1815
- pathMethods: {
1816
- "/sign-in/anonymous": "POST";
1817
- };
1818
1772
  atomListeners: {
1819
- matcher: (path: string) => path is "/sign-in/anonymous";
1820
- signal: "$sessionSignal";
1821
- }[];
1822
- } | {
1823
- id: "phoneNumber";
1824
- $InferServerPlugin: ReturnType<(options?: better_auth_client_plugins7.PhoneNumberOptions | undefined) => {
1825
- id: "phone-number";
1826
- hooks: {
1827
- before: {
1828
- matcher: (ctx: better_auth220.HookEndpointContext) => boolean;
1829
- handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<never>;
1830
- }[];
1831
- };
1832
- endpoints: {
1833
- signInPhoneNumber: better_call0.StrictEndpoint<"/sign-in/phone-number", {
1834
- method: "POST";
1835
- body: zod0.ZodObject<{
1836
- phoneNumber: zod0.ZodString;
1837
- password: zod0.ZodString;
1838
- rememberMe: zod0.ZodOptional<zod0.ZodBoolean>;
1839
- }, better_auth220.$strip>;
1840
- metadata: {
1841
- openapi: {
1842
- summary: string;
1843
- description: string;
1844
- responses: {
1845
- 200: {
1846
- description: string;
1847
- content: {
1848
- "application/json": {
1849
- schema: {
1850
- type: "object";
1851
- properties: {
1852
- user: {
1853
- $ref: string;
1854
- };
1855
- session: {
1856
- $ref: string;
1857
- };
1858
- };
1859
- };
1860
- };
1861
- };
1862
- };
1863
- 400: {
1864
- description: string;
1865
- };
1866
- };
1867
- };
1868
- };
1869
- } & {
1870
- use: any[];
1871
- }, {
1872
- token: string;
1873
- user: better_auth_client_plugins7.UserWithPhoneNumber;
1874
- }>;
1875
- sendPhoneNumberOTP: better_call0.StrictEndpoint<"/phone-number/send-otp", {
1876
- method: "POST";
1877
- body: zod0.ZodObject<{
1878
- phoneNumber: zod0.ZodString;
1879
- }, better_auth220.$strip>;
1880
- metadata: {
1881
- openapi: {
1882
- summary: string;
1883
- description: string;
1884
- responses: {
1885
- 200: {
1886
- description: string;
1887
- content: {
1888
- "application/json": {
1889
- schema: {
1890
- type: "object";
1891
- properties: {
1892
- message: {
1893
- type: string;
1894
- };
1895
- };
1896
- };
1897
- };
1898
- };
1899
- };
1900
- };
1901
- };
1902
- };
1903
- } & {
1904
- use: any[];
1905
- }, {
1906
- message: string;
1907
- }>;
1908
- verifyPhoneNumber: better_call0.StrictEndpoint<"/phone-number/verify", {
1909
- method: "POST";
1910
- body: zod0.ZodObject<{
1911
- phoneNumber: zod0.ZodString;
1912
- code: zod0.ZodString;
1913
- disableSession: zod0.ZodOptional<zod0.ZodBoolean>;
1914
- updatePhoneNumber: zod0.ZodOptional<zod0.ZodBoolean>;
1915
- }, better_auth220.$strip>;
1916
- metadata: {
1917
- openapi: {
1918
- summary: string;
1919
- description: string;
1920
- responses: {
1921
- "200": {
1922
- description: string;
1923
- content: {
1924
- "application/json": {
1925
- schema: {
1926
- type: "object";
1927
- properties: {
1928
- status: {
1929
- type: string;
1930
- description: string;
1931
- enum: boolean[];
1932
- };
1933
- token: {
1934
- type: string;
1935
- nullable: boolean;
1936
- description: string;
1937
- };
1938
- user: {
1939
- type: string;
1940
- nullable: boolean;
1941
- properties: {
1942
- id: {
1943
- type: string;
1944
- description: string;
1945
- };
1946
- email: {
1947
- type: string;
1948
- format: string;
1949
- nullable: boolean;
1950
- description: string;
1951
- };
1952
- emailVerified: {
1953
- type: string;
1954
- nullable: boolean;
1955
- description: string;
1956
- };
1957
- name: {
1958
- type: string;
1959
- nullable: boolean;
1960
- description: string;
1961
- };
1962
- image: {
1963
- type: string;
1964
- format: string;
1965
- nullable: boolean;
1966
- description: string;
1967
- };
1968
- phoneNumber: {
1969
- type: string;
1970
- description: string;
1971
- };
1972
- phoneNumberVerified: {
1973
- type: string;
1974
- description: string;
1975
- };
1976
- createdAt: {
1977
- type: string;
1978
- format: string;
1979
- description: string;
1980
- };
1981
- updatedAt: {
1982
- type: string;
1983
- format: string;
1984
- description: string;
1985
- };
1986
- };
1987
- required: string[];
1988
- description: string;
1989
- };
1990
- };
1991
- required: string[];
1992
- };
1993
- };
1994
- };
1995
- };
1996
- 400: {
1997
- description: string;
1998
- };
1999
- };
2000
- };
2001
- };
2002
- } & {
2003
- use: any[];
2004
- }, {
2005
- status: boolean;
2006
- token: string;
2007
- user: better_auth_client_plugins7.UserWithPhoneNumber;
2008
- } | {
2009
- status: boolean;
2010
- token: null;
2011
- user: better_auth_client_plugins7.UserWithPhoneNumber;
2012
- }>;
2013
- requestPasswordResetPhoneNumber: better_call0.StrictEndpoint<"/phone-number/request-password-reset", {
2014
- method: "POST";
2015
- body: zod0.ZodObject<{
2016
- phoneNumber: zod0.ZodString;
2017
- }, better_auth220.$strip>;
2018
- metadata: {
2019
- openapi: {
2020
- description: string;
2021
- responses: {
2022
- "200": {
2023
- description: string;
2024
- content: {
2025
- "application/json": {
2026
- schema: {
2027
- type: "object";
2028
- properties: {
2029
- status: {
2030
- type: string;
2031
- description: string;
2032
- enum: boolean[];
2033
- };
2034
- };
2035
- required: string[];
2036
- };
2037
- };
2038
- };
2039
- };
2040
- };
2041
- };
2042
- };
2043
- } & {
2044
- use: any[];
2045
- }, {
2046
- status: boolean;
2047
- }>;
2048
- resetPasswordPhoneNumber: better_call0.StrictEndpoint<"/phone-number/reset-password", {
2049
- method: "POST";
2050
- body: zod0.ZodObject<{
2051
- otp: zod0.ZodString;
2052
- phoneNumber: zod0.ZodString;
2053
- newPassword: zod0.ZodString;
2054
- }, better_auth220.$strip>;
2055
- metadata: {
2056
- openapi: {
2057
- description: string;
2058
- responses: {
2059
- "200": {
2060
- description: string;
2061
- content: {
2062
- "application/json": {
2063
- schema: {
2064
- type: "object";
2065
- properties: {
2066
- status: {
2067
- type: string;
2068
- description: string;
2069
- enum: boolean[];
2070
- };
2071
- };
2072
- required: string[];
2073
- };
2074
- };
2075
- };
2076
- };
2077
- };
2078
- };
2079
- };
2080
- } & {
2081
- use: any[];
2082
- }, {
2083
- status: boolean;
2084
- }>;
2085
- };
2086
- schema: {
2087
- user: {
2088
- fields: {
2089
- phoneNumber: {
2090
- type: "string";
2091
- required: false;
2092
- unique: true;
2093
- sortable: true;
2094
- returned: true;
2095
- };
2096
- phoneNumberVerified: {
2097
- type: "boolean";
2098
- required: false;
2099
- returned: true;
2100
- input: false;
2101
- };
2102
- };
2103
- };
2104
- };
2105
- rateLimit: {
2106
- pathMatcher(path: string): boolean;
2107
- window: number;
2108
- max: number;
2109
- }[];
2110
- $ERROR_CODES: {
2111
- readonly INVALID_PHONE_NUMBER: "Invalid phone number";
2112
- readonly PHONE_NUMBER_EXIST: "Phone number already exists";
2113
- readonly PHONE_NUMBER_NOT_EXIST: "phone number isn't registered";
2114
- readonly INVALID_PHONE_NUMBER_OR_PASSWORD: "Invalid phone number or password";
2115
- readonly UNEXPECTED_ERROR: "Unexpected error";
2116
- readonly OTP_NOT_FOUND: "OTP not found";
2117
- readonly OTP_EXPIRED: "OTP expired";
2118
- readonly INVALID_OTP: "Invalid OTP";
2119
- readonly PHONE_NUMBER_NOT_VERIFIED: "Phone number not verified";
2120
- readonly PHONE_NUMBER_CANNOT_BE_UPDATED: "Phone number cannot be updated";
2121
- readonly SEND_OTP_NOT_IMPLEMENTED: "sendOTP not implemented";
2122
- readonly TOO_MANY_ATTEMPTS: "Too many attempts";
2123
- };
2124
- }>;
2125
- atomListeners: {
2126
- matcher(path: string): path is "/phone-number/verify" | "/sign-in/phone-number" | "/phone-number/update";
1773
+ matcher: (path: string) => path is "/email-otp/verify-email" | "/sign-in/email-otp";
2127
1774
  signal: "$sessionSignal";
2128
1775
  }[];
2129
- } | {
2130
- id: "magic-link";
2131
- $InferServerPlugin: {
2132
- id: "magic-link";
2133
- endpoints: {
2134
- signInMagicLink: better_call0.StrictEndpoint<"/sign-in/magic-link", {
2135
- method: "POST";
2136
- requireHeaders: true;
2137
- body: zod0.ZodObject<{
2138
- email: zod0.ZodEmail;
2139
- name: zod0.ZodOptional<zod0.ZodString>;
2140
- callbackURL: zod0.ZodOptional<zod0.ZodString>;
2141
- newUserCallbackURL: zod0.ZodOptional<zod0.ZodString>;
2142
- errorCallbackURL: zod0.ZodOptional<zod0.ZodString>;
2143
- }, better_auth220.$strip>;
2144
- metadata: {
2145
- openapi: {
2146
- operationId: string;
2147
- description: string;
2148
- responses: {
2149
- 200: {
2150
- description: string;
2151
- content: {
2152
- "application/json": {
2153
- schema: {
2154
- type: "object";
2155
- properties: {
2156
- status: {
2157
- type: string;
2158
- };
2159
- };
2160
- };
2161
- };
2162
- };
2163
- };
2164
- };
2165
- };
2166
- };
2167
- } & {
2168
- use: any[];
2169
- }, {
2170
- status: boolean;
2171
- }>;
2172
- magicLinkVerify: better_call0.StrictEndpoint<"/magic-link/verify", {
2173
- method: "GET";
2174
- query: zod0.ZodObject<{
2175
- token: zod0.ZodString;
2176
- callbackURL: zod0.ZodOptional<zod0.ZodString>;
2177
- errorCallbackURL: zod0.ZodOptional<zod0.ZodString>;
2178
- newUserCallbackURL: zod0.ZodOptional<zod0.ZodString>;
2179
- }, better_auth220.$strip>;
2180
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<void>)[];
2181
- requireHeaders: true;
2182
- metadata: {
2183
- openapi: {
2184
- operationId: string;
2185
- description: string;
2186
- responses: {
2187
- 200: {
2188
- description: string;
2189
- content: {
2190
- "application/json": {
2191
- schema: {
2192
- type: "object";
2193
- properties: {
2194
- session: {
2195
- $ref: string;
2196
- };
2197
- user: {
2198
- $ref: string;
2199
- };
2200
- };
2201
- };
2202
- };
2203
- };
2204
- };
2205
- };
2206
- };
2207
- };
2208
- } & {
2209
- use: any[];
2210
- }, {
2211
- token: string;
2212
- user: {
2213
- id: string;
2214
- email: string;
2215
- emailVerified: boolean;
2216
- name: string;
2217
- image: string | null | undefined;
2218
- createdAt: Date;
2219
- updatedAt: Date;
2220
- };
2221
- }>;
2222
- };
2223
- rateLimit: {
2224
- pathMatcher(path: string): boolean;
2225
- window: number;
2226
- max: number;
2227
- }[];
2228
- };
2229
1776
  })[];
2230
1777
  type SupportedBetterAuthClientPlugins = typeof supportedBetterAuthClientPlugins;
2231
1778
  declare abstract class NeonAuthAdapterCore {
@@ -2240,8 +1787,15 @@ declare abstract class NeonAuthAdapterCore {
2240
1787
  * See CLAUDE.md for architecture details and API mappings.
2241
1788
  */
2242
1789
  constructor(betterAuthClientOptions: NeonAuthAdapterCoreAuthOptions);
2243
- abstract getBetterAuthInstance?(): AuthClient<BetterAuthClientOptions> | ReturnType<typeof createAuthClient>;
2244
- abstract getJWTToken(): Promise<string | null>;
1790
+ abstract getBetterAuthInstance(): BetterAuthInstance;
1791
+ /**
1792
+ * Get JWT token for authenticated or anonymous access.
1793
+ * Single source of truth for token retrieval logic.
1794
+ *
1795
+ * @param allowAnonymous - When true, fetches anonymous token if no session exists
1796
+ * @returns JWT token string or null if unavailable
1797
+ */
1798
+ getJWTToken(allowAnonymous: boolean): Promise<string | null>;
2245
1799
  }
2246
1800
  //#endregion
2247
- export { NeonAuthAdapterCoreAuthOptions as n, SupportedBetterAuthClientPlugins as r, NeonAuthAdapterCore as t };
1801
+ export { TeamInput as C, BetterAuthErrorResponse as D, UserWithRole as E, BetterAuthSession as O, Team as S, TeamMemberInput 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 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, TeamMember as w, SessionWithImpersonatedBy as x, OrganizationInput as y };