@clerk/react 6.0.0-snapshot.v20251224145055 → 6.0.0-snapshot.v20260105214115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-4F7CSI4T.mjs → chunk-RG4XQAGC.mjs} +21 -35
- package/dist/chunk-RG4XQAGC.mjs.map +1 -0
- package/dist/experimental.d.mts +28 -25
- package/dist/experimental.d.ts +28 -25
- package/dist/experimental.js +4 -2
- package/dist/experimental.js.map +1 -1
- package/dist/experimental.mjs +4 -2
- package/dist/experimental.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +22 -38
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -8
- package/dist/index.mjs.map +1 -1
- package/dist/internal.d.mts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js.map +1 -1
- package/dist/internal.mjs +1 -1
- package/dist/{useAuth-D_JXwEQe.d.mts → useAuth-CslfTE3X.d.mts} +27 -14
- package/dist/{useAuth-RH7cOyeT.d.ts → useAuth-EN4wLVLS.d.ts} +27 -14
- package/package.json +4 -4
- package/dist/chunk-4F7CSI4T.mjs.map +0 -1
package/dist/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/internal.ts","../src/errors/errorThrower.ts","../src/components/controlComponents.tsx","../src/contexts/IsomorphicClerkContext.tsx","../src/contexts/SessionContext.tsx","../src/hooks/useAuth.ts","../src/contexts/AuthContext.ts","../src/errors/messages.ts","../src/hooks/useAssertWrappedByClerkProvider.ts","../src/hooks/useEmailLink.ts","../src/hooks/useClerkSignal.ts","../src/hooks/index.ts","../src/components/withClerk.tsx","../src/hooks/useRoutingProps.ts"],"sourcesContent":["export { setErrorThrowerOptions } from './errors/errorThrower';\nexport { MultisessionAppSupport } from './components/controlComponents';\nexport { useRoutingProps } from './hooks/useRoutingProps';\nexport { useDerivedAuth } from './hooks/useAuth';\n\nexport {\n clerkJsScriptUrl,\n buildClerkJsScriptAttributes,\n clerkUiScriptUrl,\n buildClerkUiScriptAttributes,\n setClerkJsLoadingErrorPackageName,\n} from '@clerk/shared/loadClerkJsScript';\n\nexport type { Ui } from '@clerk/ui/internal';\n","import type { ErrorThrowerOptions } from '@clerk/shared/error';\nimport { buildErrorThrower } from '@clerk/shared/error';\n\nconst errorThrower = buildErrorThrower({ packageName: '@clerk/react' });\n\nexport { errorThrower };\n\n/**\n * Overrides options of the internal errorThrower (eg setting packageName prefix).\n *\n * @internal\n */\nexport function setErrorThrowerOptions(options: ErrorThrowerOptions) {\n errorThrower.setMessages(options).setPackageName(options);\n}\n","import { deprecated } from '@clerk/shared/deprecated';\nimport type {\n HandleOAuthCallbackParams,\n PendingSessionOptions,\n ProtectProps as _ProtectProps,\n} from '@clerk/shared/types';\nimport React from 'react';\n\nimport { useIsomorphicClerkContext } from '../contexts/IsomorphicClerkContext';\nimport { useSessionContext } from '../contexts/SessionContext';\nimport { useAuth } from '../hooks';\nimport { useAssertWrappedByClerkProvider } from '../hooks/useAssertWrappedByClerkProvider';\nimport type { RedirectToSignInProps, RedirectToSignUpProps, RedirectToTasksProps, WithClerkProp } from '../types';\nimport { withClerk } from './withClerk';\n\nexport const SignedIn = ({ children, treatPendingAsSignedOut }: React.PropsWithChildren<PendingSessionOptions>) => {\n useAssertWrappedByClerkProvider('SignedIn');\n\n const { userId } = useAuth({ treatPendingAsSignedOut });\n if (userId) {\n return children;\n }\n return null;\n};\n\nexport const SignedOut = ({ children, treatPendingAsSignedOut }: React.PropsWithChildren<PendingSessionOptions>) => {\n useAssertWrappedByClerkProvider('SignedOut');\n\n const { userId } = useAuth({ treatPendingAsSignedOut });\n if (userId === null) {\n return children;\n }\n return null;\n};\n\nexport const ClerkLoaded = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('ClerkLoaded');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n if (!isomorphicClerk.loaded) {\n return null;\n }\n return children;\n};\n\nexport const ClerkLoading = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('ClerkLoading');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n if (isomorphicClerk.status !== 'loading') {\n return null;\n }\n return children;\n};\n\nexport const ClerkFailed = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('ClerkFailed');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n if (isomorphicClerk.status !== 'error') {\n return null;\n }\n return children;\n};\n\nexport const ClerkDegraded = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('ClerkDegraded');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n if (isomorphicClerk.status !== 'degraded') {\n return null;\n }\n return children;\n};\n\nexport type ProtectProps = React.PropsWithChildren<\n _ProtectProps & {\n fallback?: React.ReactNode;\n } & PendingSessionOptions\n>;\n\n/**\n * Use `<Protect/>` in order to prevent unauthenticated or unauthorized users from accessing the children passed to the component.\n *\n * Examples:\n * ```\n * <Protect permission=\"a_permission_key\" />\n * <Protect role=\"a_role_key\" />\n * <Protect condition={(has) => has({permission:\"a_permission_key\"})} />\n * <Protect condition={(has) => has({role:\"a_role_key\"})} />\n * <Protect fallback={<p>Unauthorized</p>} />\n * ```\n */\nexport const Protect = ({ children, fallback, treatPendingAsSignedOut, ...restAuthorizedParams }: ProtectProps) => {\n useAssertWrappedByClerkProvider('Protect');\n\n const { isLoaded, has, userId } = useAuth({ treatPendingAsSignedOut });\n\n /**\n * Avoid flickering children or fallback while clerk is loading sessionId or userId\n */\n if (!isLoaded) {\n return null;\n }\n\n /**\n * Fallback to UI provided by user or `null` if authorization checks failed\n */\n const unauthorized = fallback ?? null;\n\n const authorized = children;\n\n if (!userId) {\n return unauthorized;\n }\n\n /**\n * Check against the results of `has` called inside the callback\n */\n if (typeof restAuthorizedParams.condition === 'function') {\n if (restAuthorizedParams.condition(has)) {\n return authorized;\n }\n return unauthorized;\n }\n\n if (\n restAuthorizedParams.role ||\n restAuthorizedParams.permission ||\n restAuthorizedParams.feature ||\n restAuthorizedParams.plan\n ) {\n if (has(restAuthorizedParams)) {\n return authorized;\n }\n return unauthorized;\n }\n\n /**\n * If neither of the authorization params are passed behave as the `<SignedIn/>`.\n * If fallback is present render that instead of rendering nothing.\n */\n return authorized;\n};\n\nexport const RedirectToSignIn = withClerk(({ clerk, ...props }: WithClerkProp<RedirectToSignInProps>) => {\n const { client, session } = clerk;\n\n const hasSignedInSessions = (client.signedInSessions?.length ?? 0) > 0;\n\n React.useEffect(() => {\n if (session === null && hasSignedInSessions) {\n void clerk.redirectToAfterSignOut();\n } else {\n void clerk.redirectToSignIn(props);\n }\n }, []);\n\n return null;\n}, 'RedirectToSignIn');\n\nexport const RedirectToSignUp = withClerk(({ clerk, ...props }: WithClerkProp<RedirectToSignUpProps>) => {\n React.useEffect(() => {\n void clerk.redirectToSignUp(props);\n }, []);\n\n return null;\n}, 'RedirectToSignUp');\n\nexport const RedirectToTasks = withClerk(({ clerk, ...props }: WithClerkProp<RedirectToTasksProps>) => {\n React.useEffect(() => {\n void clerk.redirectToTasks(props);\n }, []);\n\n return null;\n}, 'RedirectToTasks');\n\n/**\n * @function\n * @deprecated Use [`redirectToUserProfile()`](https://clerk.com/docs/reference/javascript/clerk#redirect-to-user-profile) instead.\n */\nexport const RedirectToUserProfile = withClerk(({ clerk }) => {\n React.useEffect(() => {\n deprecated('RedirectToUserProfile', 'Use the `redirectToUserProfile()` method instead.');\n void clerk.redirectToUserProfile();\n }, []);\n\n return null;\n}, 'RedirectToUserProfile');\n\n/**\n * @function\n * @deprecated Use [`redirectToOrganizationProfile()`](https://clerk.com/docs/reference/javascript/clerk#redirect-to-organization-profile) instead.\n */\nexport const RedirectToOrganizationProfile = withClerk(({ clerk }) => {\n React.useEffect(() => {\n deprecated('RedirectToOrganizationProfile', 'Use the `redirectToOrganizationProfile()` method instead.');\n void clerk.redirectToOrganizationProfile();\n }, []);\n\n return null;\n}, 'RedirectToOrganizationProfile');\n\n/**\n * @function\n * @deprecated Use [`redirectToCreateOrganization()`](https://clerk.com/docs/reference/javascript/clerk#redirect-to-create-organization) instead.\n */\nexport const RedirectToCreateOrganization = withClerk(({ clerk }) => {\n React.useEffect(() => {\n deprecated('RedirectToCreateOrganization', 'Use the `redirectToCreateOrganization()` method instead.');\n void clerk.redirectToCreateOrganization();\n }, []);\n\n return null;\n}, 'RedirectToCreateOrganization');\n\nexport const AuthenticateWithRedirectCallback = withClerk(\n ({ clerk, ...handleRedirectCallbackParams }: WithClerkProp<HandleOAuthCallbackParams>) => {\n React.useEffect(() => {\n void clerk.handleRedirectCallback(handleRedirectCallbackParams);\n }, []);\n\n return null;\n },\n 'AuthenticateWithRedirectCallback',\n);\n\nexport const MultisessionAppSupport = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('MultisessionAppSupport');\n\n const session = useSessionContext();\n return <React.Fragment key={session ? session.id : 'no-users'}>{children}</React.Fragment>;\n};\n","import { ClerkInstanceContext, useClerkInstanceContext } from '@clerk/shared/react';\n\nimport type { IsomorphicClerk } from '../isomorphicClerk';\n\nexport const IsomorphicClerkContext = ClerkInstanceContext;\nexport const useIsomorphicClerkContext = useClerkInstanceContext as unknown as () => IsomorphicClerk;\n","export { SessionContext, useSessionContext } from '@clerk/shared/react';\n","import { createCheckAuthorization, resolveAuthState } from '@clerk/shared/authorization';\nimport { eventMethodCalled } from '@clerk/shared/telemetry';\nimport type {\n CheckAuthorizationWithCustomPermissions,\n GetToken,\n JwtPayload,\n PendingSessionOptions,\n SignOut,\n UseAuthReturn,\n} from '@clerk/shared/types';\nimport { useCallback } from 'react';\n\nimport { useAuthContext } from '../contexts/AuthContext';\nimport { useIsomorphicClerkContext } from '../contexts/IsomorphicClerkContext';\nimport { errorThrower } from '../errors/errorThrower';\nimport { invalidStateError } from '../errors/messages';\nimport { useAssertWrappedByClerkProvider } from './useAssertWrappedByClerkProvider';\nimport { createGetToken, createSignOut } from './utils';\n\n/**\n * @inline\n */\ntype UseAuthOptions = Record<string, any> | PendingSessionOptions | undefined | null;\n\n/**\n * The `useAuth()` hook provides access to the current user's authentication state and methods to manage the active session.\n *\n * > [!NOTE]\n * > To access auth data server-side, see the [`Auth` object reference doc](https://clerk.com/docs/reference/backend/types/auth-object).\n *\n * <If sdk=\"nextjs\">\n * 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.\n * </If>\n *\n * @unionReturnHeadings\n * [\"Initialization\", \"Signed out\", \"Signed in (no active organization)\", \"Signed in (with active organization)\"]\n *\n * @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`.\n *\n * @function\n *\n * @example\n *\n * 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.\n *\n * <Tabs items='React,Next.js'>\n * <Tab>\n *\n * ```tsx {{ filename: 'src/pages/ExternalDataPage.tsx' }}\n * import { useAuth } from '@clerk/react'\n *\n * export default function ExternalDataPage() {\n * const { userId, sessionId, getToken, isLoaded, isSignedIn } = useAuth()\n *\n * const fetchExternalData = async () => {\n * const token = await getToken()\n *\n * // Fetch data from an external API\n * const response = await fetch('https://api.example.com/data', {\n * headers: {\n * Authorization: `Bearer ${token}`,\n * },\n * })\n *\n * return response.json()\n * }\n *\n * if (!isLoaded) {\n * return <div>Loading...</div>\n * }\n *\n * if (!isSignedIn) {\n * return <div>Sign in to view this page</div>\n * }\n *\n * return (\n * <div>\n * <p>\n * Hello, {userId}! Your current active session is {sessionId}.\n * </p>\n * <button onClick={fetchExternalData}>Fetch Data</button>\n * </div>\n * )\n * }\n * ```\n *\n * </Tab>\n * <Tab>\n *\n * {@include ../../docs/use-auth.md#nextjs-01}\n *\n * </Tab>\n * </Tabs>\n */\nexport const useAuth = (initialAuthStateOrOptions: UseAuthOptions = {}): UseAuthReturn => {\n useAssertWrappedByClerkProvider('useAuth');\n\n const { treatPendingAsSignedOut, ...rest } = initialAuthStateOrOptions ?? {};\n const initialAuthState = rest as any;\n\n const authContextFromHook = useAuthContext();\n let authContext = authContextFromHook;\n\n if (authContext.sessionId === undefined && authContext.userId === undefined) {\n authContext = initialAuthState != null ? initialAuthState : {};\n }\n\n const isomorphicClerk = useIsomorphicClerkContext();\n const getToken: GetToken = useCallback(createGetToken(isomorphicClerk), [isomorphicClerk]);\n const signOut: SignOut = useCallback(createSignOut(isomorphicClerk), [isomorphicClerk]);\n\n isomorphicClerk.telemetry?.record(eventMethodCalled('useAuth', { treatPendingAsSignedOut }));\n\n return useDerivedAuth(\n {\n ...authContext,\n getToken,\n signOut,\n },\n {\n treatPendingAsSignedOut,\n },\n );\n};\n\n/**\n * A hook that derives and returns authentication state and utility functions based on the provided auth object.\n *\n * @param authObject - An object containing authentication-related properties and functions.\n *\n * @returns A derived authentication state with helper methods. If the authentication state is invalid, an error is thrown.\n *\n * @remarks\n * This hook inspects session, user, and organization information to determine the current authentication state.\n * It returns an object that includes various properties such as whether the state is loaded, if a user is signed in,\n * session and user identifiers, Organization Roles, and a `has` function for authorization checks.\n * Additionally, it provides `signOut` and `getToken` functions if applicable.\n *\n * @example\n * ```tsx\n * const {\n * isLoaded,\n * isSignedIn,\n * userId,\n * orgId,\n * has,\n * signOut,\n * getToken\n * } = useDerivedAuth(authObject);\n * ```\n */\nexport function useDerivedAuth(\n authObject: any,\n { treatPendingAsSignedOut = true }: PendingSessionOptions = {},\n): UseAuthReturn {\n const { userId, orgId, orgRole, has, signOut, getToken, orgPermissions, factorVerificationAge, sessionClaims } =\n authObject ?? {};\n\n const derivedHas = useCallback(\n (params: Parameters<CheckAuthorizationWithCustomPermissions>[0]) => {\n if (has) {\n return has(params);\n }\n return createCheckAuthorization({\n userId,\n orgId,\n orgRole,\n orgPermissions,\n factorVerificationAge,\n features: ((sessionClaims as JwtPayload | undefined)?.fea as string) || '',\n plans: ((sessionClaims as JwtPayload | undefined)?.pla as string) || '',\n })(params);\n },\n [has, userId, orgId, orgRole, orgPermissions, factorVerificationAge, sessionClaims],\n );\n\n const payload = resolveAuthState({\n authObject: {\n ...authObject,\n getToken,\n signOut,\n has: derivedHas,\n },\n options: {\n treatPendingAsSignedOut,\n },\n });\n\n if (!payload) {\n return errorThrower.throw(invalidStateError);\n }\n\n return payload;\n}\n","import { createContextAndHook } from '@clerk/shared/react';\nimport type {\n ActClaim,\n JwtPayload,\n OrganizationCustomPermissionKey,\n OrganizationCustomRoleKey,\n SessionStatusClaim,\n} from '@clerk/shared/types';\n\nexport type AuthContextValue = {\n userId: string | null | undefined;\n sessionId: string | null | undefined;\n sessionStatus: SessionStatusClaim | null | undefined;\n sessionClaims: JwtPayload | null | undefined;\n actor: ActClaim | null | undefined;\n orgId: string | null | undefined;\n orgRole: OrganizationCustomRoleKey | null | undefined;\n orgSlug: string | null | undefined;\n orgPermissions: OrganizationCustomPermissionKey[] | null | undefined;\n factorVerificationAge: [number, number] | null;\n};\n\nexport const [AuthContext, useAuthContext] = createContextAndHook<AuthContextValue>('AuthContext');\n","export const noClerkProviderError = 'You must wrap your application in a <ClerkProvider> component.';\n\nexport const multipleClerkProvidersError =\n \"You've added multiple <ClerkProvider> components in your React component tree. Wrap your components in a single <ClerkProvider>.\";\n\nexport const multipleChildrenInButtonComponent = (name: string) =>\n `You've passed multiple children components to <${name}/>. You can only pass a single child component or text.`;\n\nexport const invalidStateError =\n 'Invalid state. Feel free to submit a bug or reach out to support here: https://clerk.com/support';\n\nexport const unsupportedNonBrowserDomainOrProxyUrlFunction =\n 'Unsupported usage of isSatellite, domain or proxyUrl. The usage of isSatellite, domain or proxyUrl as function is not supported in non-browser environments.';\n\nexport const userProfilePageRenderedError =\n '<UserProfile.Page /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.';\nexport const userProfileLinkRenderedError =\n '<UserProfile.Link /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.';\n\nexport const organizationProfilePageRenderedError =\n '<OrganizationProfile.Page /> component needs to be a direct child of `<OrganizationProfile />` or `<OrganizationSwitcher />`.';\nexport const organizationProfileLinkRenderedError =\n '<OrganizationProfile.Link /> component needs to be a direct child of `<OrganizationProfile />` or `<OrganizationSwitcher />`.';\n\nexport const customPagesIgnoredComponent = (componentName: string) =>\n `<${componentName} /> can only accept <${componentName}.Page /> and <${componentName}.Link /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.`;\n\nexport const customPageWrongProps = (componentName: string) =>\n `Missing props. <${componentName}.Page /> component requires the following props: url, label, labelIcon, alongside with children to be rendered inside the page.`;\n\nexport const customLinkWrongProps = (componentName: string) =>\n `Missing props. <${componentName}.Link /> component requires the following props: url, label and labelIcon.`;\n\nexport const useAuthHasRequiresRoleOrPermission =\n 'Missing parameters. `has` from `useAuth` requires a permission or role key to be passed. Example usage: `has({permission: \"org:posts:edit\"`';\n\nexport const noPathProvidedError = (componentName: string) =>\n `The <${componentName}/> component uses path-based routing by default unless a different routing strategy is provided using the \\`routing\\` prop. When path-based routing is used, you need to provide the path where the component is mounted on by using the \\`path\\` prop. Example: <${componentName} path={'/my-path'} />`;\n\nexport const incompatibleRoutingWithPathProvidedError = (componentName: string) =>\n `The \\`path\\` prop will only be respected when the Clerk component uses path-based routing. To resolve this error, pass \\`routing='path'\\` to the <${componentName}/> component, or drop the \\`path\\` prop to switch to hash-based routing. For more details please refer to our docs: https://clerk.com/docs`;\n\nexport const userButtonIgnoredComponent = `<UserButton /> can only accept <UserButton.UserProfilePage />, <UserButton.UserProfileLink /> and <UserButton.MenuItems /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.`;\n\nexport const customMenuItemsIgnoredComponent =\n '<UserButton.MenuItems /> component can only accept <UserButton.Action /> and <UserButton.Link /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.';\n\nexport const userButtonMenuItemsRenderedError =\n '<UserButton.MenuItems /> component needs to be a direct child of `<UserButton />`.';\n\nexport const userButtonMenuActionRenderedError =\n '<UserButton.Action /> component needs to be a direct child of `<UserButton.MenuItems />`.';\n\nexport const userButtonMenuLinkRenderedError =\n '<UserButton.Link /> component needs to be a direct child of `<UserButton.MenuItems />`.';\n\nexport const userButtonMenuItemLinkWrongProps =\n 'Missing props. <UserButton.Link /> component requires the following props: href, label and labelIcon.';\n\nexport const userButtonMenuItemsActionWrongsProps =\n 'Missing props. <UserButton.Action /> component requires the following props: label.';\n","import { useAssertWrappedByClerkProvider as useSharedAssertWrappedByClerkProvider } from '@clerk/shared/react';\n\nimport { errorThrower } from '../errors/errorThrower';\n\nexport const useAssertWrappedByClerkProvider = (source: string): void => {\n useSharedAssertWrappedByClerkProvider(() => {\n errorThrower.throwMissingClerkProviderError({ source });\n });\n};\n","import type {\n CreateEmailLinkFlowReturn,\n EmailAddressResource,\n SignInResource,\n SignInStartEmailLinkFlowParams,\n SignUpResource,\n StartEmailLinkFlowParams,\n} from '@clerk/shared/types';\nimport React from 'react';\n\ntype EmailLinkable = SignUpResource | EmailAddressResource | SignInResource;\ntype UseEmailLinkSignInReturn = CreateEmailLinkFlowReturn<SignInStartEmailLinkFlowParams, SignInResource>;\ntype UseEmailLinkSignUpReturn = CreateEmailLinkFlowReturn<StartEmailLinkFlowParams, SignUpResource>;\ntype UseEmailLinkEmailAddressReturn = CreateEmailLinkFlowReturn<StartEmailLinkFlowParams, EmailAddressResource>;\n\nfunction useEmailLink(resource: SignInResource): UseEmailLinkSignInReturn;\nfunction useEmailLink(resource: SignUpResource): UseEmailLinkSignUpReturn;\nfunction useEmailLink(resource: EmailAddressResource): UseEmailLinkEmailAddressReturn;\nfunction useEmailLink(\n resource: EmailLinkable,\n): UseEmailLinkSignInReturn | UseEmailLinkSignUpReturn | UseEmailLinkEmailAddressReturn {\n const { startEmailLinkFlow, cancelEmailLinkFlow } = React.useMemo(() => resource.createEmailLinkFlow(), [resource]);\n\n React.useEffect(() => {\n return cancelEmailLinkFlow;\n }, []);\n\n return {\n startEmailLinkFlow,\n cancelEmailLinkFlow,\n } as UseEmailLinkSignInReturn | UseEmailLinkSignUpReturn | UseEmailLinkEmailAddressReturn;\n}\n\nexport { useEmailLink };\n","import { eventMethodCalled } from '@clerk/shared/telemetry';\nimport type { SignInSignalValue, SignUpSignalValue } from '@clerk/shared/types';\nimport { useCallback, useSyncExternalStore } from 'react';\n\nimport { useIsomorphicClerkContext } from '../contexts/IsomorphicClerkContext';\nimport { useAssertWrappedByClerkProvider } from './useAssertWrappedByClerkProvider';\n\nfunction useClerkSignal(signal: 'signIn'): SignInSignalValue;\nfunction useClerkSignal(signal: 'signUp'): SignUpSignalValue;\nfunction useClerkSignal(signal: 'signIn' | 'signUp'): SignInSignalValue | SignUpSignalValue {\n useAssertWrappedByClerkProvider('useClerkSignal');\n\n const clerk = useIsomorphicClerkContext();\n\n switch (signal) {\n case 'signIn':\n clerk.telemetry?.record(eventMethodCalled('useSignIn', { apiVersion: '2025-11' }));\n break;\n case 'signUp':\n clerk.telemetry?.record(eventMethodCalled('useSignUp', { apiVersion: '2025-11' }));\n break;\n default:\n break;\n }\n\n const subscribe = useCallback(\n (callback: () => void) => {\n if (!clerk.loaded) {\n return () => {};\n }\n\n return clerk.__internal_state.__internal_effect(() => {\n switch (signal) {\n case 'signIn':\n clerk.__internal_state.signInSignal();\n break;\n case 'signUp':\n clerk.__internal_state.signUpSignal();\n break;\n default:\n throw new Error(`Unknown signal: ${signal}`);\n }\n callback();\n });\n },\n [clerk, clerk.loaded, clerk.__internal_state],\n );\n const getSnapshot = useCallback(() => {\n switch (signal) {\n case 'signIn':\n return clerk.__internal_state.signInSignal() as SignInSignalValue;\n case 'signUp':\n return clerk.__internal_state.signUpSignal() as SignUpSignalValue;\n default:\n throw new Error(`Unknown signal: ${signal}`);\n }\n }, [clerk.__internal_state]);\n\n const value = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);\n\n return value;\n}\n\n/**\n * This hook allows you to access the Signal-based `SignIn` resource.\n *\n * @example\n * import { useSignInSignal } from \"@clerk/react/experimental\";\n *\n * function SignInForm() {\n * const { signIn, errors, fetchStatus } = useSignInSignal();\n * //\n * }\n *\n * @experimental This experimental API is subject to change.\n */\nexport function useSignIn() {\n return useClerkSignal('signIn');\n}\n\n/**\n * This hook allows you to access the Signal-based `SignUp` resource.\n *\n * @example\n * import { useSignUpSignal } from \"@clerk/react/experimental\";\n *\n * function SignUpForm() {\n * const { signUp, errors, fetchStatus } = useSignUpSignal();\n * //\n * }\n *\n * @experimental This experimental API is subject to change.\n */\nexport function useSignUp() {\n return useClerkSignal('signUp');\n}\n","export { useAuth } from './useAuth';\nexport { useEmailLink } from './useEmailLink';\nexport { useSignIn, useSignUp } from './useClerkSignal';\nexport {\n useClerk,\n useOrganization,\n useOrganizationList,\n useSessionList,\n useUser,\n useSession,\n useReverification,\n __experimental_useCheckout,\n __experimental_CheckoutProvider,\n __experimental_usePaymentElement,\n __experimental_PaymentElementProvider,\n __experimental_PaymentElement,\n} from '@clerk/shared/react';\n","import type { LoadedClerk, Without } from '@clerk/shared/types';\nimport React from 'react';\n\nimport { useIsomorphicClerkContext } from '../contexts/IsomorphicClerkContext';\nimport { useAssertWrappedByClerkProvider } from '../hooks/useAssertWrappedByClerkProvider';\n\nexport const withClerk = <P extends { clerk: LoadedClerk; component?: string }>(\n Component: React.ComponentType<P>,\n displayNameOrOptions?: string | { component: string; renderWhileLoading?: boolean },\n) => {\n const passedDisplayedName =\n typeof displayNameOrOptions === 'string' ? displayNameOrOptions : displayNameOrOptions?.component;\n const displayName = passedDisplayedName || Component.displayName || Component.name || 'Component';\n Component.displayName = displayName;\n\n const options = typeof displayNameOrOptions === 'string' ? undefined : displayNameOrOptions;\n\n const HOC = (props: Without<P, 'clerk'>) => {\n useAssertWrappedByClerkProvider(displayName || 'withClerk');\n\n const clerk = useIsomorphicClerkContext();\n\n if (!clerk.loaded && !options?.renderWhileLoading) {\n return null;\n }\n\n return (\n <Component\n {...(props as P)}\n component={displayName}\n clerk={clerk}\n />\n );\n };\n HOC.displayName = `withClerk(${displayName})`;\n return HOC;\n};\n","import type { RoutingOptions } from '@clerk/shared/types';\n\nimport { errorThrower } from '../errors/errorThrower';\nimport { incompatibleRoutingWithPathProvidedError, noPathProvidedError } from '../errors/messages';\n\nexport function useRoutingProps<T extends RoutingOptions>(\n componentName: string,\n props: T,\n routingOptions?: RoutingOptions,\n): T {\n const path = props.path || routingOptions?.path;\n const routing = props.routing || routingOptions?.routing || 'path';\n\n if (routing === 'path') {\n if (!path) {\n return errorThrower.throw(noPathProvidedError(componentName));\n }\n\n return {\n ...routingOptions,\n ...props,\n routing: 'path',\n };\n }\n\n if (props.path) {\n return errorThrower.throw(incompatibleRoutingWithPathProvidedError(componentName));\n }\n\n return {\n ...routingOptions,\n ...props,\n path: undefined,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,mBAAkC;AAElC,IAAM,mBAAe,gCAAkB,EAAE,aAAa,eAAe,CAAC;AAS/D,SAAS,uBAAuB,SAA8B;AACnE,eAAa,YAAY,OAAO,EAAE,eAAe,OAAO;AAC1D;;;ACdA,wBAA2B;AAM3B,IAAAA,iBAAkB;;;ACNlB,mBAA8D;AAKvD,IAAM,4BAA4B;;;ACLzC,IAAAC,gBAAkD;;;ACAlD,2BAA2D;AAC3D,uBAAkC;AASlC,IAAAC,gBAA4B;;;ACV5B,IAAAC,gBAAqC;AAsB9B,IAAM,CAAC,aAAa,cAAc,QAAI,oCAAuC,aAAa;;;ACd1F,IAAM,oBACX;AA2BK,IAAM,sBAAsB,CAAC,kBAClC,QAAQ,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L,GAAG;AAAA,MACH,GAAG;AAAA,MACH,SAAS;AAAA,IACX;AAAA,EACF;AAEA,MAAI,MAAM,MAAM;AACd,WAAO,aAAa,MAAM,yCAAyC,aAAa,CAAC;AAAA,EACnF;AAEA,SAAO;AAAA,IACL,GAAG;AAAA,IACH,GAAG;AAAA,IACH,MAAM;AAAA,EACR;AACF;;;Ab7BA,+BAMO;","names":["import_react","import_react","import_react","import_react","import_react","useSharedAssertWrappedByClerkProvider","import_react","import_telemetry","import_react","import_react","import_react","React","React"]}
|
|
1
|
+
{"version":3,"sources":["../src/internal.ts","../src/errors/errorThrower.ts","../src/components/controlComponents.tsx","../src/contexts/IsomorphicClerkContext.tsx","../src/contexts/SessionContext.tsx","../src/hooks/useAuth.ts","../src/contexts/AuthContext.ts","../src/errors/messages.ts","../src/hooks/useAssertWrappedByClerkProvider.ts","../src/hooks/useEmailLink.ts","../src/hooks/useClerkSignal.ts","../src/hooks/index.ts","../src/components/withClerk.tsx","../src/hooks/useRoutingProps.ts"],"sourcesContent":["export { setErrorThrowerOptions } from './errors/errorThrower';\nexport { MultisessionAppSupport } from './components/controlComponents';\nexport { useRoutingProps } from './hooks/useRoutingProps';\nexport { useDerivedAuth } from './hooks/useAuth';\n\nexport {\n clerkJsScriptUrl,\n buildClerkJsScriptAttributes,\n clerkUiScriptUrl,\n buildClerkUiScriptAttributes,\n setClerkJsLoadingErrorPackageName,\n} from '@clerk/shared/loadClerkJsScript';\n\nexport type { Ui } from '@clerk/ui/internal';\n","import type { ErrorThrowerOptions } from '@clerk/shared/error';\nimport { buildErrorThrower } from '@clerk/shared/error';\n\nconst errorThrower = buildErrorThrower({ packageName: '@clerk/react' });\n\nexport { errorThrower };\n\n/**\n * Overrides options of the internal errorThrower (eg setting packageName prefix).\n *\n * @internal\n */\nexport function setErrorThrowerOptions(options: ErrorThrowerOptions) {\n errorThrower.setMessages(options).setPackageName(options);\n}\n","import { deprecated } from '@clerk/shared/deprecated';\nimport type { HandleOAuthCallbackParams, PendingSessionOptions, ShowWhenCondition } from '@clerk/shared/types';\nimport React from 'react';\n\nimport { useIsomorphicClerkContext } from '../contexts/IsomorphicClerkContext';\nimport { useSessionContext } from '../contexts/SessionContext';\nimport { useAuth } from '../hooks';\nimport { useAssertWrappedByClerkProvider } from '../hooks/useAssertWrappedByClerkProvider';\nimport type { RedirectToSignInProps, RedirectToSignUpProps, RedirectToTasksProps, WithClerkProp } from '../types';\nimport { withClerk } from './withClerk';\n\nexport const ClerkLoaded = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('ClerkLoaded');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n if (!isomorphicClerk.loaded) {\n return null;\n }\n return children;\n};\n\nexport const ClerkLoading = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('ClerkLoading');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n if (isomorphicClerk.status !== 'loading') {\n return null;\n }\n return children;\n};\n\nexport const ClerkFailed = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('ClerkFailed');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n if (isomorphicClerk.status !== 'error') {\n return null;\n }\n return children;\n};\n\nexport const ClerkDegraded = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('ClerkDegraded');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n if (isomorphicClerk.status !== 'degraded') {\n return null;\n }\n return children;\n};\n\nexport type ShowProps = React.PropsWithChildren<\n {\n fallback?: React.ReactNode;\n when: ShowWhenCondition;\n } & PendingSessionOptions\n>;\n\n/**\n * Use `<Show/>` to conditionally render content based on user authorization or sign-in state.\n * Returns `null` while auth is loading. Set `treatPendingAsSignedOut` to treat\n * pending sessions as signed out during that period.\n *\n * The `when` prop supports:\n * - `\"signed-in\"` or `\"signed-out\"` shorthands\n * - Authorization descriptors (e.g., `{ permission: \"org:billing:manage\" }`, `{ role: \"admin\" }`)\n * - A predicate function `(has) => boolean` that receives the `has` helper\n *\n * @example\n * ```tsx\n * <Show when={{ permission: \"org:billing:manage\" }} fallback={<p>Unauthorized</p>}>\n * <BillingSettings />\n * </Show>\n *\n * <Show when={{ role: \"admin\" }}>\n * <AdminPanel />\n * </Show>\n *\n * <Show when={(has) => has({ permission: \"org:read\" }) && isFeatureEnabled}>\n * <ProtectedFeature />\n * </Show>\n * ```\n *\n */\nexport const Show = ({ children, fallback, treatPendingAsSignedOut, when }: ShowProps) => {\n useAssertWrappedByClerkProvider('Show');\n\n const { has, isLoaded, userId } = useAuth({ treatPendingAsSignedOut });\n\n if (!isLoaded) {\n return null;\n }\n\n const resolvedWhen = when;\n const authorized = children;\n const unauthorized = fallback ?? null;\n\n if (resolvedWhen === 'signed-out') {\n return userId ? unauthorized : authorized;\n }\n\n if (!userId) {\n return unauthorized;\n }\n\n if (resolvedWhen === 'signed-in') {\n return authorized;\n }\n\n if (checkAuthorization(resolvedWhen, has)) {\n return authorized;\n }\n\n return unauthorized;\n};\n\nfunction checkAuthorization(\n when: Exclude<ShowWhenCondition, 'signed-in' | 'signed-out'>,\n has: NonNullable<ReturnType<typeof useAuth>['has']>,\n): boolean {\n if (typeof when === 'function') {\n return when(has);\n }\n return has(when);\n}\n\nexport const RedirectToSignIn = withClerk(({ clerk, ...props }: WithClerkProp<RedirectToSignInProps>) => {\n const { client, session } = clerk;\n\n const hasSignedInSessions = (client.signedInSessions?.length ?? 0) > 0;\n\n React.useEffect(() => {\n if (session === null && hasSignedInSessions) {\n void clerk.redirectToAfterSignOut();\n } else {\n void clerk.redirectToSignIn(props);\n }\n }, []);\n\n return null;\n}, 'RedirectToSignIn');\n\nexport const RedirectToSignUp = withClerk(({ clerk, ...props }: WithClerkProp<RedirectToSignUpProps>) => {\n React.useEffect(() => {\n void clerk.redirectToSignUp(props);\n }, []);\n\n return null;\n}, 'RedirectToSignUp');\n\nexport const RedirectToTasks = withClerk(({ clerk, ...props }: WithClerkProp<RedirectToTasksProps>) => {\n React.useEffect(() => {\n void clerk.redirectToTasks(props);\n }, []);\n\n return null;\n}, 'RedirectToTasks');\n\n/**\n * @function\n * @deprecated Use [`redirectToUserProfile()`](https://clerk.com/docs/reference/javascript/clerk#redirect-to-user-profile) instead.\n */\nexport const RedirectToUserProfile = withClerk(({ clerk }) => {\n React.useEffect(() => {\n deprecated('RedirectToUserProfile', 'Use the `redirectToUserProfile()` method instead.');\n void clerk.redirectToUserProfile();\n }, []);\n\n return null;\n}, 'RedirectToUserProfile');\n\n/**\n * @function\n * @deprecated Use [`redirectToOrganizationProfile()`](https://clerk.com/docs/reference/javascript/clerk#redirect-to-organization-profile) instead.\n */\nexport const RedirectToOrganizationProfile = withClerk(({ clerk }) => {\n React.useEffect(() => {\n deprecated('RedirectToOrganizationProfile', 'Use the `redirectToOrganizationProfile()` method instead.');\n void clerk.redirectToOrganizationProfile();\n }, []);\n\n return null;\n}, 'RedirectToOrganizationProfile');\n\n/**\n * @function\n * @deprecated Use [`redirectToCreateOrganization()`](https://clerk.com/docs/reference/javascript/clerk#redirect-to-create-organization) instead.\n */\nexport const RedirectToCreateOrganization = withClerk(({ clerk }) => {\n React.useEffect(() => {\n deprecated('RedirectToCreateOrganization', 'Use the `redirectToCreateOrganization()` method instead.');\n void clerk.redirectToCreateOrganization();\n }, []);\n\n return null;\n}, 'RedirectToCreateOrganization');\n\nexport const AuthenticateWithRedirectCallback = withClerk(\n ({ clerk, ...handleRedirectCallbackParams }: WithClerkProp<HandleOAuthCallbackParams>) => {\n React.useEffect(() => {\n void clerk.handleRedirectCallback(handleRedirectCallbackParams);\n }, []);\n\n return null;\n },\n 'AuthenticateWithRedirectCallback',\n);\n\nexport const MultisessionAppSupport = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('MultisessionAppSupport');\n\n const session = useSessionContext();\n return <React.Fragment key={session ? session.id : 'no-users'}>{children}</React.Fragment>;\n};\n","import { ClerkInstanceContext, useClerkInstanceContext } from '@clerk/shared/react';\n\nimport type { IsomorphicClerk } from '../isomorphicClerk';\n\nexport const IsomorphicClerkContext = ClerkInstanceContext;\nexport const useIsomorphicClerkContext = useClerkInstanceContext as unknown as () => IsomorphicClerk;\n","export { SessionContext, useSessionContext } from '@clerk/shared/react';\n","import { createCheckAuthorization, resolveAuthState } from '@clerk/shared/authorization';\nimport { eventMethodCalled } from '@clerk/shared/telemetry';\nimport type {\n CheckAuthorizationWithCustomPermissions,\n GetToken,\n JwtPayload,\n PendingSessionOptions,\n SignOut,\n UseAuthReturn,\n} from '@clerk/shared/types';\nimport { useCallback } from 'react';\n\nimport { useAuthContext } from '../contexts/AuthContext';\nimport { useIsomorphicClerkContext } from '../contexts/IsomorphicClerkContext';\nimport { errorThrower } from '../errors/errorThrower';\nimport { invalidStateError } from '../errors/messages';\nimport { useAssertWrappedByClerkProvider } from './useAssertWrappedByClerkProvider';\nimport { createGetToken, createSignOut } from './utils';\n\n/**\n * @inline\n */\ntype UseAuthOptions = Record<string, any> | PendingSessionOptions | undefined | null;\n\n/**\n * The `useAuth()` hook provides access to the current user's authentication state and methods to manage the active session.\n *\n * > [!NOTE]\n * > To access auth data server-side, see the [`Auth` object reference doc](https://clerk.com/docs/reference/backend/types/auth-object).\n *\n * <If sdk=\"nextjs\">\n * 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.\n * </If>\n *\n * @unionReturnHeadings\n * [\"Initialization\", \"Signed out\", \"Signed in (no active organization)\", \"Signed in (with active organization)\"]\n *\n * @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`.\n *\n * @function\n *\n * @example\n *\n * 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.\n *\n * <Tabs items='React,Next.js'>\n * <Tab>\n *\n * ```tsx {{ filename: 'src/pages/ExternalDataPage.tsx' }}\n * import { useAuth } from '@clerk/react'\n *\n * export default function ExternalDataPage() {\n * const { userId, sessionId, getToken, isLoaded, isSignedIn } = useAuth()\n *\n * const fetchExternalData = async () => {\n * const token = await getToken()\n *\n * // Fetch data from an external API\n * const response = await fetch('https://api.example.com/data', {\n * headers: {\n * Authorization: `Bearer ${token}`,\n * },\n * })\n *\n * return response.json()\n * }\n *\n * if (!isLoaded) {\n * return <div>Loading...</div>\n * }\n *\n * if (!isSignedIn) {\n * return <div>Sign in to view this page</div>\n * }\n *\n * return (\n * <div>\n * <p>\n * Hello, {userId}! Your current active session is {sessionId}.\n * </p>\n * <button onClick={fetchExternalData}>Fetch Data</button>\n * </div>\n * )\n * }\n * ```\n *\n * </Tab>\n * <Tab>\n *\n * {@include ../../docs/use-auth.md#nextjs-01}\n *\n * </Tab>\n * </Tabs>\n */\nexport const useAuth = (initialAuthStateOrOptions: UseAuthOptions = {}): UseAuthReturn => {\n useAssertWrappedByClerkProvider('useAuth');\n\n const { treatPendingAsSignedOut, ...rest } = initialAuthStateOrOptions ?? {};\n const initialAuthState = rest as any;\n\n const authContextFromHook = useAuthContext();\n let authContext = authContextFromHook;\n\n if (authContext.sessionId === undefined && authContext.userId === undefined) {\n authContext = initialAuthState != null ? initialAuthState : {};\n }\n\n const isomorphicClerk = useIsomorphicClerkContext();\n const getToken: GetToken = useCallback(createGetToken(isomorphicClerk), [isomorphicClerk]);\n const signOut: SignOut = useCallback(createSignOut(isomorphicClerk), [isomorphicClerk]);\n\n isomorphicClerk.telemetry?.record(eventMethodCalled('useAuth', { treatPendingAsSignedOut }));\n\n return useDerivedAuth(\n {\n ...authContext,\n getToken,\n signOut,\n },\n {\n treatPendingAsSignedOut,\n },\n );\n};\n\n/**\n * A hook that derives and returns authentication state and utility functions based on the provided auth object.\n *\n * @param authObject - An object containing authentication-related properties and functions.\n *\n * @returns A derived authentication state with helper methods. If the authentication state is invalid, an error is thrown.\n *\n * @remarks\n * This hook inspects session, user, and organization information to determine the current authentication state.\n * It returns an object that includes various properties such as whether the state is loaded, if a user is signed in,\n * session and user identifiers, Organization Roles, and a `has` function for authorization checks.\n * Additionally, it provides `signOut` and `getToken` functions if applicable.\n *\n * @example\n * ```tsx\n * const {\n * isLoaded,\n * isSignedIn,\n * userId,\n * orgId,\n * has,\n * signOut,\n * getToken\n * } = useDerivedAuth(authObject);\n * ```\n */\nexport function useDerivedAuth(\n authObject: any,\n { treatPendingAsSignedOut = true }: PendingSessionOptions = {},\n): UseAuthReturn {\n const { userId, orgId, orgRole, has, signOut, getToken, orgPermissions, factorVerificationAge, sessionClaims } =\n authObject ?? {};\n\n const derivedHas = useCallback(\n (params: Parameters<CheckAuthorizationWithCustomPermissions>[0]) => {\n if (has) {\n return has(params);\n }\n return createCheckAuthorization({\n userId,\n orgId,\n orgRole,\n orgPermissions,\n factorVerificationAge,\n features: ((sessionClaims as JwtPayload | undefined)?.fea as string) || '',\n plans: ((sessionClaims as JwtPayload | undefined)?.pla as string) || '',\n })(params);\n },\n [has, userId, orgId, orgRole, orgPermissions, factorVerificationAge, sessionClaims],\n );\n\n const payload = resolveAuthState({\n authObject: {\n ...authObject,\n getToken,\n signOut,\n has: derivedHas,\n },\n options: {\n treatPendingAsSignedOut,\n },\n });\n\n if (!payload) {\n return errorThrower.throw(invalidStateError);\n }\n\n return payload;\n}\n","import { createContextAndHook } from '@clerk/shared/react';\nimport type {\n ActClaim,\n JwtPayload,\n OrganizationCustomPermissionKey,\n OrganizationCustomRoleKey,\n SessionStatusClaim,\n} from '@clerk/shared/types';\n\nexport type AuthContextValue = {\n userId: string | null | undefined;\n sessionId: string | null | undefined;\n sessionStatus: SessionStatusClaim | null | undefined;\n sessionClaims: JwtPayload | null | undefined;\n actor: ActClaim | null | undefined;\n orgId: string | null | undefined;\n orgRole: OrganizationCustomRoleKey | null | undefined;\n orgSlug: string | null | undefined;\n orgPermissions: OrganizationCustomPermissionKey[] | null | undefined;\n factorVerificationAge: [number, number] | null;\n};\n\nexport const [AuthContext, useAuthContext] = createContextAndHook<AuthContextValue>('AuthContext');\n","export const noClerkProviderError = 'You must wrap your application in a <ClerkProvider> component.';\n\nexport const multipleClerkProvidersError =\n \"You've added multiple <ClerkProvider> components in your React component tree. Wrap your components in a single <ClerkProvider>.\";\n\nexport const multipleChildrenInButtonComponent = (name: string) =>\n `You've passed multiple children components to <${name}/>. You can only pass a single child component or text.`;\n\nexport const invalidStateError =\n 'Invalid state. Feel free to submit a bug or reach out to support here: https://clerk.com/support';\n\nexport const unsupportedNonBrowserDomainOrProxyUrlFunction =\n 'Unsupported usage of isSatellite, domain or proxyUrl. The usage of isSatellite, domain or proxyUrl as function is not supported in non-browser environments.';\n\nexport const userProfilePageRenderedError =\n '<UserProfile.Page /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.';\nexport const userProfileLinkRenderedError =\n '<UserProfile.Link /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.';\n\nexport const organizationProfilePageRenderedError =\n '<OrganizationProfile.Page /> component needs to be a direct child of `<OrganizationProfile />` or `<OrganizationSwitcher />`.';\nexport const organizationProfileLinkRenderedError =\n '<OrganizationProfile.Link /> component needs to be a direct child of `<OrganizationProfile />` or `<OrganizationSwitcher />`.';\n\nexport const customPagesIgnoredComponent = (componentName: string) =>\n `<${componentName} /> can only accept <${componentName}.Page /> and <${componentName}.Link /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.`;\n\nexport const customPageWrongProps = (componentName: string) =>\n `Missing props. <${componentName}.Page /> component requires the following props: url, label, labelIcon, alongside with children to be rendered inside the page.`;\n\nexport const customLinkWrongProps = (componentName: string) =>\n `Missing props. <${componentName}.Link /> component requires the following props: url, label and labelIcon.`;\n\nexport const useAuthHasRequiresRoleOrPermission =\n 'Missing parameters. `has` from `useAuth` requires a permission or role key to be passed. Example usage: `has({permission: \"org:posts:edit\"`';\n\nexport const noPathProvidedError = (componentName: string) =>\n `The <${componentName}/> component uses path-based routing by default unless a different routing strategy is provided using the \\`routing\\` prop. When path-based routing is used, you need to provide the path where the component is mounted on by using the \\`path\\` prop. Example: <${componentName} path={'/my-path'} />`;\n\nexport const incompatibleRoutingWithPathProvidedError = (componentName: string) =>\n `The \\`path\\` prop will only be respected when the Clerk component uses path-based routing. To resolve this error, pass \\`routing='path'\\` to the <${componentName}/> component, or drop the \\`path\\` prop to switch to hash-based routing. For more details please refer to our docs: https://clerk.com/docs`;\n\nexport const userButtonIgnoredComponent = `<UserButton /> can only accept <UserButton.UserProfilePage />, <UserButton.UserProfileLink /> and <UserButton.MenuItems /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.`;\n\nexport const customMenuItemsIgnoredComponent =\n '<UserButton.MenuItems /> component can only accept <UserButton.Action /> and <UserButton.Link /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.';\n\nexport const userButtonMenuItemsRenderedError =\n '<UserButton.MenuItems /> component needs to be a direct child of `<UserButton />`.';\n\nexport const userButtonMenuActionRenderedError =\n '<UserButton.Action /> component needs to be a direct child of `<UserButton.MenuItems />`.';\n\nexport const userButtonMenuLinkRenderedError =\n '<UserButton.Link /> component needs to be a direct child of `<UserButton.MenuItems />`.';\n\nexport const userButtonMenuItemLinkWrongProps =\n 'Missing props. <UserButton.Link /> component requires the following props: href, label and labelIcon.';\n\nexport const userButtonMenuItemsActionWrongsProps =\n 'Missing props. <UserButton.Action /> component requires the following props: label.';\n","import { useAssertWrappedByClerkProvider as useSharedAssertWrappedByClerkProvider } from '@clerk/shared/react';\n\nimport { errorThrower } from '../errors/errorThrower';\n\nexport const useAssertWrappedByClerkProvider = (source: string): void => {\n useSharedAssertWrappedByClerkProvider(() => {\n errorThrower.throwMissingClerkProviderError({ source });\n });\n};\n","import type {\n CreateEmailLinkFlowReturn,\n EmailAddressResource,\n SignInResource,\n SignInStartEmailLinkFlowParams,\n SignUpResource,\n StartEmailLinkFlowParams,\n} from '@clerk/shared/types';\nimport React from 'react';\n\ntype EmailLinkable = SignUpResource | EmailAddressResource | SignInResource;\ntype UseEmailLinkSignInReturn = CreateEmailLinkFlowReturn<SignInStartEmailLinkFlowParams, SignInResource>;\ntype UseEmailLinkSignUpReturn = CreateEmailLinkFlowReturn<StartEmailLinkFlowParams, SignUpResource>;\ntype UseEmailLinkEmailAddressReturn = CreateEmailLinkFlowReturn<StartEmailLinkFlowParams, EmailAddressResource>;\n\nfunction useEmailLink(resource: SignInResource): UseEmailLinkSignInReturn;\nfunction useEmailLink(resource: SignUpResource): UseEmailLinkSignUpReturn;\nfunction useEmailLink(resource: EmailAddressResource): UseEmailLinkEmailAddressReturn;\nfunction useEmailLink(\n resource: EmailLinkable,\n): UseEmailLinkSignInReturn | UseEmailLinkSignUpReturn | UseEmailLinkEmailAddressReturn {\n const { startEmailLinkFlow, cancelEmailLinkFlow } = React.useMemo(() => resource.createEmailLinkFlow(), [resource]);\n\n React.useEffect(() => {\n return cancelEmailLinkFlow;\n }, []);\n\n return {\n startEmailLinkFlow,\n cancelEmailLinkFlow,\n } as UseEmailLinkSignInReturn | UseEmailLinkSignUpReturn | UseEmailLinkEmailAddressReturn;\n}\n\nexport { useEmailLink };\n","import { eventMethodCalled } from '@clerk/shared/telemetry';\nimport type { SignInSignalValue, SignUpSignalValue } from '@clerk/shared/types';\nimport { useCallback, useSyncExternalStore } from 'react';\n\nimport { useIsomorphicClerkContext } from '../contexts/IsomorphicClerkContext';\nimport { useAssertWrappedByClerkProvider } from './useAssertWrappedByClerkProvider';\n\nfunction useClerkSignal(signal: 'signIn'): SignInSignalValue;\nfunction useClerkSignal(signal: 'signUp'): SignUpSignalValue;\nfunction useClerkSignal(signal: 'signIn' | 'signUp'): SignInSignalValue | SignUpSignalValue {\n useAssertWrappedByClerkProvider('useClerkSignal');\n\n const clerk = useIsomorphicClerkContext();\n\n switch (signal) {\n case 'signIn':\n clerk.telemetry?.record(eventMethodCalled('useSignIn', { apiVersion: '2025-11' }));\n break;\n case 'signUp':\n clerk.telemetry?.record(eventMethodCalled('useSignUp', { apiVersion: '2025-11' }));\n break;\n default:\n break;\n }\n\n const subscribe = useCallback(\n (callback: () => void) => {\n if (!clerk.loaded) {\n return () => {};\n }\n\n return clerk.__internal_state.__internal_effect(() => {\n switch (signal) {\n case 'signIn':\n clerk.__internal_state.signInSignal();\n break;\n case 'signUp':\n clerk.__internal_state.signUpSignal();\n break;\n default:\n throw new Error(`Unknown signal: ${signal}`);\n }\n callback();\n });\n },\n [clerk, clerk.loaded, clerk.__internal_state],\n );\n const getSnapshot = useCallback(() => {\n switch (signal) {\n case 'signIn':\n return clerk.__internal_state.signInSignal() as SignInSignalValue;\n case 'signUp':\n return clerk.__internal_state.signUpSignal() as SignUpSignalValue;\n default:\n throw new Error(`Unknown signal: ${signal}`);\n }\n }, [clerk.__internal_state]);\n\n const value = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);\n\n return value;\n}\n\n/**\n * This hook allows you to access the Signal-based `SignIn` resource.\n *\n * @example\n * import { useSignInSignal } from \"@clerk/react/experimental\";\n *\n * function SignInForm() {\n * const { signIn, errors, fetchStatus } = useSignInSignal();\n * //\n * }\n *\n * @experimental This experimental API is subject to change.\n */\nexport function useSignIn() {\n return useClerkSignal('signIn');\n}\n\n/**\n * This hook allows you to access the Signal-based `SignUp` resource.\n *\n * @example\n * import { useSignUpSignal } from \"@clerk/react/experimental\";\n *\n * function SignUpForm() {\n * const { signUp, errors, fetchStatus } = useSignUpSignal();\n * //\n * }\n *\n * @experimental This experimental API is subject to change.\n */\nexport function useSignUp() {\n return useClerkSignal('signUp');\n}\n","export { useAuth } from './useAuth';\nexport { useEmailLink } from './useEmailLink';\nexport { useSignIn, useSignUp } from './useClerkSignal';\nexport {\n useClerk,\n useOrganization,\n useOrganizationList,\n useSessionList,\n useUser,\n useSession,\n useReverification,\n __experimental_useCheckout,\n __experimental_CheckoutProvider,\n __experimental_usePaymentElement,\n __experimental_PaymentElementProvider,\n __experimental_PaymentElement,\n} from '@clerk/shared/react';\n","import type { LoadedClerk, Without } from '@clerk/shared/types';\nimport React from 'react';\n\nimport { useIsomorphicClerkContext } from '../contexts/IsomorphicClerkContext';\nimport { useAssertWrappedByClerkProvider } from '../hooks/useAssertWrappedByClerkProvider';\n\nexport const withClerk = <P extends { clerk: LoadedClerk; component?: string }>(\n Component: React.ComponentType<P>,\n displayNameOrOptions?: string | { component: string; renderWhileLoading?: boolean },\n) => {\n const passedDisplayedName =\n typeof displayNameOrOptions === 'string' ? displayNameOrOptions : displayNameOrOptions?.component;\n const displayName = passedDisplayedName || Component.displayName || Component.name || 'Component';\n Component.displayName = displayName;\n\n const options = typeof displayNameOrOptions === 'string' ? undefined : displayNameOrOptions;\n\n const HOC = (props: Without<P, 'clerk'>) => {\n useAssertWrappedByClerkProvider(displayName || 'withClerk');\n\n const clerk = useIsomorphicClerkContext();\n\n if (!clerk.loaded && !options?.renderWhileLoading) {\n return null;\n }\n\n return (\n <Component\n {...(props as P)}\n component={displayName}\n clerk={clerk}\n />\n );\n };\n HOC.displayName = `withClerk(${displayName})`;\n return HOC;\n};\n","import type { RoutingOptions } from '@clerk/shared/types';\n\nimport { errorThrower } from '../errors/errorThrower';\nimport { incompatibleRoutingWithPathProvidedError, noPathProvidedError } from '../errors/messages';\n\nexport function useRoutingProps<T extends RoutingOptions>(\n componentName: string,\n props: T,\n routingOptions?: RoutingOptions,\n): T {\n const path = props.path || routingOptions?.path;\n const routing = props.routing || routingOptions?.routing || 'path';\n\n if (routing === 'path') {\n if (!path) {\n return errorThrower.throw(noPathProvidedError(componentName));\n }\n\n return {\n ...routingOptions,\n ...props,\n routing: 'path',\n };\n }\n\n if (props.path) {\n return errorThrower.throw(incompatibleRoutingWithPathProvidedError(componentName));\n }\n\n return {\n ...routingOptions,\n ...props,\n path: undefined,\n };\n}\n"],"mappings":";;;;;;;;;;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;AACpB,WAAK,MAAM,uBAAuB,4BAA4B;AAAA,IAChE,GAAG,CAAC,CAAC;AAEL,WAAO;AAAA,EACT;AAAA,EACA;AACF;AAEO,IAAM,yBAAyB,CAAC,EAAE,SAAS,MAAwC;AACxF,kCAAgC,wBAAwB;AAExD,QAAM,cAAU,iCAAkB;AAClC,SAAO,+BAAAA,QAAA,cAAC,eAAAA,QAAM,UAAN,EAAe,KAAK,UAAU,QAAQ,KAAK,cAAa,QAAS;AAC3E;;;AWhNO,SAAS,gBACd,eACA,OACA,gBACG;AACH,QAAM,OAAO,MAAM,SAAQ,iDAAgB;AAC3C,QAAM,UAAU,MAAM,YAAW,iDAAgB,YAAW;AAE5D,MAAI,YAAY,QAAQ;AACtB,QAAI,CAAC,MAAM;AACT,aAAO,aAAa,MAAM,oBAAoB,aAAa,CAAC;AAAA,IAC9D;AAEA,WAAO;AAAA,MACL,GAAG;AAAA,MACH,GAAG;AAAA,MACH,SAAS;AAAA,IACX;AAAA,EACF;AAEA,MAAI,MAAM,MAAM;AACd,WAAO,aAAa,MAAM,yCAAyC,aAAa,CAAC;AAAA,EACnF;AAEA,SAAO;AAAA,IACL,GAAG;AAAA,IACH,GAAG;AAAA,IACH,MAAM;AAAA,EACR;AACF;;;Ab7BA,+BAMO;","names":["import_react","import_react","import_react","import_react","import_react","useSharedAssertWrappedByClerkProvider","import_react","import_telemetry","import_react","import_react","import_react","React","React"]}
|
package/dist/internal.mjs
CHANGED
|
@@ -1,30 +1,43 @@
|
|
|
1
1
|
import * as _clerk_shared_types from '@clerk/shared/types';
|
|
2
|
-
import { HandleOAuthCallbackParams,
|
|
2
|
+
import { HandleOAuthCallbackParams, ShowWhenCondition, PendingSessionOptions, UseAuthReturn } from '@clerk/shared/types';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { W as WithClerkProp } from './types-BLjriGSN.mjs';
|
|
5
5
|
|
|
6
|
-
declare const SignedIn: ({ children, treatPendingAsSignedOut }: React.PropsWithChildren<PendingSessionOptions>) => React.ReactNode;
|
|
7
|
-
declare const SignedOut: ({ children, treatPendingAsSignedOut }: React.PropsWithChildren<PendingSessionOptions>) => React.ReactNode;
|
|
8
6
|
declare const ClerkLoaded: ({ children }: React.PropsWithChildren<unknown>) => React.ReactNode;
|
|
9
7
|
declare const ClerkLoading: ({ children }: React.PropsWithChildren<unknown>) => React.ReactNode;
|
|
10
8
|
declare const ClerkFailed: ({ children }: React.PropsWithChildren<unknown>) => React.ReactNode;
|
|
11
9
|
declare const ClerkDegraded: ({ children }: React.PropsWithChildren<unknown>) => React.ReactNode;
|
|
12
|
-
type
|
|
10
|
+
type ShowProps = React.PropsWithChildren<{
|
|
13
11
|
fallback?: React.ReactNode;
|
|
12
|
+
when: ShowWhenCondition;
|
|
14
13
|
} & PendingSessionOptions>;
|
|
15
14
|
/**
|
|
16
|
-
* Use `<
|
|
15
|
+
* Use `<Show/>` to conditionally render content based on user authorization or sign-in state.
|
|
16
|
+
* Returns `null` while auth is loading. Set `treatPendingAsSignedOut` to treat
|
|
17
|
+
* pending sessions as signed out during that period.
|
|
17
18
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
19
|
+
* The `when` prop supports:
|
|
20
|
+
* - `"signed-in"` or `"signed-out"` shorthands
|
|
21
|
+
* - Authorization descriptors (e.g., `{ permission: "org:billing:manage" }`, `{ role: "admin" }`)
|
|
22
|
+
* - A predicate function `(has) => boolean` that receives the `has` helper
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <Show when={{ permission: "org:billing:manage" }} fallback={<p>Unauthorized</p>}>
|
|
27
|
+
* <BillingSettings />
|
|
28
|
+
* </Show>
|
|
29
|
+
*
|
|
30
|
+
* <Show when={{ role: "admin" }}>
|
|
31
|
+
* <AdminPanel />
|
|
32
|
+
* </Show>
|
|
33
|
+
*
|
|
34
|
+
* <Show when={(has) => has({ permission: "org:read" }) && isFeatureEnabled}>
|
|
35
|
+
* <ProtectedFeature />
|
|
36
|
+
* </Show>
|
|
25
37
|
* ```
|
|
38
|
+
*
|
|
26
39
|
*/
|
|
27
|
-
declare const
|
|
40
|
+
declare const Show: ({ children, fallback, treatPendingAsSignedOut, when }: ShowProps) => React.ReactNode;
|
|
28
41
|
declare const RedirectToSignIn: {
|
|
29
42
|
(props: _clerk_shared_types.Without<WithClerkProp<_clerk_shared_types.SignInRedirectOptions>, "clerk">): React.JSX.Element | null;
|
|
30
43
|
displayName: string;
|
|
@@ -179,4 +192,4 @@ declare const useAuth: (initialAuthStateOrOptions?: UseAuthOptions) => UseAuthRe
|
|
|
179
192
|
*/
|
|
180
193
|
declare function useDerivedAuth(authObject: any, { treatPendingAsSignedOut }?: PendingSessionOptions): UseAuthReturn;
|
|
181
194
|
|
|
182
|
-
export { AuthenticateWithRedirectCallback as A, ClerkDegraded as C, MultisessionAppSupport as M,
|
|
195
|
+
export { AuthenticateWithRedirectCallback as A, ClerkDegraded as C, MultisessionAppSupport as M, RedirectToCreateOrganization as R, Show 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, type ShowProps as i, useAuth as j, useDerivedAuth as u };
|
|
@@ -1,30 +1,43 @@
|
|
|
1
1
|
import * as _clerk_shared_types from '@clerk/shared/types';
|
|
2
|
-
import { HandleOAuthCallbackParams,
|
|
2
|
+
import { HandleOAuthCallbackParams, ShowWhenCondition, PendingSessionOptions, UseAuthReturn } from '@clerk/shared/types';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { W as WithClerkProp } from './types-BLjriGSN.js';
|
|
5
5
|
|
|
6
|
-
declare const SignedIn: ({ children, treatPendingAsSignedOut }: React.PropsWithChildren<PendingSessionOptions>) => React.ReactNode;
|
|
7
|
-
declare const SignedOut: ({ children, treatPendingAsSignedOut }: React.PropsWithChildren<PendingSessionOptions>) => React.ReactNode;
|
|
8
6
|
declare const ClerkLoaded: ({ children }: React.PropsWithChildren<unknown>) => React.ReactNode;
|
|
9
7
|
declare const ClerkLoading: ({ children }: React.PropsWithChildren<unknown>) => React.ReactNode;
|
|
10
8
|
declare const ClerkFailed: ({ children }: React.PropsWithChildren<unknown>) => React.ReactNode;
|
|
11
9
|
declare const ClerkDegraded: ({ children }: React.PropsWithChildren<unknown>) => React.ReactNode;
|
|
12
|
-
type
|
|
10
|
+
type ShowProps = React.PropsWithChildren<{
|
|
13
11
|
fallback?: React.ReactNode;
|
|
12
|
+
when: ShowWhenCondition;
|
|
14
13
|
} & PendingSessionOptions>;
|
|
15
14
|
/**
|
|
16
|
-
* Use `<
|
|
15
|
+
* Use `<Show/>` to conditionally render content based on user authorization or sign-in state.
|
|
16
|
+
* Returns `null` while auth is loading. Set `treatPendingAsSignedOut` to treat
|
|
17
|
+
* pending sessions as signed out during that period.
|
|
17
18
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
19
|
+
* The `when` prop supports:
|
|
20
|
+
* - `"signed-in"` or `"signed-out"` shorthands
|
|
21
|
+
* - Authorization descriptors (e.g., `{ permission: "org:billing:manage" }`, `{ role: "admin" }`)
|
|
22
|
+
* - A predicate function `(has) => boolean` that receives the `has` helper
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <Show when={{ permission: "org:billing:manage" }} fallback={<p>Unauthorized</p>}>
|
|
27
|
+
* <BillingSettings />
|
|
28
|
+
* </Show>
|
|
29
|
+
*
|
|
30
|
+
* <Show when={{ role: "admin" }}>
|
|
31
|
+
* <AdminPanel />
|
|
32
|
+
* </Show>
|
|
33
|
+
*
|
|
34
|
+
* <Show when={(has) => has({ permission: "org:read" }) && isFeatureEnabled}>
|
|
35
|
+
* <ProtectedFeature />
|
|
36
|
+
* </Show>
|
|
25
37
|
* ```
|
|
38
|
+
*
|
|
26
39
|
*/
|
|
27
|
-
declare const
|
|
40
|
+
declare const Show: ({ children, fallback, treatPendingAsSignedOut, when }: ShowProps) => React.ReactNode;
|
|
28
41
|
declare const RedirectToSignIn: {
|
|
29
42
|
(props: _clerk_shared_types.Without<WithClerkProp<_clerk_shared_types.SignInRedirectOptions>, "clerk">): React.JSX.Element | null;
|
|
30
43
|
displayName: string;
|
|
@@ -179,4 +192,4 @@ declare const useAuth: (initialAuthStateOrOptions?: UseAuthOptions) => UseAuthRe
|
|
|
179
192
|
*/
|
|
180
193
|
declare function useDerivedAuth(authObject: any, { treatPendingAsSignedOut }?: PendingSessionOptions): UseAuthReturn;
|
|
181
194
|
|
|
182
|
-
export { AuthenticateWithRedirectCallback as A, ClerkDegraded as C, MultisessionAppSupport as M,
|
|
195
|
+
export { AuthenticateWithRedirectCallback as A, ClerkDegraded as C, MultisessionAppSupport as M, RedirectToCreateOrganization as R, Show 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, type ShowProps as i, useAuth as j, useDerivedAuth as u };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clerk/react",
|
|
3
|
-
"version": "6.0.0-snapshot.
|
|
3
|
+
"version": "6.0.0-snapshot.v20260105214115",
|
|
4
4
|
"description": "Clerk React library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"clerk",
|
|
@@ -81,12 +81,12 @@
|
|
|
81
81
|
],
|
|
82
82
|
"dependencies": {
|
|
83
83
|
"tslib": "2.8.1",
|
|
84
|
-
"@clerk/shared": "4.0.0-snapshot.
|
|
84
|
+
"@clerk/shared": "4.0.0-snapshot.v20260105214115"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@types/semver": "^7.7.1",
|
|
88
|
-
"@clerk/
|
|
89
|
-
"@clerk/
|
|
88
|
+
"@clerk/ui": "1.0.0-snapshot.v20260105214115",
|
|
89
|
+
"@clerk/localizations": "4.0.0-snapshot.v20260105214115"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"react": "^18.0.0 || ~19.0.3 || ~19.1.4 || ~19.2.3 || ~19.3.0-0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/controlComponents.tsx","../src/contexts/SessionContext.tsx"],"sourcesContent":["import { deprecated } from '@clerk/shared/deprecated';\nimport type {\n HandleOAuthCallbackParams,\n PendingSessionOptions,\n ProtectProps as _ProtectProps,\n} from '@clerk/shared/types';\nimport React from 'react';\n\nimport { useIsomorphicClerkContext } from '../contexts/IsomorphicClerkContext';\nimport { useSessionContext } from '../contexts/SessionContext';\nimport { useAuth } from '../hooks';\nimport { useAssertWrappedByClerkProvider } from '../hooks/useAssertWrappedByClerkProvider';\nimport type { RedirectToSignInProps, RedirectToSignUpProps, RedirectToTasksProps, WithClerkProp } from '../types';\nimport { withClerk } from './withClerk';\n\nexport const SignedIn = ({ children, treatPendingAsSignedOut }: React.PropsWithChildren<PendingSessionOptions>) => {\n useAssertWrappedByClerkProvider('SignedIn');\n\n const { userId } = useAuth({ treatPendingAsSignedOut });\n if (userId) {\n return children;\n }\n return null;\n};\n\nexport const SignedOut = ({ children, treatPendingAsSignedOut }: React.PropsWithChildren<PendingSessionOptions>) => {\n useAssertWrappedByClerkProvider('SignedOut');\n\n const { userId } = useAuth({ treatPendingAsSignedOut });\n if (userId === null) {\n return children;\n }\n return null;\n};\n\nexport const ClerkLoaded = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('ClerkLoaded');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n if (!isomorphicClerk.loaded) {\n return null;\n }\n return children;\n};\n\nexport const ClerkLoading = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('ClerkLoading');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n if (isomorphicClerk.status !== 'loading') {\n return null;\n }\n return children;\n};\n\nexport const ClerkFailed = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('ClerkFailed');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n if (isomorphicClerk.status !== 'error') {\n return null;\n }\n return children;\n};\n\nexport const ClerkDegraded = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('ClerkDegraded');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n if (isomorphicClerk.status !== 'degraded') {\n return null;\n }\n return children;\n};\n\nexport type ProtectProps = React.PropsWithChildren<\n _ProtectProps & {\n fallback?: React.ReactNode;\n } & PendingSessionOptions\n>;\n\n/**\n * Use `<Protect/>` in order to prevent unauthenticated or unauthorized users from accessing the children passed to the component.\n *\n * Examples:\n * ```\n * <Protect permission=\"a_permission_key\" />\n * <Protect role=\"a_role_key\" />\n * <Protect condition={(has) => has({permission:\"a_permission_key\"})} />\n * <Protect condition={(has) => has({role:\"a_role_key\"})} />\n * <Protect fallback={<p>Unauthorized</p>} />\n * ```\n */\nexport const Protect = ({ children, fallback, treatPendingAsSignedOut, ...restAuthorizedParams }: ProtectProps) => {\n useAssertWrappedByClerkProvider('Protect');\n\n const { isLoaded, has, userId } = useAuth({ treatPendingAsSignedOut });\n\n /**\n * Avoid flickering children or fallback while clerk is loading sessionId or userId\n */\n if (!isLoaded) {\n return null;\n }\n\n /**\n * Fallback to UI provided by user or `null` if authorization checks failed\n */\n const unauthorized = fallback ?? null;\n\n const authorized = children;\n\n if (!userId) {\n return unauthorized;\n }\n\n /**\n * Check against the results of `has` called inside the callback\n */\n if (typeof restAuthorizedParams.condition === 'function') {\n if (restAuthorizedParams.condition(has)) {\n return authorized;\n }\n return unauthorized;\n }\n\n if (\n restAuthorizedParams.role ||\n restAuthorizedParams.permission ||\n restAuthorizedParams.feature ||\n restAuthorizedParams.plan\n ) {\n if (has(restAuthorizedParams)) {\n return authorized;\n }\n return unauthorized;\n }\n\n /**\n * If neither of the authorization params are passed behave as the `<SignedIn/>`.\n * If fallback is present render that instead of rendering nothing.\n */\n return authorized;\n};\n\nexport const RedirectToSignIn = withClerk(({ clerk, ...props }: WithClerkProp<RedirectToSignInProps>) => {\n const { client, session } = clerk;\n\n const hasSignedInSessions = (client.signedInSessions?.length ?? 0) > 0;\n\n React.useEffect(() => {\n if (session === null && hasSignedInSessions) {\n void clerk.redirectToAfterSignOut();\n } else {\n void clerk.redirectToSignIn(props);\n }\n }, []);\n\n return null;\n}, 'RedirectToSignIn');\n\nexport const RedirectToSignUp = withClerk(({ clerk, ...props }: WithClerkProp<RedirectToSignUpProps>) => {\n React.useEffect(() => {\n void clerk.redirectToSignUp(props);\n }, []);\n\n return null;\n}, 'RedirectToSignUp');\n\nexport const RedirectToTasks = withClerk(({ clerk, ...props }: WithClerkProp<RedirectToTasksProps>) => {\n React.useEffect(() => {\n void clerk.redirectToTasks(props);\n }, []);\n\n return null;\n}, 'RedirectToTasks');\n\n/**\n * @function\n * @deprecated Use [`redirectToUserProfile()`](https://clerk.com/docs/reference/javascript/clerk#redirect-to-user-profile) instead.\n */\nexport const RedirectToUserProfile = withClerk(({ clerk }) => {\n React.useEffect(() => {\n deprecated('RedirectToUserProfile', 'Use the `redirectToUserProfile()` method instead.');\n void clerk.redirectToUserProfile();\n }, []);\n\n return null;\n}, 'RedirectToUserProfile');\n\n/**\n * @function\n * @deprecated Use [`redirectToOrganizationProfile()`](https://clerk.com/docs/reference/javascript/clerk#redirect-to-organization-profile) instead.\n */\nexport const RedirectToOrganizationProfile = withClerk(({ clerk }) => {\n React.useEffect(() => {\n deprecated('RedirectToOrganizationProfile', 'Use the `redirectToOrganizationProfile()` method instead.');\n void clerk.redirectToOrganizationProfile();\n }, []);\n\n return null;\n}, 'RedirectToOrganizationProfile');\n\n/**\n * @function\n * @deprecated Use [`redirectToCreateOrganization()`](https://clerk.com/docs/reference/javascript/clerk#redirect-to-create-organization) instead.\n */\nexport const RedirectToCreateOrganization = withClerk(({ clerk }) => {\n React.useEffect(() => {\n deprecated('RedirectToCreateOrganization', 'Use the `redirectToCreateOrganization()` method instead.');\n void clerk.redirectToCreateOrganization();\n }, []);\n\n return null;\n}, 'RedirectToCreateOrganization');\n\nexport const AuthenticateWithRedirectCallback = withClerk(\n ({ clerk, ...handleRedirectCallbackParams }: WithClerkProp<HandleOAuthCallbackParams>) => {\n React.useEffect(() => {\n void clerk.handleRedirectCallback(handleRedirectCallbackParams);\n }, []);\n\n return null;\n },\n 'AuthenticateWithRedirectCallback',\n);\n\nexport const MultisessionAppSupport = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('MultisessionAppSupport');\n\n const session = useSessionContext();\n return <React.Fragment key={session ? session.id : 'no-users'}>{children}</React.Fragment>;\n};\n","export { SessionContext, useSessionContext } from '@clerk/shared/react';\n"],"mappings":";;;;;;;;;;AAAA,SAAS,kBAAkB;AAM3B,OAAO,WAAW;;;ACNlB,SAAS,gBAAgB,yBAAyB;;;ADe3C,IAAM,WAAW,CAAC,EAAE,UAAU,wBAAwB,MAAsD;AACjH,kCAAgC,UAAU;AAE1C,QAAM,EAAE,OAAO,IAAI,QAAQ,EAAE,wBAAwB,CAAC;AACtD,MAAI,QAAQ;AACV,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEO,IAAM,YAAY,CAAC,EAAE,UAAU,wBAAwB,MAAsD;AAClH,kCAAgC,WAAW;AAE3C,QAAM,EAAE,OAAO,IAAI,QAAQ,EAAE,wBAAwB,CAAC;AACtD,MAAI,WAAW,MAAM;AACnB,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEO,IAAM,cAAc,CAAC,EAAE,SAAS,MAAwC;AAC7E,kCAAgC,aAAa;AAE7C,QAAM,kBAAkB,0BAA0B;AAClD,MAAI,CAAC,gBAAgB,QAAQ;AAC3B,WAAO;AAAA,EAC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