@clerk/react 5.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +71 -0
  3. package/dist/chunk-KLK6ZMZX.mjs +1011 -0
  4. package/dist/chunk-KLK6ZMZX.mjs.map +1 -0
  5. package/dist/chunk-MB46WFKC.mjs +28 -0
  6. package/dist/chunk-MB46WFKC.mjs.map +1 -0
  7. package/dist/chunk-OANWQR3B.mjs +16 -0
  8. package/dist/chunk-OANWQR3B.mjs.map +1 -0
  9. package/dist/chunk-PS5BRRRD.mjs +282 -0
  10. package/dist/chunk-PS5BRRRD.mjs.map +1 -0
  11. package/dist/chunk-Z2DSM5QN.mjs +171 -0
  12. package/dist/chunk-Z2DSM5QN.mjs.map +1 -0
  13. package/dist/errors.d.mts +1 -0
  14. package/dist/errors.d.ts +1 -0
  15. package/dist/errors.js +45 -0
  16. package/dist/errors.js.map +1 -0
  17. package/dist/errors.mjs +24 -0
  18. package/dist/errors.mjs.map +1 -0
  19. package/dist/experimental.d.mts +125 -0
  20. package/dist/experimental.d.ts +125 -0
  21. package/dist/experimental.js +1301 -0
  22. package/dist/experimental.js.map +1 -0
  23. package/dist/experimental.mjs +164 -0
  24. package/dist/experimental.mjs.map +1 -0
  25. package/dist/index.d.mts +217 -0
  26. package/dist/index.d.ts +217 -0
  27. package/dist/index.js +3304 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/index.mjs +1940 -0
  30. package/dist/index.mjs.map +1 -0
  31. package/dist/internal.d.mts +18 -0
  32. package/dist/internal.d.ts +18 -0
  33. package/dist/internal.js +260 -0
  34. package/dist/internal.js.map +1 -0
  35. package/dist/internal.mjs +58 -0
  36. package/dist/internal.mjs.map +1 -0
  37. package/dist/legacy.d.mts +95 -0
  38. package/dist/legacy.d.ts +95 -0
  39. package/dist/legacy.js +90 -0
  40. package/dist/legacy.js.map +1 -0
  41. package/dist/legacy.mjs +48 -0
  42. package/dist/legacy.mjs.map +1 -0
  43. package/dist/types-BS-xjOf_.d.mts +77 -0
  44. package/dist/types-BS-xjOf_.d.ts +77 -0
  45. package/dist/useAuth-CibrZ7p3.d.mts +182 -0
  46. package/dist/useAuth-yh0dHssU.d.ts +182 -0
  47. package/package.json +116 -0
