@neondatabase/auth 0.2.0-beta.1 → 0.4.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 (44) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +22 -7
  3. package/codemods/migrate-auth-ui-imports.mjs +439 -0
  4. package/dist/{adapter-core-CnrOXh1T.d.mts → adapter-core-BWM7cWOp.d.mts} +465 -401
  5. package/dist/{adapter-core-CtmnMMJ7.mjs → adapter-core-Bt4M5I2g.mjs} +21 -11
  6. package/dist/auth-interface-Clz-oWq1.d.mts +8 -0
  7. package/dist/better-auth-helpers-Bkezghej.mjs +541 -0
  8. package/dist/{better-auth-react-adapter-DNi5PC5D.d.mts → better-auth-react-adapter-BDxJ65mF.d.mts} +389 -302
  9. package/dist/{better-auth-react-adapter-Dv-o6A6O.mjs → better-auth-react-adapter-aMv8WeDb.mjs} +1 -1
  10. package/dist/{index-CzsGMS7C.d.mts → index-DHryUj7e.d.mts} +0 -1
  11. package/dist/index.d.mts +94 -5
  12. package/dist/index.mjs +4 -3
  13. package/dist/{neon-auth-Cs2cWh1B.mjs → neon-auth-CS4FpK2X.mjs} +1 -1
  14. package/dist/next/index.d.mts +161 -73
  15. package/dist/next/index.mjs +5 -4
  16. package/dist/next/server/index.d.mts +25 -5
  17. package/dist/next/server/index.mjs +369 -251
  18. package/dist/react/adapters/index.d.mts +3 -3
  19. package/dist/react/adapters/index.mjs +2 -2
  20. package/dist/react/index.d.mts +6 -5
  21. package/dist/react/index.mjs +5 -5
  22. package/dist/react/ui/index.d.mts +1 -2
  23. package/dist/react/ui/index.mjs +2 -4
  24. package/dist/react/ui/server.mjs +2 -2
  25. package/dist/{supabase-adapter-DUqw2fw8.d.mts → supabase-adapter-BGwV0Vu2.d.mts} +429 -373
  26. package/dist/{supabase-adapter-BlcGPyOf.mjs → supabase-adapter-DBt4LJJd.mjs} +3 -514
  27. package/dist/types/index.d.mts +2 -2
  28. package/dist/ui/.safelist.html +1 -1
  29. package/dist/ui/css.css +2 -2
  30. package/dist/ui/theme.css +1 -1
  31. package/dist/ui-CnVnqGns.mjs +3 -0
  32. package/dist/vanilla/adapters/index.d.mts +4 -3
  33. package/dist/vanilla/adapters/index.mjs +2 -2
  34. package/dist/vanilla/index.d.mts +4 -3
  35. package/dist/vanilla/index.mjs +2 -2
  36. package/llms.txt +2 -2
  37. package/package.json +27 -21
  38. package/dist/chunk-VCZJYX65-CLnrj1o7-D6ZQkcc_.mjs +0 -543
  39. package/dist/constants-Cupc_bln.mjs +0 -28
  40. package/dist/neon-auth-BEGCfAe6.d.mts +0 -107
  41. package/dist/ui-COLWzDsu.mjs +0 -12469
  42. /package/dist/{adapters-B7YKkjaL.mjs → adapters-CUvhsAvY.mjs} +0 -0
  43. /package/dist/{index-CPnFzULh.d.mts → index-B0Pd4HOH.d.mts} +0 -0
  44. /package/dist/{index-OEBbnNdr.d.mts → index-CzpoWrv9.d.mts} +0 -0
@@ -1,4 +1,4 @@
1
- import { t as NeonAuthAdapterCore } from "./adapter-core-CtmnMMJ7.mjs";
1
+ import { t as NeonAuthAdapterCore } from "./adapter-core-Bt4M5I2g.mjs";
2
2
  import { createAuthClient } from "better-auth/react";
3
3
 
4
4
  //#region src/adapters/better-auth-react/better-auth-react-adapter.ts
@@ -1,3 +1,2 @@
1
- 'use client';
2
1
  import { AcceptInvitationCard, AcceptInvitationCardProps, AccountSettingsCards, AccountView, AccountViewPath, AccountViewPaths, AccountViewProps, AccountsCard, AccountsCardProps, ApiKeysCardProps, AppleIcon, AuthCallback, AuthForm, AuthFormClassNames, AuthFormProps, AuthHooks, AuthLoading, AuthLocalization, AuthMutators, AuthUIContext, AuthUIContextType, AuthUIProvider, AuthUIProviderProps, AuthView, AuthViewClassNames, AuthViewPath, AuthViewPaths, AuthViewProps, ChangeEmailCard, ChangePasswordCard, ChangePasswordCardProps, CreateOrganizationDialog, CreateOrganizationDialogProps, CreateTeamDialog, CreateTeamDialogProps, DeleteAccountCard, DeleteAccountCardProps, DeleteOrganizationCard, DiscordIcon, DropboxIcon, FacebookIcon, ForgotPasswordForm, ForgotPasswordFormProps, GitHubIcon, GitLabIcon, GoogleIcon, HuggingFaceIcon, InputFieldSkeleton, KickIcon, LinearIcon, LinkedInIcon, MagicLinkForm, MagicLinkFormProps, MicrosoftIcon, NeonAuthUIProvider, NeonAuthUIProviderProps, NotionIcon, OrganizationCellView, OrganizationInvitationsCard, OrganizationLogo, OrganizationLogoCard, OrganizationLogoCardProps, OrganizationLogoClassNames, OrganizationLogoProps, OrganizationMembersCard, OrganizationNameCard, OrganizationNameCardProps, OrganizationSettingsCards, OrganizationSettingsCardsProps, OrganizationSlugCard, OrganizationSlugCardProps, OrganizationSwitcher, OrganizationSwitcherClassNames, OrganizationSwitcherProps, OrganizationView, OrganizationViewClassNames, OrganizationViewPageProps, OrganizationViewPath, OrganizationViewPaths, OrganizationViewProps, OrganizationsCard, PasskeysCard, PasskeysCardProps, PasswordInput, Provider, ProvidersCard, ProvidersCardProps, RecoverAccountForm, RecoverAccountFormProps, RedditIcon, RedirectToSignIn, RedirectToSignUp, ResetPasswordForm, ResetPasswordFormProps, RobloxIcon, SecuritySettingsCards, SessionsCard, SessionsCardProps, SettingsCard, SettingsCardClassNames, SettingsCardProps, SettingsCellSkeleton, SignInForm, SignInFormProps, SignOut, SignUpForm, SignUpFormProps, SignedIn, SignedOut, SlackIcon, SpotifyIcon, Team, TeamCell, TeamCellProps, TeamOptions, TeamOptionsContext, TeamsCard, TikTokIcon, TwitchIcon, TwoFactorCard, TwoFactorCardProps, TwoFactorForm, TwoFactorFormProps, UpdateAvatarCard, UpdateAvatarCardProps, UpdateFieldCard, UpdateFieldCardProps, UpdateNameCard, UpdateUsernameCard, UserAvatar, UserAvatarClassNames, UserAvatarProps, UserButton, UserButtonClassNames, UserButtonProps, UserInvitationsCard, UserView, UserViewClassNames, UserViewProps, VKIcon, XIcon, ZoomIcon, accountViewPaths, authLocalization, authViewPaths, getViewByPath, organizationViewPaths, socialProviders, useAuthData, useAuthenticate, useCurrentOrganization, useTheme } from "@neondatabase/auth-ui";
3
2
  export { MagicLinkFormProps as $, SignUpFormProps as $t, ChangePasswordCard as A, UserViewClassNames as An, PasswordInput as At, DropboxIcon as B, socialProviders as Bn, ResetPasswordFormProps as Bt, AuthUIProviderProps as C, UserAvatarClassNames as Cn, OrganizationViewPageProps as Ct, AuthViewPaths as D, UserButtonProps as Dn, OrganizationsCard as Dt, AuthViewPath as E, UserButtonClassNames as En, OrganizationViewProps as Et, CreateTeamDialogProps as F, accountViewPaths as Fn, RecoverAccountFormProps as Ft, GitLabIcon as G, SettingsCard as Gt, ForgotPasswordForm as H, useAuthenticate as Hn, SecuritySettingsCards as Ht, DeleteAccountCard as I, authLocalization as In, RedditIcon as It, InputFieldSkeleton as J, SettingsCellSkeleton as Jt, GoogleIcon as K, SettingsCardClassNames as Kt, DeleteAccountCardProps as L, authViewPaths as Ln, RedirectToSignIn as Lt, CreateOrganizationDialog as M, VKIcon as Mn, ProvidersCard as Mt, CreateOrganizationDialogProps as N, XIcon as Nn, ProvidersCardProps as Nt, AuthViewProps as O, UserInvitationsCard as On, PasskeysCard as Ot, CreateTeamDialog as P, ZoomIcon as Pn, RecoverAccountForm as Pt, MagicLinkForm as Q, SignUpForm as Qt, DeleteOrganizationCard as R, getViewByPath as Rn, RedirectToSignUp as Rt, AuthUIProvider as S, UserAvatar as Sn, OrganizationViewClassNames as St, AuthViewClassNames as T, UserButton as Tn, OrganizationViewPaths as Tt, ForgotPasswordFormProps as U, useCurrentOrganization as Un, SessionsCard as Ut, FacebookIcon as V, useAuthData as Vn, RobloxIcon as Vt, GitHubIcon as W, useTheme as Wn, SessionsCardProps as Wt, LinearIcon as X, SignInFormProps as Xt, KickIcon as Y, SignInForm as Yt, LinkedInIcon as Z, SignOut as Zt, AuthLoading as _, UpdateAvatarCardProps as _n, OrganizationSlugCardProps as _t, AccountViewPath as a, TeamCell as an, OrganizationInvitationsCard as at, AuthUIContext as b, UpdateNameCard as bn, OrganizationSwitcherProps as bt, AccountsCard as c, TeamOptionsContext as cn, OrganizationLogoCardProps as ct, AppleIcon as d, TwitchIcon as dn, OrganizationMembersCard as dt, SignedIn as en, MicrosoftIcon as et, AuthCallback as f, TwoFactorCard as fn, OrganizationNameCard as ft, AuthHooks as g, UpdateAvatarCard as gn, OrganizationSlugCard as gt, AuthFormProps as h, TwoFactorFormProps as hn, OrganizationSettingsCardsProps as ht, AccountView as i, Team as in, OrganizationCellView as it, ChangePasswordCardProps as j, UserViewProps as jn, Provider as jt, ChangeEmailCard as k, UserView as kn, PasskeysCardProps as kt, AccountsCardProps as l, TeamsCard as ln, OrganizationLogoClassNames as lt, AuthFormClassNames as m, TwoFactorForm as mn, OrganizationSettingsCards as mt, AcceptInvitationCardProps as n, SlackIcon as nn, NeonAuthUIProviderProps as nt, AccountViewPaths as o, TeamCellProps as on, OrganizationLogo as ot, AuthForm as p, TwoFactorCardProps as pn, OrganizationNameCardProps as pt, HuggingFaceIcon as q, SettingsCardProps as qt, AccountSettingsCards as r, SpotifyIcon as rn, NotionIcon as rt, AccountViewProps as s, TeamOptions as sn, OrganizationLogoCard as st, AcceptInvitationCard as t, SignedOut as tn, NeonAuthUIProvider as tt, ApiKeysCardProps as u, TikTokIcon as un, OrganizationLogoProps as ut, AuthLocalization as v, UpdateFieldCard as vn, OrganizationSwitcher as vt, AuthView as w, UserAvatarProps as wn, OrganizationViewPath as wt, AuthUIContextType as x, UpdateUsernameCard as xn, OrganizationView as xt, AuthMutators as y, UpdateFieldCardProps as yn, OrganizationSwitcherClassNames as yt, DiscordIcon as z, organizationViewPaths as zn, ResetPasswordForm as zt };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,94 @@