@@ -0,0 +1,77 @@
1
+ import { Clerk, IsomorphicClerkOptions, InitialState, LoadedClerk, RedirectUrlProp } from '@clerk/shared/types';
2
+ import { ClerkUiConstructor } from '@clerk/shared/ui';
3
+ import React from 'react';
4
+
5
+ declare global {
6
+ interface Window {
7
+ __clerk_publishable_key?: string;
8
+ __clerk_proxy_url?: Clerk['proxyUrl'];
9
+ __clerk_domain?: Clerk['domain'];
10
+ __unstable_ClerkUiCtor?: ClerkUiConstructor;
11
+ }
12
+ }
13
+ /**
14
+ * @interface
15
+ */
16
+ type ClerkProviderProps = IsomorphicClerkOptions & {
17
+ children: React.ReactNode;
18
+ /**
19
+ * Provide an initial state of the Clerk client during server-side rendering. You don't need to set this value yourself unless you're [developing an SDK](https://clerk.com/docs/guides/development/sdk-development/overview).
20
+ */
21
+ initialState?: InitialState;
22
+ /**
23
+ * Indicates to silently fail the initialization process when the publishable keys is not provided, instead of throwing an error.
24
+ * @default false
25
+ * @internal
26
+ */
27
+ __internal_bypassMissingPublishableKey?: boolean;
28
+ };
29
+ type WithClerkProp<T = unknown> = T & {
30
+ clerk: LoadedClerk;
31
+ component?: string;
32
+ };
33
+ type SignInWithMetamaskButtonProps = {
34
+ mode?: 'redirect' | 'modal';
35
+ children?: React.ReactNode;
36
+ } & RedirectUrlProp;
37
+ type PageProps<T extends string> = {
38
+ label: string;
39
+ url: string;
40
+ labelIcon: React.ReactNode;
41
+ } | {
42
+ label: T;
43
+ url?: never;
44
+ labelIcon?: never;
45
+ };
46
+ type UserProfilePageProps = PageProps<'account' | 'security'>;
47
+ type UserProfileLinkProps = {
48
+ url: string;
49
+ label: string;
50
+ labelIcon: React.ReactNode;
51
+ };
52
+ type OrganizationProfilePageProps = PageProps<'general' | 'members'>;
53
+ type OrganizationProfileLinkProps = UserProfileLinkProps;
54
+ type ButtonActionProps<T extends string> = {
55
+ label: string;
56
+ labelIcon: React.ReactNode;
57
+ onClick: () => void;
58
+ open?: never;
59
+ } | {
60
+ label: T;
61
+ labelIcon?: never;
62
+ onClick?: never;
63
+ open?: never;
64
+ } | {
65
+ label: string;
66
+ labelIcon: React.ReactNode;
67
+ onClick?: never;
68
+ open: string;
69
+ };
70
+ type UserButtonActionProps = ButtonActionProps<'manageAccount' | 'signOut'>;
71
+ type UserButtonLinkProps = {
72
+ href: string;
73
+ label: string;
74
+ labelIcon: React.ReactNode;
75
+ };
76
+
77
+ export type { ClerkProviderProps as C, OrganizationProfilePageProps as O, SignInWithMetamaskButtonProps as S, UserProfilePageProps as U, WithClerkProp as W, OrganizationProfileLinkProps as a, UserProfileLinkProps as b, UserButtonActionProps as c, UserButtonLinkProps as d };
@@ -0,0 +1,182 @@
1
+ import * as _clerk_shared_types from '@clerk/shared/types';
2
+ import { HandleOAuthCallbackParams, ProtectProps as ProtectProps$1, PendingSessionOptions, UseAuthReturn } from '@clerk/shared/types';
3
+ import React from 'react';
4
+ import { W as WithClerkProp } from './types-BS-xjOf_.mjs';
5
+
6
+ declare const SignedIn: ({ children, treatPendingAsSignedOut }: React.PropsWithChildren<PendingSessionOptions>) => React.ReactNode;
7
+ declare const SignedOut: ({ children, treatPendingAsSignedOut }: React.PropsWithChildren<PendingSessionOptions>) => React.ReactNode;
8
+ declare const ClerkLoaded: ({ children }: React.PropsWithChildren<unknown>) => React.ReactNode;
9
+ declare const ClerkLoading: ({ children }: React.PropsWithChildren<unknown>) => React.ReactNode;
10
+ declare const ClerkFailed: ({ children }: React.PropsWithChildren<unknown>) => React.ReactNode;
11
+ declare const ClerkDegraded: ({ children }: React.PropsWithChildren<unknown>) => React.ReactNode;
12
+ type ProtectProps = React.PropsWithChildren<ProtectProps$1 & {
13
+ fallback?: React.ReactNode;
14
+ } & PendingSessionOptions>;
15
+ /**
16
+ * Use `<Protect/>` in order to prevent unauthenticated or unauthorized users from accessing the children passed to the component.
17
+ *
18
+ * Examples:
19
+ * ```
20
+ * <Protect permission="a_permission_key" />
21
+ * <Protect role="a_role_key" />
22
+ * <Protect condition={(has) => has({permission:"a_permission_key"})} />
23
+ * <Protect condition={(has) => has({role:"a_role_key"})} />
24
+ * <Protect fallback={<p>Unauthorized</p>} />
25
+ * ```
26
+ */
27
+ declare const Protect: ({ children, fallback, treatPendingAsSignedOut, ...restAuthorizedParams }: ProtectProps) => React.ReactNode;
28
+ declare const RedirectToSignIn: {
29
+ (props: _clerk_shared_types.Without<WithClerkProp<_clerk_shared_types.SignInRedirectOptions>, "clerk">): React.JSX.Element | null;
30
+ displayName: string;
31
+ };
32
+ declare const RedirectToSignUp: {
33
+ (props: _clerk_shared_types.Without<WithClerkProp<_clerk_shared_types.SignUpRedirectOptions>, "clerk">): React.JSX.Element | null;
34
+ displayName: string;
35
+ };
36
+ declare const RedirectToTasks: {
37
+ (props: _clerk_shared_types.Without<WithClerkProp<_clerk_shared_types.TasksRedirectOptions>, "clerk">): React.JSX.Element | null;
38
+ displayName: string;
39
+ };
40
+ /**
41
+ * @function
42
+ * @deprecated Use [`redirectToUserProfile()`](https://clerk.com/docs/reference/javascript/clerk#redirect-to-user-profile) instead.
43
+ */
44
+ declare const RedirectToUserProfile: {
45
+ (props: _clerk_shared_types.Without<{
46
+ clerk: _clerk_shared_types.LoadedClerk;
47
+ component?: string;
48
+ }, "clerk">): React.JSX.Element | null;
49
+ displayName: string;
50
+ };
51
+ /**
52
+ * @function
53
+ * @deprecated Use [`redirectToOrganizationProfile()`](https://clerk.com/docs/reference/javascript/clerk#redirect-to-organization-profile) instead.
54
+ */
55
+ declare const RedirectToOrganizationProfile: {
56
+ (props: _clerk_shared_types.Without<{
57
+ clerk: _clerk_shared_types.LoadedClerk;
58
+ component?: string;
59
+ }, "clerk">): React.JSX.Element | null;
60
+ displayName: string;
61
+ };
62
+ /**
63
+ * @function
64
+ * @deprecated Use [`redirectToCreateOrganization()`](https://clerk.com/docs/reference/javascript/clerk#redirect-to-create-organization) instead.
65
+ */
66
+ declare const RedirectToCreateOrganization: {
67
+ (props: _clerk_shared_types.Without<{
68
+ clerk: _clerk_shared_types.LoadedClerk;
69
+ component?: string;
70
+ }, "clerk">): React.JSX.Element | null;
71
+ displayName: string;
72
+ };
73
+ declare const AuthenticateWithRedirectCallback: {
74
+ (props: _clerk_shared_types.Without<WithClerkProp<HandleOAuthCallbackParams>, "clerk">): React.JSX.Element | null;
75
+ displayName: string;
76
+ };
77
+ declare const MultisessionAppSupport: ({ children }: React.PropsWithChildren<unknown>) => React.JSX.Element;
78
+
79
+ /**
80
+ * @inline
81
+ */
82
+ type UseAuthOptions = Record<string, any> | PendingSessionOptions | undefined | null;
83
+ /**
84
+ * The `useAuth()` hook provides access to the current user's authentication state and methods to manage the active session.
85
+ *
86
+ * > [!NOTE]
87
+ * > To access auth data server-side, see the [`Auth` object reference doc](https://clerk.com/docs/reference/backend/types/auth-object).
88
+ *
89
+ * <If sdk="nextjs">
90
+ * By default, Next.js opts all routes into static rendering. If you need to opt a route or routes into dynamic rendering because you need to access the authentication data at request time, you can create a boundary by passing the `dynamic` prop to `<ClerkProvider>`. See the [guide on rendering modes](https://clerk.com/docs/guides/development/rendering-modes) for more information, including code examples.
91
+ * </If>
92
+ *
93
+ * @unionReturnHeadings
94
+ * ["Initialization", "Signed out", "Signed in (no active organization)", "Signed in (with active organization)"]
95
+ *
96
+ * @param [initialAuthStateOrOptions] - An object containing the initial authentication state or options for the `useAuth()` hook. If not provided, the hook will attempt to derive the state from the context. `treatPendingAsSignedOut` is a boolean that indicates whether pending sessions are considered as signed out or not. Defaults to `true`.
97
+ *
98
+ * @function
99
+ *
100
+ * @example
101
+ *
102
+ * The following example demonstrates how to use the `useAuth()` hook to access the current auth state, like whether the user is signed in or not. It also includes a basic example for using the `getToken()` method to retrieve a session token for fetching data from an external resource.
103
+ *
104
+ * <Tabs items='React,Next.js'>
105
+ * <Tab>
106
+ *
107
+ * ```tsx {{ filename: 'src/pages/ExternalDataPage.tsx' }}
108
+ * import { useAuth } from '@clerk/react'
109
+ *
110
+ * export default function ExternalDataPage() {
111
+ * const { userId, sessionId, getToken, isLoaded, isSignedIn } = useAuth()
112
+ *
113
+ * const fetchExternalData = async () => {
114
+ * const token = await getToken()
115
+ *
116
+ * // Fetch data from an external API
117
+ * const response = await fetch('https://api.example.com/data', {
118
+ * headers: {
119
+ * Authorization: `Bearer ${token}`,
120
+ * },
121
+ * })
122
+ *
123
+ * return response.json()
124
+ * }
125
+ *
126
+ * if (!isLoaded) {
127
+ * return <div>Loading...</div>
128
+ * }
129
+ *
130
+ * if (!isSignedIn) {
131
+ * return <div>Sign in to view this page</div>
132
+ * }
133
+ *
134
+ * return (
135
+ * <div>
136
+ * <p>
137
+ * Hello, {userId}! Your current active session is {sessionId}.
138
+ * </p>
139
+ * <button onClick={fetchExternalData}>Fetch Data</button>
140
+ * </div>
141
+ * )
142
+ * }
143
+ * ```
144
+ *
145
+ * </Tab>
146
+ * <Tab>
147
+ *
148
+ * {@include ../../docs/use-auth.md#nextjs-01}
149
+ *
150
+ * </Tab>
151
+ * </Tabs>
152
+ */
153
+ declare const useAuth: (initialAuthStateOrOptions?: UseAuthOptions) => UseAuthReturn;
154
+ /**
155
+ * A hook that derives and returns authentication state and utility functions based on the provided auth object.
156
+ *
157
+ * @param authObject - An object containing authentication-related properties and functions.
158
+ *
159
+ * @returns A derived authentication state with helper methods. If the authentication state is invalid, an error is thrown.
160
+ *
161
+ * @remarks
162
+ * This hook inspects session, user, and organization information to determine the current authentication state.
163
+ * It returns an object that includes various properties such as whether the state is loaded, if a user is signed in,
164
+ * session and user identifiers, organization roles, and a `has` function for authorization checks.
165
+ * Additionally, it provides `signOut` and `getToken` functions if applicable.
166
+ *
167
+ * @example
168
+ * ```tsx
169
+ * const {
170
+ * isLoaded,
171
+ * isSignedIn,
172
+ * userId,
173
+ * orgId,
174
+ * has,
175
+ * signOut,
176
+ * getToken
177
+ * } = useDerivedAuth(authObject);
178
+ * ```
179
+ */
180
+ declare function useDerivedAuth(authObject: any, { treatPendingAsSignedOut }?: PendingSessionOptions): UseAuthReturn;
181
+
182
+ export { AuthenticateWithRedirectCallback as A, ClerkDegraded as C, MultisessionAppSupport as M, Protect as P, RedirectToCreateOrganization as R, SignedIn as S, ClerkFailed as a, ClerkLoaded as b, ClerkLoading as c, RedirectToOrganizationProfile as d, RedirectToSignIn as e, RedirectToSignUp as f, RedirectToTasks as g, RedirectToUserProfile as h, SignedOut as i, type ProtectProps as j, useAuth as k, useDerivedAuth as u };
@@ -0,0 +1,182 @@
1
+ import * as _clerk_shared_types from '@clerk/shared/types';
2
+ import { HandleOAuthCallbackParams, ProtectProps as ProtectProps$1, PendingSessionOptions, UseAuthReturn } from '@clerk/shared/types';
3
+ import React from 'react';
4
+ import { W as WithClerkProp } from './types-BS-xjOf_.js';
5
+
6
+ declare const SignedIn: ({ children, treatPendingAsSignedOut }: React.PropsWithChildren<PendingSessionOptions>) => React.ReactNode;
7
+ declare const SignedOut: ({ children, treatPendingAsSignedOut }: React.PropsWithChildren<PendingSessionOptions>) => React.ReactNode;
8
+ declare const ClerkLoaded: ({ children }: React.PropsWithChildren<unknown>) => React.ReactNode;
9
+ declare const ClerkLoading: ({ children }: React.PropsWithChildren<unknown>) => React.ReactNode;
10
+ declare const ClerkFailed: ({ children }: React.PropsWithChildren<unknown>) => React.ReactNode;
11
+ declare const ClerkDegraded: ({ children }: React.PropsWithChildren<unknown>) => React.ReactNode;
12
+ type ProtectProps = React.PropsWithChildren<ProtectProps$1 & {
13
+ fallback?: React.ReactNode;
14
+ } & PendingSessionOptions>;
15
+ /**
16
+ * Use `<Protect/>` in order to prevent unauthenticated or unauthorized users from accessing the children passed to the component.
17
+ *
18
+ * Examples:
19
+ * ```
20
+ * <Protect permission="a_permission_key" />
21
+ * <Protect role="a_role_key" />
22
+ * <Protect condition={(has) => has({permission:"a_permission_key"})} />
23
+ * <Protect condition={(has) => has({role:"a_role_key"})} />
24
+ * <Protect fallback={<p>Unauthorized</p>} />
25
+ * ```
26
+ */
27
+ declare const Protect: ({ children, fallback, treatPendingAsSignedOut, ...restAuthorizedParams }: ProtectProps) => React.ReactNode;
28
+ declare const RedirectToSignIn: {
29
+ (props: _clerk_shared_types.Without<WithClerkProp<_clerk_shared_types.SignInRedirectOptions>, "clerk">): React.JSX.Element | null;
30
+ displayName: string;
31
+ };
32
+ declare const RedirectToSignUp: {
33
+ (props: _clerk_shared_types.Without<WithClerkProp<_clerk_shared_types.SignUpRedirectOptions>, "clerk">): React.JSX.Element | null;
34
+ displayName: string;
35
+ };
36
+ declare const RedirectToTasks: {
37
+ (props: _clerk_shared_types.Without<WithClerkProp<_clerk_shared_types.TasksRedirectOptions>, "clerk">): React.JSX.Element | null;
38
+ displayName: string;
39
+ };
40
+ /**
41
+ * @function
42
+ * @deprecated Use [`redirectToUserProfile()`](https://clerk.com/docs/reference/javascript/clerk#redirect-to-user-profile) instead.
43
+ */
44
+ declare const RedirectToUserProfile: {
45
+ (props: _clerk_shared_types.Without<{
46
+ clerk: _clerk_shared_types.LoadedClerk;
47
+ component?: string;
48
+ }, "clerk">): React.JSX.Element | null;
49
+ displayName: string;
50
+ };
51
+ /**
52
+ * @function
53
+ * @deprecated Use [`redirectToOrganizationProfile()`](https://clerk.com/docs/reference/javascript/clerk#redirect-to-organization-profile) instead.
54
+ */
55
+ declare const RedirectToOrganizationProfile: {
56
+ (props: _clerk_shared_types.Without<{
57
+ clerk: _clerk_shared_types.LoadedClerk;
58
+ component?: string;
59
+ }, "clerk">): React.JSX.Element | null;
60
+ displayName: string;
61
+ };
62
+ /**
63
+ * @function
64
+ * @deprecated Use [`redirectToCreateOrganization()`](https://clerk.com/docs/reference/javascript/clerk#redirect-to-create-organization) instead.
65
+ */
66
+ declare const RedirectToCreateOrganization: {
67
+ (props: _clerk_shared_types.Without<{
68
+ clerk: _clerk_shared_types.LoadedClerk;
69
+ component?: string;
70
+ }, "clerk">): React.JSX.Element | null;
71
+ displayName: string;
72
+ };
73
+ declare const AuthenticateWithRedirectCallback: {
74
+ (props: _clerk_shared_types.Without<WithClerkProp<HandleOAuthCallbackParams>, "clerk">): React.JSX.Element | null;
75
+ displayName: string;
76
+ };
77
+ declare const MultisessionAppSupport: ({ children }: React.PropsWithChildren<unknown>) => React.JSX.Element;
78
+
79
+ /**
80
+ * @inline
81
+ */
82
+ type UseAuthOptions = Record<string, any> | PendingSessionOptions | undefined | null;
83
+ /**
84
+ * The `useAuth()` hook provides access to the current user's authentication state and methods to manage the active session.
85
+ *
86
+ * > [!NOTE]
87
+ * > To access auth data server-side, see the [`Auth` object reference doc](https://clerk.com/docs/reference/backend/types/auth-object).
88
+ *
89
+ * <If sdk="nextjs">
90
+ * By default, Next.js opts all routes into static rendering. If you need to opt a route or routes into dynamic rendering because you need to access the authentication data at request time, you can create a boundary by passing the `dynamic` prop to `<ClerkProvider>`. See the [guide on rendering modes](https://clerk.com/docs/guides/development/rendering-modes) for more information, including code examples.
91
+ * </If>
92
+ *
93
+ * @unionReturnHeadings
94
+ * ["Initialization", "Signed out", "Signed in (no active organization)", "Signed in (with active organization)"]
95
+ *
96
+ * @param [initialAuthStateOrOptions] - An object containing the initial authentication state or options for the `useAuth()` hook. If not provided, the hook will attempt to derive the state from the context. `treatPendingAsSignedOut` is a boolean that indicates whether pending sessions are considered as signed out or not. Defaults to `true`.
97
+ *
98
+ * @function
99
+ *
100
+ * @example
101
+ *
102
+ * The following example demonstrates how to use the `useAuth()` hook to access the current auth state, like whether the user is signed in or not. It also includes a basic example for using the `getToken()` method to retrieve a session token for fetching data from an external resource.
103
+ *
104
+ * <Tabs items='React,Next.js'>
105
+ * <Tab>
106
+ *
107
+ * ```tsx {{ filename: 'src/pages/ExternalDataPage.tsx' }}
108
+ * import { useAuth } from '@clerk/react'
109
+ *
110
+ * export default function ExternalDataPage() {
111
+ * const { userId, sessionId, getToken, isLoaded, isSignedIn } = useAuth()
112
+ *
113
+ * const fetchExternalData = async () => {
114
+ * const token = await getToken()
115
+ *
116
+ * // Fetch data from an external API
117
+ * const response = await fetch('https://api.example.com/data', {
118
+ * headers: {
119
+ * Authorization: `Bearer ${token}`,
120
+ * },
121
+ * })
122
+ *
123
+ * return response.json()
124
+ * }
125
+ *
126
+ * if (!isLoaded) {
127
+ * return <div>Loading...</div>
128
+ * }
129
+ *
130
+ * if (!isSignedIn) {
131
+ * return <div>Sign in to view this page</div>
132
+ * }
133
+ *
134
+ * return (
135
+ * <div>
136
+ * <p>
137
+ * Hello, {userId}! Your current active session is {sessionId}.
138
+ * </p>
139
+ * <button onClick={fetchExternalData}>Fetch Data</button>
140
+ * </div>
141
+ * )
142
+ * }
143
+ * ```
144
+ *
145
+ * </Tab>
146
+ * <Tab>
147
+ *
148
+ * {@include ../../docs/use-auth.md#nextjs-01}
149
+ *
150
+ * </Tab>
151
+ * </Tabs>
152
+ */
153
+ declare const useAuth: (initialAuthStateOrOptions?: UseAuthOptions) => UseAuthReturn;
154
+ /**
155
+ * A hook that derives and returns authentication state and utility functions based on the provided auth object.
156
+ *
157
+ * @param authObject - An object containing authentication-related properties and functions.
158
+ *
159
+ * @returns A derived authentication state with helper methods. If the authentication state is invalid, an error is thrown.
160
+ *
161
+ * @remarks
162
+ * This hook inspects session, user, and organization information to determine the current authentication state.
163
+ * It returns an object that includes various properties such as whether the state is loaded, if a user is signed in,
164
+ * session and user identifiers, organization roles, and a `has` function for authorization checks.
165
+ * Additionally, it provides `signOut` and `getToken` functions if applicable.
166
+ *
167
+ * @example
168
+ * ```tsx
169
+ * const {
170
+ * isLoaded,
171
+ * isSignedIn,
172
+ * userId,
173
+ * orgId,
174
+ * has,
175
+ * signOut,
176
+ * getToken
177
+ * } = useDerivedAuth(authObject);
178
+ * ```
179
+ */
180
+ declare function useDerivedAuth(authObject: any, { treatPendingAsSignedOut }?: PendingSessionOptions): UseAuthReturn;
181
+
182
+ export { AuthenticateWithRedirectCallback as A, ClerkDegraded as C, MultisessionAppSupport as M, Protect as P, RedirectToCreateOrganization as R, SignedIn as S, ClerkFailed as a, ClerkLoaded as b, ClerkLoading as c, RedirectToOrganizationProfile as d, RedirectToSignIn as e, RedirectToSignUp as f, RedirectToTasks as g, RedirectToUserProfile as h, SignedOut as i, type ProtectProps as j, useAuth as k, useDerivedAuth as u };
package/package.json ADDED
@@ -0,0 +1,116 @@
1
+ {
2
+ "name": "@clerk/react",
3
+ "version": "5.54.0",
4
+ "description": "Clerk React library",
5
+ "keywords": [
6
+ "clerk",
7
+ "react",
8
+ "auth",
9
+ "authentication",
10
+ "passwordless",
11
+ "session",
12
+ "jwt"
13
+ ],
14
+ "homepage": "https://clerk.com/",
15
+ "bugs": {
16
+ "url": "https://github.com/clerk/javascript/issues"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/clerk/javascript.git",
21
+ "directory": "packages/react"
22
+ },
23
+ "license": "MIT",
24
+ "author": "Clerk",
25
+ "exports": {
26
+ ".": {
27
+ "import": {
28
+ "types": "./dist/index.d.mts",
29
+ "default": "./dist/index.mjs"
30
+ },
31
+ "require": {
32
+ "types": "./dist/index.d.ts",
33
+ "default": "./dist/index.js"
34
+ }
35
+ },
36
+ "./internal": {
37
+ "import": {
38
+ "types": "./dist/internal.d.mts",
39
+ "default": "./dist/internal.mjs"
40
+ },
41
+ "require": {
42
+ "types": "./dist/internal.d.ts",
43
+ "default": "./dist/internal.js"
44
+ }
45
+ },
46
+ "./errors": {
47
+ "import": {
48
+ "types": "./dist/errors.d.mts",
49
+ "default": "./dist/errors.mjs"
50
+ },
51
+ "require": {
52
+ "types": "./dist/errors.d.ts",
53
+ "default": "./dist/errors.js"
54
+ }
55
+ },
56
+ "./experimental": {
57
+ "import": {
58
+ "types": "./dist/experimental.d.mts",
59
+ "default": "./dist/experimental.mjs"
60
+ },
61
+ "require": {
62
+ "types": "./dist/experimental.d.ts",
63
+ "default": "./dist/experimental.js"
64
+ }
65
+ },
66
+ "./legacy": {
67
+ "import": {
68
+ "types": "./dist/legacy.d.mts",
69
+ "default": "./dist/legacy.mjs"
70
+ },
71
+ "require": {
72
+ "types": "./dist/legacy.d.ts",
73
+ "default": "./dist/legacy.js"
74
+ }
75
+ },
76
+ "./package.json": "./package.json"
77
+ },
78
+ "main": "./dist/index.js",
79
+ "files": [
80
+ "dist"
81
+ ],
82
+ "dependencies": {
83
+ "tslib": "2.8.1",
84
+ "@clerk/shared": "^3.33.0"
85
+ },
86
+ "devDependencies": {
87
+ "@types/semver": "^7.7.1",
88
+ "@clerk/themes": "2.4.35",
89
+ "@clerk/localizations": "3.27.2"
90
+ },
91
+ "peerDependencies": {
92
+ "react": "^18.0.0 || ^19.0.0 || ^19.0.0-0",
93
+ "react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-0"
94
+ },
95
+ "engines": {
96
+ "node": ">=20.9.0"
97
+ },
98
+ "publishConfig": {
99
+ "access": "public"
100
+ },
101
+ "scripts": {
102
+ "build": "tsup",
103
+ "build:declarations": "tsc -p tsconfig.declarations.json",
104
+ "clean": "rimraf ./dist",
105
+ "dev": "tsup --watch",
106
+ "dev:publish": "pnpm dev --env.publish",
107
+ "format": "node ../../scripts/format-package.mjs",
108
+ "format:check": "node ../../scripts/format-package.mjs --check",
109
+ "lint": "eslint src",
110
+ "lint:attw": "attw --pack . --profile node16",
111
+ "lint:publint": "publint",
112
+ "publish:local": "pnpm yalc push --replace --sig",
113
+ "test": "vitest run",
114
+ "test:watch": "vitest watch"
115
+ }
116
+ }