1
- import "./adapter-core-CnrOXh1T.mjs";
2
- import "./better-auth-react-adapter-DNi5PC5D.mjs";
3
- import "./supabase-adapter-DUqw2fw8.mjs";
4
- import { a as ReactBetterAuthClient, c as createInternalNeonAuth, i as NeonAuthPublicApi, n as NeonAuthAdapter, o as VanillaBetterAuthClient, r as NeonAuthConfig, s as createAuthClient, t as NeonAuth } from "./neon-auth-BEGCfAe6.mjs";
5
- export { type NeonAuth, type NeonAuthAdapter, type NeonAuthConfig, type NeonAuthPublicApi, type ReactBetterAuthClient, type VanillaBetterAuthClient, createAuthClient, createInternalNeonAuth };
1
+ import { S as ReactBetterAuthClient, k as VanillaBetterAuthClient } from "./adapter-core-BWM7cWOp.mjs";
2
+ import { n as BetterAuthReactAdapterInstance } from "./better-auth-react-adapter-BDxJ65mF.mjs";
3
+ import { r as SupabaseAuthAdapterInstance, s as BetterAuthVanillaAdapterInstance } from "./supabase-adapter-BGwV0Vu2.mjs";
4
+ import { a as isAuthError, i as isAuthApiError, n as AuthError, t as AuthApiError } from "./auth-interface-Clz-oWq1.mjs";
5
+
6
+ //#region src/neon-auth.d.ts
7
+
8
+ /**
9
+ * Union type of all supported auth adapter instances
10
+ */
11
+ type NeonAuthAdapter = BetterAuthVanillaAdapterInstance | BetterAuthReactAdapterInstance | SupabaseAuthAdapterInstance;
12
+ /**
13
+ * Configuration for createAuthClient
14
+ */
15
+ interface NeonAuthConfig<T extends NeonAuthAdapter> {
16
+ /** The adapter builder to use. Defaults to BetterAuthVanillaAdapter() if not specified. */
17
+ adapter?: (url: string, fetchOptions?: {
18
+ headers?: Record<string, string>;
19
+ }) => T;
20
+ /**
21
+ * When true, automatically uses an anonymous token when no user session exists.
22
+ * This enables RLS-based data access for users with the anonymous role.
23
+ * @default false
24
+ */
25
+ allowAnonymous?: boolean;
26
+ }
27
+ /**
28
+ * Resolves the public API type for an adapter.
29
+ * - SupabaseAuthAdapter: exposes its own methods directly (Supabase-compatible API)
30
+ * - BetterAuth adapters: expose the Better Auth client directly
31
+ */
32
+ type NeonAuthPublicApi<T extends NeonAuthAdapter> = T extends BetterAuthVanillaAdapterInstance ? VanillaBetterAuthClient : T extends BetterAuthReactAdapterInstance ? ReactBetterAuthClient : T;
33
+ /**
34
+ * NeonAuth type - combines base functionality with the appropriate public API
35
+ * This is the return type of createAuthClient()
36
+ *
37
+ * For SupabaseAuthAdapter: exposes Supabase-compatible methods (signInWithPassword, getSession, etc.)
38
+ * For BetterAuth adapters: exposes the Better Auth client directly (signIn.email, signUp.email, etc.)
39
+ */
40
+ type NeonAuth<T extends NeonAuthAdapter> = {
41
+ adapter: NeonAuthPublicApi<T>;
42
+ getJWTToken: () => Promise<string | null>;
43
+ };
44
+ /**
45
+ * Create a NeonAuth instance that exposes the appropriate API based on the adapter.
46
+ *
47
+ * @param url - The auth service URL (e.g., 'https://auth.example.com')
48
+ * @param config - Configuration with adapter builder
49
+ * @returns NeonAuth instance with the adapter's API exposed directly
50
+ *
51
+ * @example SupabaseAuthAdapter - Supabase-compatible API
52
+ * ```typescript
53
+ * import { createAuthClient, SupabaseAuthAdapter } from '@neondatabase/auth';
54
+ *
55
+ * const auth = createAuthClient('https://auth.example.com', {
56
+ * adapter: SupabaseAuthAdapter(),
57
+ * });
58
+ *
59
+ * // Supabase-compatible methods
60
+ * await auth.signInWithPassword({ email, password });
61
+ * await auth.getSession();
62
+ * ```
63
+ *
64
+ * @example BetterAuthVanillaAdapter - Direct Better Auth API
65
+ * ```typescript
66
+ * import { createAuthClient, BetterAuthVanillaAdapter } from '@neondatabase/auth';
67
+ *
68
+ * const auth = createAuthClient('https://auth.example.com', {
69
+ * adapter: BetterAuthVanillaAdapter(),
70
+ * });
71
+ *
72
+ * // Direct Better Auth API access
73
+ * await auth.signIn.email({ email, password });
74
+ * await auth.signUp.email({ email, password, name: 'John' });
75
+ * await auth.getSession();
76
+ * ```
77
+ *
78
+ * @example BetterAuthReactAdapter - Better Auth with React hooks
79
+ * ```typescript
80
+ * import { createAuthClient, BetterAuthReactAdapter } from '@neondatabase/auth';
81
+ *
82
+ * const auth = createAuthClient('https://auth.example.com', {
83
+ * adapter: BetterAuthReactAdapter(),
84
+ * });
85
+ *
86
+ * // Direct Better Auth API with React hooks
87
+ * await auth.signIn.email({ email, password });
88
+ * const session = auth.useSession(); // React hook
89
+ * ```
90
+ */
91
+ declare function createInternalNeonAuth<T extends NeonAuthAdapter = BetterAuthVanillaAdapterInstance>(url: string, config?: NeonAuthConfigInternal<T>): NeonAuth<T>;
92
+ declare function createAuthClient<T extends NeonAuthAdapter = BetterAuthVanillaAdapterInstance>(url: string, config?: NeonAuthConfig<T>): NeonAuthPublicApi<T>;
93
+ //#endregion
94
+ export { AuthApiError, AuthError, type NeonAuth, type NeonAuthAdapter, type NeonAuthConfig, type NeonAuthPublicApi, type ReactBetterAuthClient, type VanillaBetterAuthClient, createAuthClient, createInternalNeonAuth, isAuthApiError, isAuthError };
package/dist/index.mjs CHANGED
@@ -1,4 +1,5 @@
1
- import "./adapter-core-CtmnMMJ7.mjs";
2
- import { n as createInternalNeonAuth, t as createAuthClient } from "./neon-auth-Cs2cWh1B.mjs";
1
+ import "./adapter-core-Bt4M5I2g.mjs";
2
+ import { c as isAuthApiError, l as isAuthError, o as AuthApiError, s as AuthError } from "./better-auth-helpers-Bkezghej.mjs";
3
+ import { n as createInternalNeonAuth, t as createAuthClient } from "./neon-auth-CS4FpK2X.mjs";
3
4
 
4
- export { createAuthClient, createInternalNeonAuth };
5
+ export { AuthApiError, AuthError, createAuthClient, createInternalNeonAuth, isAuthApiError, isAuthError };
@@ -1,4 +1,4 @@
1
- import { n as BetterAuthVanillaAdapter } from "./supabase-adapter-BlcGPyOf.mjs";
1
+ import { n as BetterAuthVanillaAdapter } from "./supabase-adapter-DBt4LJJd.mjs";
2
2
 
3
3
  //#region src/neon-auth.ts
4
4
  /**
@@ -1,9 +1,9 @@
1
- import * as better_auth_client0 from "better-auth/client";
1
+ import { a as isAuthError, i as isAuthApiError, n as AuthError, t as AuthApiError } from "../auth-interface-Clz-oWq1.mjs";
2
+ import * as better_auth_react0 from "better-auth/react";
2
3
  import * as jose0 from "jose";
4
+ import * as better_auth_plugins0 from "better-auth/plugins";
3
5
  import * as better_auth0 from "better-auth";
4
6
  import * as _better_fetch_fetch0 from "@better-fetch/fetch";
5
- import * as better_auth_plugins0 from "better-auth/plugins";
6
- import * as nanostores0 from "nanostores";
7
7
 
8
8
  //#region src/next/index.d.ts
9
9
  declare function createAuthClient(): {
@@ -34,7 +34,7 @@ declare function createAuthClient(): {
34
34
  organizationId: string;
35
35
  email: string;
36
36
  role: "admin" | "member" | "owner";
37
- status: better_auth_client0.InvitationStatus;
37
+ status: better_auth_plugins0.InvitationStatus;
38
38
  inviterId: string;
39
39
  expiresAt: Date;
40
40
  createdAt: Date;
@@ -125,15 +125,7 @@ declare function createAuthClient(): {
125
125
  id: string;
126
126
  };
127
127
  fetchOptions?: FetchOptions | undefined;
128
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
129
- id: string;
130
- createdAt: Date;
131
- updatedAt: Date;
132
- email: string;
133
- emailVerified: boolean;
134
- name: string;
135
- image?: string | null | undefined;
136
- }, {
128
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<better_auth_plugins0.UserWithRole, {
137
129
  code?: string | undefined;
138
130
  message?: string | undefined;
139
131
  }, FetchOptions["throw"] extends true ? true : false>>;
@@ -142,13 +134,13 @@ declare function createAuthClient(): {
142
134
  admin: {
143
135
  createUser: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
144
136
  email: string;
145
- password: string;
137
+ password?: string | undefined;
146
138
  name: string;
147
139
  role?: "user" | "admin" | ("user" | "admin")[] | undefined;
148
140
  data?: Record<string, any> | undefined;
149
141
  }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
150
142
  email: string;
151
- password: string;
143
+ password?: string | undefined;
152
144
  name: string;
153
145
  role?: "user" | "admin" | ("user" | "admin")[] | undefined;
154
146
  data?: Record<string, any> | undefined;
@@ -240,15 +232,7 @@ declare function createAuthClient(): {
240
232
  } & {
241
233
  fetchOptions?: FetchOptions | undefined;
242
234
  }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
243
- user: {
244
- id: string;
245
- createdAt: Date;
246
- updatedAt: Date;
247
- email: string;
248
- emailVerified: boolean;
249
- name: string;
250
- image?: string | null | undefined;
251
- } & Record<string, any>;
235
+ user: better_auth_plugins0.UserWithRole;
252
236
  }, {
253
237
  code?: string | undefined;
254
238
  message?: string | undefined;
@@ -267,15 +251,7 @@ declare function createAuthClient(): {
267
251
  } & {
268
252
  fetchOptions?: FetchOptions | undefined;
269
253
  }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
270
- user: {
271
- id: string;
272
- createdAt: Date;
273
- updatedAt: Date;
274
- email: string;
275
- emailVerified: boolean;
276
- name: string;
277
- image?: string | null | undefined;
278
- } & Record<string, any>;
254
+ user: better_auth_plugins0.UserWithRole;
279
255
  }, {
280
256
  code?: string | undefined;
281
257
  message?: string | undefined;
@@ -312,8 +288,25 @@ declare function createAuthClient(): {
312
288
  query?: Record<string, any> | undefined;
313
289
  fetchOptions?: FetchOptions | undefined;
314
290
  }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
315
- session: better_auth0.Session & Record<string, any>;
316
- user: better_auth0.User & Record<string, any>;
291
+ session: {
292
+ id: string;
293
+ createdAt: Date;
294
+ updatedAt: Date;
295
+ userId: string;
296
+ expiresAt: Date;
297
+ token: string;
298
+ ipAddress?: string | null | undefined;
299
+ userAgent?: string | null | undefined;
300
+ } & Record<string, any>;
301
+ user: {
302
+ id: string;
303
+ createdAt: Date;
304
+ updatedAt: Date;
305
+ email: string;
306
+ emailVerified: boolean;
307
+ name: string;
308
+ image?: string | null | undefined;
309
+ } & Record<string, any>;
317
310
  }, {
318
311
  code?: string | undefined;
319
312
  message?: string | undefined;
@@ -489,8 +482,6 @@ declare function createAuthClient(): {
489
482
  createdAt: Date;
490
483
  logo?: string | null | undefined | undefined;
491
484
  metadata?: any;
492
- } & {
493
- metadata: Record<string, any> | undefined;
494
485
  }, {
495
486
  code?: string | undefined;
496
487
  message?: string | undefined;
@@ -545,7 +536,7 @@ declare function createAuthClient(): {
545
536
  organizationId: string;
546
537
  email: string;
547
538
  role: "admin" | "member" | "owner";
548
- status: better_auth_client0.InvitationStatus;
539
+ status: better_auth_plugins0.InvitationStatus;
549
540
  inviterId: string;
550
541
  expiresAt: Date;
551
542
  createdAt: Date;
@@ -594,7 +585,7 @@ declare function createAuthClient(): {
594
585
  organizationId: string;
595
586
  email: string;
596
587
  role: "admin" | "member" | "owner";
597
- status: better_auth_client0.InvitationStatus;
588
+ status: better_auth_plugins0.InvitationStatus;
598
589
  inviterId: string;
599
590
  expiresAt: Date;
600
591
  createdAt: Date;
@@ -642,16 +633,25 @@ declare function createAuthClient(): {
642
633
  resend?: boolean | undefined;
643
634
  } & {
644
635
  fetchOptions?: FetchOptions | undefined;
645
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
636
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<NonNullable<{
646
637
  id: string;
647
638
  organizationId: string;
648
639
  email: string;
649
640
  role: "admin" | "member" | "owner";
650
- status: better_auth_client0.InvitationStatus;
641
+ status: better_auth_plugins0.InvitationStatus;
651
642
  inviterId: string;
652
643
  expiresAt: Date;
653
644
  createdAt: Date;
654
- }, {
645
+ } | {
646
+ id: string;
647
+ organizationId: string;
648
+ email: string;
649
+ role: "admin" | "member" | "owner";
650
+ status: better_auth_plugins0.InvitationStatus;
651
+ inviterId: string;
652
+ expiresAt: Date;
653
+ createdAt: Date;
654
+ }>, {
655
655
  code?: string | undefined;
656
656
  message?: string | undefined;
657
657
  }, FetchOptions["throw"] extends true ? true : false>>;
@@ -669,7 +669,7 @@ declare function createAuthClient(): {
669
669
  organizationId: string;
670
670
  email: string;
671
671
  role: "admin" | "member" | "owner";
672
- status: better_auth_client0.InvitationStatus;
672
+ status: better_auth_plugins0.InvitationStatus;
673
673
  inviterId: string;
674
674
  expiresAt: Date;
675
675
  createdAt: Date;
@@ -692,7 +692,7 @@ declare function createAuthClient(): {
692
692
  organizationId: string;
693
693
  email: string;
694
694
  role: "admin" | "member" | "owner";
695
- status: better_auth_client0.InvitationStatus;
695
+ status: better_auth_plugins0.InvitationStatus;
696
696
  inviterId: string;
697
697
  expiresAt: Date;
698
698
  createdAt: Date;
@@ -723,7 +723,7 @@ declare function createAuthClient(): {
723
723
  organizationId: string;
724
724
  email: string;
725
725
  role: "admin" | "member" | "owner";
726
- status: better_auth_client0.InvitationStatus;
726
+ status: better_auth_plugins0.InvitationStatus;
727
727
  inviterId: string;
728
728
  expiresAt: Date;
729
729
  createdAt: Date;
@@ -750,7 +750,7 @@ declare function createAuthClient(): {
750
750
  organizationId: string;
751
751
  email: string;
752
752
  role: "member" | "admin" | "owner";
753
- status: better_auth_client0.InvitationStatus;
753
+ status: better_auth_plugins0.InvitationStatus;
754
754
  inviterId: string;
755
755
  expiresAt: Date;
756
756
  createdAt: Date;
@@ -775,7 +775,7 @@ declare function createAuthClient(): {
775
775
  organizationId: string;
776
776
  email: string;
777
777
  role: "admin" | "member" | "owner";
778
- status: better_auth_client0.InvitationStatus;
778
+ status: better_auth_plugins0.InvitationStatus;
779
779
  inviterId: string;
780
780
  expiresAt: Date;
781
781
  createdAt: Date;
@@ -936,7 +936,7 @@ declare function createAuthClient(): {
936
936
  organizationId: string;
937
937
  email: string;
938
938
  role: "admin" | "member" | "owner";
939
- status: better_auth_client0.InvitationStatus;
939
+ status: better_auth_plugins0.InvitationStatus;
940
940
  inviterId: string;
941
941
  expiresAt: Date;
942
942
  createdAt: Date;
@@ -1131,25 +1131,25 @@ declare function createAuthClient(): {
1131
1131
  token: string;
1132
1132
  user: {
1133
1133
  id: string;
1134
+ createdAt: Date;
1135
+ updatedAt: Date;
1134
1136
  email: string;
1135
1137
  emailVerified: boolean;
1136
1138
  name: string;
1137
- image: string | null | undefined;
1138
- createdAt: Date;
1139
- updatedAt: Date;
1140
- };
1139
+ image?: string | null | undefined;
1140
+ } & Record<string, any>;
1141
1141
  } | {
1142
1142
  status: boolean;
1143
1143
  token: null;
1144
1144
  user: {
1145
1145
  id: string;
1146
+ createdAt: Date;
1147
+ updatedAt: Date;
1146
1148
  email: string;
1147
1149
  emailVerified: boolean;
1148
1150
  name: string;
1149
- image: string | null | undefined;
1150
- createdAt: Date;
1151
- updatedAt: Date;
1152
- };
1151
+ image?: string | null | undefined;
1152
+ } & Record<string, any>;
1153
1153
  }>, {
1154
1154
  code?: string | undefined;
1155
1155
  message?: string | undefined;
@@ -1169,18 +1169,33 @@ declare function createAuthClient(): {
1169
1169
  token: string;
1170
1170
  user: {
1171
1171
  id: string;
1172
+ createdAt: Date;
1173
+ updatedAt: Date;
1172
1174
  email: string;
1173
1175
  emailVerified: boolean;
1174
1176
  name: string;
1175
- image: string | null | undefined;
1176
- createdAt: Date;
1177
- updatedAt: Date;
1177
+ image?: string | null | undefined;
1178
1178
  };
1179
1179
  }, {
1180
1180
  code?: string | undefined;
1181
1181
  message?: string | undefined;
1182
1182
  }, FetchOptions["throw"] extends true ? true : false>>;
1183
1183
  };
1184
+ } & {
1185
+ emailOtp: {
1186
+ requestPasswordReset: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1187
+ email: string;
1188
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1189
+ email: string;
1190
+ } & {
1191
+ fetchOptions?: FetchOptions | undefined;
1192
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1193
+ success: boolean;
1194
+ }, {
1195
+ code?: string | undefined;
1196
+ message?: string | undefined;
1197
+ }, FetchOptions["throw"] extends true ? true : false>>;
1198
+ };
1184
1199
  } & {
1185
1200
  forgetPassword: {
1186
1201
  emailOtp: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
@@ -1215,6 +1230,60 @@ declare function createAuthClient(): {
1215
1230
  message?: string | undefined;
1216
1231
  }, FetchOptions["throw"] extends true ? true : false>>;
1217
1232
  };
1233
+ } & {
1234
+ signIn: {
1235
+ magicLink: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
1236
+ email: string;
1237
+ name?: string | undefined;
1238
+ callbackURL?: string | undefined;
1239
+ newUserCallbackURL?: string | undefined;
1240
+ errorCallbackURL?: string | undefined;
1241
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1242
+ email: string;
1243
+ name?: string | undefined;
1244
+ callbackURL?: string | undefined;
1245
+ newUserCallbackURL?: string | undefined;
1246
+ errorCallbackURL?: string | undefined;
1247
+ } & {
1248
+ fetchOptions?: FetchOptions | undefined;
1249
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1250
+ status: boolean;
1251
+ }, {
1252
+ code?: string | undefined;
1253
+ message?: string | undefined;
1254
+ }, FetchOptions["throw"] extends true ? true : false>>;
1255
+ };
1256
+ } & {
1257
+ magicLink: {
1258
+ verify: <FetchOptions extends better_auth0.ClientFetchOption<never, Partial<{
1259
+ token: string;
1260
+ callbackURL?: string | undefined;
1261
+ errorCallbackURL?: string | undefined;
1262
+ newUserCallbackURL?: string | undefined;
1263
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth0.Prettify<{
1264
+ query: {
1265
+ token: string;
1266
+ callbackURL?: string | undefined;
1267
+ errorCallbackURL?: string | undefined;
1268
+ newUserCallbackURL?: string | undefined;
1269
+ };
1270
+ fetchOptions?: FetchOptions | undefined;
1271
+ }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1272
+ token: string;
1273
+ user: {
1274
+ id: string;
1275
+ createdAt: Date;
1276
+ updatedAt: Date;
1277
+ email: string;
1278
+ emailVerified: boolean;
1279
+ name: string;
1280
+ image?: string | null | undefined;
1281
+ };
1282
+ }, {
1283
+ code?: string | undefined;
1284
+ message?: string | undefined;
1285
+ }, FetchOptions["throw"] extends true ? true : false>>;
1286
+ };
1218
1287
  } & {
1219
1288
  signIn: {
1220
1289
  social: <FetchOptions extends better_auth0.ClientFetchOption<Partial<{
@@ -1437,13 +1506,13 @@ declare function createAuthClient(): {
1437
1506
  token: string | null;
1438
1507
  user: {
1439
1508
  id: string;
1440
- email: string;
1441
- name: string;
1442
- image: string | null | undefined;
1443
- emailVerified: boolean;
1444
1509
  createdAt: Date;
1445
1510
  updatedAt: Date;
1446
- };
1511
+ email: string;
1512
+ emailVerified: boolean;
1513
+ name: string;
1514
+ image?: string | null | undefined;
1515
+ } & Record<string, any>;
1447
1516
  }, {
1448
1517
  code?: string | undefined;
1449
1518
  message?: string | undefined;
@@ -1607,13 +1676,13 @@ declare function createAuthClient(): {
1607
1676
  query?: Record<string, any> | undefined;
1608
1677
  fetchOptions?: FetchOptions | undefined;
1609
1678
  }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch0.BetterFetchResponse<{
1679
+ scopes: string[];
1610
1680
  id: string;
1611
- providerId: string;
1612
1681
  createdAt: Date;
1613
1682
  updatedAt: Date;
1614
- accountId: string;
1615
1683
  userId: string;
1616
- scopes: string[];
1684
+ providerId: string;
1685
+ accountId: string;
1617
1686
  }[], {
1618
1687
  code?: string | undefined;
1619
1688
  message?: string | undefined;
@@ -1817,7 +1886,7 @@ declare function createAuthClient(): {
1817
1886
  organizationId: string;
1818
1887
  email: string;
1819
1888
  role: "admin" | "member" | "owner";
1820
- status: better_auth_client0.InvitationStatus;
1889
+ status: better_auth_plugins0.InvitationStatus;
1821
1890
  inviterId: string;
1822
1891
  expiresAt: Date;
1823
1892
  createdAt: Date;
@@ -1843,7 +1912,7 @@ declare function createAuthClient(): {
1843
1912
  organizationId: string;
1844
1913
  email: string;
1845
1914
  role: "admin" | "member" | "owner";
1846
- status: better_auth_client0.InvitationStatus;
1915
+ status: better_auth_plugins0.InvitationStatus;
1847
1916
  inviterId: string;
1848
1917
  expiresAt: Date;
1849
1918
  createdAt: Date;
@@ -1958,7 +2027,7 @@ declare function createAuthClient(): {
1958
2027
  };
1959
2028
  };
1960
2029
  $fetch: _better_fetch_fetch0.BetterFetch<{
1961
- plugins: (_better_fetch_fetch0.BetterFetchPlugin | {
2030
+ plugins: (_better_fetch_fetch0.BetterFetchPlugin<Record<string, any>> | {
1962
2031
  id: string;
1963
2032
  name: string;
1964
2033
  hooks: {
@@ -1976,6 +2045,7 @@ declare function createAuthClient(): {
1976
2045
  })[];
1977
2046
  cache?: RequestCache | undefined;
1978
2047
  method: string;
2048
+ window?: null | undefined;
1979
2049
  headers?: (HeadersInit & (HeadersInit | {
1980
2050
  accept: "application/json" | "text/plain" | "application/octet-stream";
1981
2051
  "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
@@ -1990,7 +2060,6 @@ declare function createAuthClient(): {
1990
2060
  referrer?: string | undefined;
1991
2061
  referrerPolicy?: ReferrerPolicy | undefined;
1992
2062
  signal?: (AbortSignal | null) | undefined;
1993
- window?: null | undefined;
1994
2063
  onRetry?: ((response: _better_fetch_fetch0.ResponseContext) => Promise<void> | void) | undefined;
1995
2064
  hookOptions?: {
1996
2065
  cloneResponse?: boolean;
@@ -2026,7 +2095,7 @@ declare function createAuthClient(): {
2026
2095
  $store: {
2027
2096
  notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
2028
2097
  listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
2029
- atoms: Record<string, nanostores0.WritableAtom<any>>;
2098
+ atoms: Record<string, better_auth_react0.WritableAtom<any>>;
2030
2099
  };
2031
2100
  $ERROR_CODES: {
2032
2101
  readonly FAILED_TO_CREATE_USER: "Failed to create user";
@@ -2049,6 +2118,7 @@ declare function createAuthClient(): {
2049
2118
  readonly YOU_CANNOT_REMOVE_YOURSELF: "You cannot remove yourself";
2050
2119
  readonly YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: "You are not allowed to set a non-existent role value";
2051
2120
  readonly YOU_CANNOT_IMPERSONATE_ADMINS: "You cannot impersonate admins";
2121
+ readonly INVALID_ROLE_TYPE: "Invalid role type";
2052
2122
  readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION: "You are not allowed to create a new organization";
2053
2123
  readonly YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS: "You have reached the maximum number of organizations";
2054
2124
  readonly ORGANIZATION_ALREADY_EXISTS: "Organization already exists";
@@ -2130,7 +2200,25 @@ declare function createAuthClient(): {
2130
2200
  readonly FAILED_TO_UNLINK_LAST_ACCOUNT: "You can't unlink your last account";
2131
2201
  readonly ACCOUNT_NOT_FOUND: "Account not found";
2132
2202
  readonly USER_ALREADY_HAS_PASSWORD: "User already has a password. Provide that to delete the account.";
2203
+ readonly CROSS_SITE_NAVIGATION_LOGIN_BLOCKED: "Cross-site navigation login blocked. This request appears to be a CSRF attack.";
2204
+ readonly VERIFICATION_EMAIL_NOT_ENABLED: "Verification email isn't enabled";
2205
+ readonly EMAIL_ALREADY_VERIFIED: "Email is already verified";
2206
+ readonly EMAIL_MISMATCH: "Email mismatch";
2207
+ readonly SESSION_NOT_FRESH: "Session is not fresh";
2208
+ readonly LINKED_ACCOUNT_ALREADY_EXISTS: "Linked account already exists";
2209
+ readonly INVALID_ORIGIN: "Invalid origin";
2210
+ readonly INVALID_CALLBACK_URL: "Invalid callbackURL";
2211
+ readonly INVALID_REDIRECT_URL: "Invalid redirectURL";
2212
+ readonly INVALID_ERROR_CALLBACK_URL: "Invalid errorCallbackURL";
2213
+ readonly INVALID_NEW_USER_CALLBACK_URL: "Invalid newUserCallbackURL";
2214
+ readonly MISSING_OR_NULL_ORIGIN: "Missing or null Origin";
2215
+ readonly CALLBACK_URL_REQUIRED: "callbackURL is required";
2216
+ readonly FAILED_TO_CREATE_VERIFICATION: "Unable to create verification";
2217
+ readonly FIELD_NOT_ALLOWED: "Field not allowed to be set";
2218
+ readonly ASYNC_VALIDATION_NOT_SUPPORTED: "Async validation is not supported";
2219
+ readonly VALIDATION_ERROR: "Validation Error";
2220
+ readonly MISSING_FIELD: "Field is required";
2133
2221
  };
2134
2222
  };
2135
2223
  //#endregion
2136
- export { createAuthClient };
2224
+ export { AuthApiError, AuthError, createAuthClient, isAuthApiError, isAuthError };
@@ -1,6 +1,7 @@
1
- import "../adapter-core-CtmnMMJ7.mjs";
2
- import { t as BetterAuthReactAdapter } from "../better-auth-react-adapter-Dv-o6A6O.mjs";
3
- import { t as createAuthClient$1 } from "../neon-auth-Cs2cWh1B.mjs";
1
+ import "../adapter-core-Bt4M5I2g.mjs";
2
+ import { c as isAuthApiError, l as isAuthError, o as AuthApiError, s as AuthError } from "../better-auth-helpers-Bkezghej.mjs";
3
+ import { t as BetterAuthReactAdapter } from "../better-auth-react-adapter-aMv8WeDb.mjs";
4
+ import { t as createAuthClient$1 } from "../neon-auth-CS4FpK2X.mjs";
4
5
 
5
6
  //#region src/next/index.ts
6
7
  function createAuthClient() {
@@ -8,4 +9,4 @@ function createAuthClient() {
8
9
  }
9
10
 
10
11
  //#endregion
11
- export { createAuthClient };
12
+ export { AuthApiError, AuthError, createAuthClient, isAuthApiError, isAuthError };