Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/strong-bars-learn.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
---
'@clerk/chrome-extension': patch
'@clerk/elements': patch
'@clerk/clerk-expo': patch
'@clerk/nextjs': patch
'@clerk/react-router': patch
'@clerk/tanstack-react-start': patch
---

Use new `@clerk/react` package.
5 changes: 5 additions & 0 deletions .changeset/tame-suits-try.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
'@clerk/react': major
---

Change package name to `@clerk/react`.
20 changes: 16 additions & 4 deletions .cursor/rules/monorepo.mdc
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
---
description:
globs:
description:
globs:
alwaysApply: true
---

Monorepo Architecture and Structure

Repository Overview

- This is the official Clerk JavaScript SDK monorepo containing all Clerk authentication packages
- Clerk provides streamlined user experiences for sign up, sign in, and profile management
- All packages are published under the @clerk namespace on npm
- Uses pnpm as the package manager with Turbo for build orchestration
- Supports multiple JavaScript frameworks and environments

Core Package Categories

- **Core SDK**: `@clerk/clerk-js` - Core browser SDK with UI components
- **Framework Integrations**: Next.js, React, Vue, Astro, Nuxt, Remix, Express, Fastify
- **Platform Support**: Expo (React Native), Chrome Extension
Expand All@@ -23,6 +26,7 @@ Core Package Categories
- **Specialized**: `@clerk/agent-toolkit` - AI agent integration tools

Directory Structure

- `packages/` - All publishable packages
- `integration/` - End-to-end tests and integration templates
- `playground/` - Development and testing applications
Expand All@@ -31,6 +35,7 @@ Directory Structure
- `tools/` - Internal development tools

Development Workflow

- Use `pnpm dev` to start development mode for all packages
- Use `pnpm build` to build all packages
- Use `pnpm test` to run unit tests across all packages
Expand All@@ -39,8 +44,9 @@ Development Workflow
- Changesets for version management and release automation

Framework-Specific Packages

- `@clerk/nextjs` - Next.js App Router and Pages Router support
- `@clerk/clerk-react` - React hooks and components
- `@clerk/react` - React hooks and components
- `@clerk/vue` - Vue.js composables and components
- `@clerk/astro` - Astro integration with SSR support
- `@clerk/nuxt` - Nuxt.js module
Expand All@@ -50,6 +56,7 @@ Framework-Specific Packages
- `@clerk/expo` - React Native/Expo SDK

Testing Architecture

- Unit tests with Jest and Vitest
- Integration tests with Playwright
- Component testing with React Testing Library
Expand All@@ -58,6 +65,7 @@ Testing Architecture
- Separate test configurations per framework

Build System

- Turbo for monorepo orchestration and caching
- tsup for TypeScript compilation and bundling
- ESLint with custom configurations for different package types
Expand All@@ -66,26 +74,30 @@ Build System
- Type checking with TypeScript and publint

Environment Configuration
- Supports multiple Clerk environment variables (CLERK_*, NEXT_PUBLIC_CLERK_*, etc.)

- Supports multiple Clerk environment variables (CLERK*\*, NEXT_PUBLIC_CLERK*\*, etc.)
- Development, staging, and production configurations
- Verdaccio for local npm registry testing
- Docker support for integration testing
- CI/CD with GitHub Actions

Localization Support

- `packages/localizations/` contains translations for 30+ languages
- Modular localization system allowing partial imports
- Support for RTL languages
- Framework-agnostic translation utilities

Package Interdependency Rules

- `@clerk/shared` is a common dependency for most packages
- `@clerk/types` provides TypeScript definitions used across packages
- `@clerk/backend` is independent and used for server-side operations
- Framework packages depend on `@clerk/clerk-js` for core functionality
- Integration packages build upon framework-specific packages

Release Management

- Automated releases with Changesets
- Semantic versioning across all packages
- Canary and snapshot releases for testing
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -209,7 +209,7 @@ jobs:
matrix:
include:
- node-version: 20
test-filter: '--filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@clerk/nextjs --filter=@clerk/clerk-react --filter=@clerk/shared --filter=@clerk/remix --filter=@clerk/tanstack-react-start --filter=@clerk/elements --filter=@clerk/vue --filter=@clerk/nuxt --filter=@clerk/clerk-expo'
test-filter: '--filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@clerk/nextjs --filter=@clerk/react --filter=@clerk/shared --filter=@clerk/remix --filter=@clerk/tanstack-react-start --filter=@clerk/elements --filter=@clerk/vue --filter=@clerk/nuxt --filter=@clerk/clerk-expo'
- node-version: 22
test-filter: '**'

Expand Down
48 changes: 24 additions & 24 deletions .typedoc/__tests__/__snapshots__/file-structure.test.ts.snap
Original file line numberDiff line numberDiff line change
Expand Up@@ -199,6 +199,30 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = `
"shared/use-user.mdx",
"shared/user-agent-is-robot.mdx",
"shared/version-selector.mdx",
"react/api-keys.mdx",
"react/checkout-button-props.mdx",
"react/checkout-button.mdx",
"react/clerk-provider-props.mdx",
"react/plan-details-button-props.mdx",
"react/plan-details-button.mdx",
"react/protect.mdx",
"react/redirect-to-create-organization.mdx",
"react/redirect-to-organization-profile.mdx",
"react/redirect-to-user-profile.mdx",
"react/subscription-details-button-props.mdx",
"react/subscription-details-button.mdx",
"react/use-auth.mdx",
"react/use-clerk.mdx",
"react/use-organization-list.mdx",
"react/use-organization.mdx",
"react/use-reverification.mdx",
"react/use-session-list.mdx",
"react/use-session.mdx",
"react/use-sign-in-signal.mdx",
"react/use-sign-in.mdx",
"react/use-sign-up-signal.mdx",
"react/use-sign-up.mdx",
"react/use-user.mdx",
"nextjs/auth.mdx",
"nextjs/build-clerk-props.mdx",
"nextjs/clerk-middleware-auth-object.mdx",
Expand All@@ -208,30 +232,6 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = `
"nextjs/create-sync-get-auth.mdx",
"nextjs/current-user.mdx",
"nextjs/get-auth.mdx",
"clerk-react/api-keys.mdx",
"clerk-react/checkout-button-props.mdx",
"clerk-react/checkout-button.mdx",
"clerk-react/clerk-provider-props.mdx",
"clerk-react/plan-details-button-props.mdx",
"clerk-react/plan-details-button.mdx",
"clerk-react/protect.mdx",
"clerk-react/redirect-to-create-organization.mdx",
"clerk-react/redirect-to-organization-profile.mdx",
"clerk-react/redirect-to-user-profile.mdx",
"clerk-react/subscription-details-button-props.mdx",
"clerk-react/subscription-details-button.mdx",
"clerk-react/use-auth.mdx",
"clerk-react/use-clerk.mdx",
"clerk-react/use-organization-list.mdx",
"clerk-react/use-organization.mdx",
"clerk-react/use-reverification.mdx",
"clerk-react/use-session-list.mdx",
"clerk-react/use-session.mdx",
"clerk-react/use-sign-in-signal.mdx",
"clerk-react/use-sign-in.mdx",
"clerk-react/use-sign-up-signal.mdx",
"clerk-react/use-sign-up.mdx",
"clerk-react/use-user.mdx",
"backend/allowlist-identifier.mdx",
"backend/auth-object.mdx",
"backend/authenticate-request-options.mdx",
Expand Down
2 changes: 1 addition & 1 deletion .typedoc/__tests__/file-structure.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,8 +33,8 @@ describe('Typedoc output', () => {
expect(folders).toMatchInlineSnapshot(`
[
"backend",
"clerk-react",
"nextjs",
"react",
"shared",
"types",
]
Expand Down
6 changes: 3 additions & 3 deletions docs/CONTRIBUTING.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,7 +44,7 @@ All packages of the monorepo are inside [packages](../packages). For package spe

- [`@clerk/backend`](../packages/backend): Functionalities regarded as "core" for Clerk to operate with. _Authentication resolution, API Resources etc._
- [`@clerk/clerk-js`](../packages/clerk-js): Core JavaScript implementation used by Clerk in the browser.
- [`@clerk/clerk-react`](../packages/react) Clerk package for React applications.
- [`@clerk/react`](../packages/react) Clerk package for React applications.
- [`@clerk/types`](../packages/types): Main TypeScript typings for Clerk libraries.
- Browse [packages](../packages) to see more

Expand DownExpand Up@@ -186,10 +186,10 @@ To review your changes locally, you can run `pnpm run typedoc:generate` to gener

Create a PR that includes your changes to any Typedoc comments. Once the PR has been merged and a release is published, a PR will [automatically](https://github.com/clerk/clerk-docs/blob/main/.github/workflows/typedoc.yml) be opened in `clerk-docs` to merge in the Typedoc changes.

Typedoc output is embedded in `clerk-docs` files with the `<Typedoc />` component. For example, if you updated Typedoc comments for the `useAuth()` hook in `clerk/javascript`, you'll need to make sure that in `clerk-docs`, in the `/hooks/use-auth.mdx` file, there's a `<Typedoc />` component linked to the `./clerk-typedoc/clerk-react/use-auth.mdx` file, like:
Typedoc output is embedded in `clerk-docs` files with the `<Typedoc />` component. For example, if you updated Typedoc comments for the `useAuth()` hook in `clerk/javascript`, you'll need to make sure that in `clerk-docs`, in the `/hooks/use-auth.mdx` file, there's a `<Typedoc />` component linked to the `./clerk-typedoc/react/use-auth.mdx` file, like:

```mdx
<Typedoc src='clerk-react/use-auth' />
<Typedoc src='react/use-auth' />
```

Read more about this in the [`clerk-docs` CONTRIBUTING.md](https://github.com/clerk/clerk-docs/blob/main/CONTRIBUTING.md#typedoc-).
Expand Down
2 changes: 1 addition & 1 deletion integration/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -364,7 +364,7 @@ Assuming you have a `react-parcel` template defined in `integration/templates`,
.setName('react-parcel')
.useTemplate(templates['react-parcel'])
.setEnvFormatter('public', key => `${key}`)
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || clerkReactLocal);
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || clerkReactLocal);
```

Here's what each thing is doing:
Expand Down
2 changes: 1 addition & 1 deletion integration/presets/custom-flows.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,7 @@ const reactVite = applicationConfig()
.addScript('dev', 'pnpm dev')
.addScript('build', 'pnpm build')
.addScript('serve', 'pnpm preview')
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/themes', constants.E2E_CLERK_VERSION || linkPackage('themes'));

export const customFlows = {
Expand Down
2 changes: 1 addition & 1 deletion integration/presets/react.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,7 @@ const cra = applicationConfig()
.addScript('dev', 'pnpm start')
.addScript('build', 'pnpm build')
.addScript('serve', 'pnpm start')
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/themes', constants.E2E_CLERK_VERSION || linkPackage('themes'));

const vite = cra
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { BrowserRouter, Route, Routes } from 'react-router';
import './index.css';
import { ClerkProvider } from '@clerk/clerk-react';
import { ClerkProvider } from '@clerk/react';
import { Home } from './routes/Home';
import { SignIn } from './routes/SignIn';
import { SignUp } from './routes/SignUp';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { useUser } from '@clerk/clerk-react';
import { useUser } from '@clerk/react';

export function Protected() {
const { user, isLoaded } = useUser();
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,8 +5,8 @@ import { Button } from '@/components/ui/button';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { useUser } from '@clerk/clerk-react';
import { useSignInSignal } from '@clerk/clerk-react/experimental';
import { useUser } from '@clerk/react';
import { useSignInSignal } from '@clerk/react/experimental';
import { useState } from 'react';
import { NavLink, useNavigate } from 'react-router';

Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@ import { Button } from '@/components/ui/button';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { useSignUpSignal } from '@clerk/clerk-react/experimental';
import { useSignUpSignal } from '@clerk/react/experimental';
import { NavLink, useNavigate } from 'react-router';

export function SignUp({ className, ...props }: React.ComponentProps<'div'>) {
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-cra/src/App.tsx
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
// @ts-ignore
import React from 'react';
import './App.css';
import { SignedIn, SignedOut, SignIn, UserButton } from '@clerk/clerk-react';
import { SignedIn, SignedOut, SignIn, UserButton } from '@clerk/react';

function App() {
return (
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-cra/src/index.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import { ClerkProvider } from '@clerk/clerk-react';
import { ClerkProvider } from '@clerk/react';

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
root.render(
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/App.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationSwitcher, SignedIn, SignedOut, UserButton } from '@clerk/clerk-react';
import { OrganizationSwitcher, SignedIn, SignedOut, UserButton } from '@clerk/react';
import { Link } from 'react-router-dom';
import React from 'react';
import { ClientId } from './client-id';
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/buttons/index.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { SignInButton, SignUpButton } from '@clerk/clerk-react';
import { SignInButton, SignUpButton } from '@clerk/react';

export default function Home() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { ClerkLoaded, ClerkLoading, ClerkFailed, ClerkDegraded, useClerk } from '@clerk/clerk-react';
import { ClerkLoaded, ClerkLoading, ClerkFailed, ClerkDegraded, useClerk } from '@clerk/react';

export default function ClerkStatusPage() {
const { loaded, status } = useClerk();
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/client-id.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { useClerk, useSession } from '@clerk/clerk-react';
import { useClerk, useSession } from '@clerk/react';

export function ClientId() {
const clerk = useClerk();
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { CreateOrganization } from '@clerk/clerk-react';
import { CreateOrganization } from '@clerk/react';

export default function Page() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PropsWithChildren, useContext, useState } from 'react';
import { PageContext, PageContextProvider } from '../PageContext.tsx';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { useContext } from 'react';
import { PageContext, PageContextProvider } from '../PageContext.tsx';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PageContextProvider } from '../PageContext.tsx';
import { useState } from 'react';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PageContextProvider } from '../PageContext.tsx';
import React from 'react';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PageContextProvider } from '../PageContext.tsx';
import React from 'react';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserProfile } from '@clerk/clerk-react';
import { UserProfile } from '@clerk/react';
import { useContext } from 'react';
import { PageContext, PageContextProvider } from '../PageContext.tsx';

Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/main.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { ClerkProvider } from '@clerk/clerk-react';
import { ClerkProvider } from '@clerk/react';
import React from 'react';
import ReactDOM from 'react-dom/client';
import { createBrowserRouter, Outlet, RouterProvider, useNavigate } from 'react-router-dom';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationList } from '@clerk/clerk-react';
import { OrganizationList } from '@clerk/react';

export default function Page() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationProfile } from '@clerk/clerk-react';
import { OrganizationProfile } from '@clerk/react';

export default function Page() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationSwitcher } from '@clerk/clerk-react';
import { OrganizationSwitcher } from '@clerk/react';

export default function Page() {
return (
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/protected/index.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { SignedIn } from '@clerk/clerk-react';
import { SignedIn } from '@clerk/react';

export default function Page() {
return (
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/strong-bars-learn.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
---
'@clerk/chrome-extension': patch
'@clerk/elements': patch
'@clerk/clerk-expo': patch
'@clerk/nextjs': patch
'@clerk/react-router': patch
'@clerk/tanstack-react-start': patch
---

Use new `@clerk/react` package.
5 changes: 5 additions & 0 deletions .changeset/tame-suits-try.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
'@clerk/react': major
---

Change package name to `@clerk/react`.
20 changes: 16 additions & 4 deletions .cursor/rules/monorepo.mdc
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
---
description:
globs:
description:
globs:
alwaysApply: true
---

Monorepo Architecture and Structure

Repository Overview

- This is the official Clerk JavaScript SDK monorepo containing all Clerk authentication packages
- Clerk provides streamlined user experiences for sign up, sign in, and profile management
- All packages are published under the @clerk namespace on npm
- Uses pnpm as the package manager with Turbo for build orchestration
- Supports multiple JavaScript frameworks and environments

Core Package Categories

- **Core SDK**: `@clerk/clerk-js` - Core browser SDK with UI components
- **Framework Integrations**: Next.js, React, Vue, Astro, Nuxt, Remix, Express, Fastify
- **Platform Support**: Expo (React Native), Chrome Extension
Expand All@@ -23,6 +26,7 @@ Core Package Categories
- **Specialized**: `@clerk/agent-toolkit` - AI agent integration tools

Directory Structure

- `packages/` - All publishable packages
- `integration/` - End-to-end tests and integration templates
- `playground/` - Development and testing applications
Expand All@@ -31,6 +35,7 @@ Directory Structure
- `tools/` - Internal development tools

Development Workflow

- Use `pnpm dev` to start development mode for all packages
- Use `pnpm build` to build all packages
- Use `pnpm test` to run unit tests across all packages
Expand All@@ -39,8 +44,9 @@ Development Workflow
- Changesets for version management and release automation

Framework-Specific Packages

- `@clerk/nextjs` - Next.js App Router and Pages Router support
- `@clerk/clerk-react` - React hooks and components
- `@clerk/react` - React hooks and components
- `@clerk/vue` - Vue.js composables and components
- `@clerk/astro` - Astro integration with SSR support
- `@clerk/nuxt` - Nuxt.js module
Expand All@@ -50,6 +56,7 @@ Framework-Specific Packages
- `@clerk/expo` - React Native/Expo SDK

Testing Architecture

- Unit tests with Jest and Vitest
- Integration tests with Playwright
- Component testing with React Testing Library
Expand All@@ -58,6 +65,7 @@ Testing Architecture
- Separate test configurations per framework

Build System

- Turbo for monorepo orchestration and caching
- tsup for TypeScript compilation and bundling
- ESLint with custom configurations for different package types
Expand All@@ -66,26 +74,30 @@ Build System
- Type checking with TypeScript and publint

Environment Configuration
- Supports multiple Clerk environment variables (CLERK_*, NEXT_PUBLIC_CLERK_*, etc.)

- Supports multiple Clerk environment variables (CLERK*\*, NEXT_PUBLIC_CLERK*\*, etc.)
- Development, staging, and production configurations
- Verdaccio for local npm registry testing
- Docker support for integration testing
- CI/CD with GitHub Actions

Localization Support

- `packages/localizations/` contains translations for 30+ languages
- Modular localization system allowing partial imports
- Support for RTL languages
- Framework-agnostic translation utilities

Package Interdependency Rules

- `@clerk/shared` is a common dependency for most packages
- `@clerk/types` provides TypeScript definitions used across packages
- `@clerk/backend` is independent and used for server-side operations
- Framework packages depend on `@clerk/clerk-js` for core functionality
- Integration packages build upon framework-specific packages

Release Management

- Automated releases with Changesets
- Semantic versioning across all packages
- Canary and snapshot releases for testing
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -209,7 +209,7 @@ jobs:
matrix:
include:
- node-version: 20
test-filter: '--filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@clerk/nextjs --filter=@clerk/clerk-react --filter=@clerk/shared --filter=@clerk/remix --filter=@clerk/tanstack-react-start --filter=@clerk/elements --filter=@clerk/vue --filter=@clerk/nuxt --filter=@clerk/clerk-expo'
test-filter: '--filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@clerk/nextjs --filter=@clerk/react --filter=@clerk/shared --filter=@clerk/remix --filter=@clerk/tanstack-react-start --filter=@clerk/elements --filter=@clerk/vue --filter=@clerk/nuxt --filter=@clerk/clerk-expo'
- node-version: 22
test-filter: '**'

Expand Down
48 changes: 24 additions & 24 deletions .typedoc/__tests__/__snapshots__/file-structure.test.ts.snap
Original file line numberDiff line numberDiff line change
Expand Up@@ -199,6 +199,30 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = `
"shared/use-user.mdx",
"shared/user-agent-is-robot.mdx",
"shared/version-selector.mdx",
"react/api-keys.mdx",
"react/checkout-button-props.mdx",
"react/checkout-button.mdx",
"react/clerk-provider-props.mdx",
"react/plan-details-button-props.mdx",
"react/plan-details-button.mdx",
"react/protect.mdx",
"react/redirect-to-create-organization.mdx",
"react/redirect-to-organization-profile.mdx",
"react/redirect-to-user-profile.mdx",
"react/subscription-details-button-props.mdx",
"react/subscription-details-button.mdx",
"react/use-auth.mdx",
"react/use-clerk.mdx",
"react/use-organization-list.mdx",
"react/use-organization.mdx",
"react/use-reverification.mdx",
"react/use-session-list.mdx",
"react/use-session.mdx",
"react/use-sign-in-signal.mdx",
"react/use-sign-in.mdx",
"react/use-sign-up-signal.mdx",
"react/use-sign-up.mdx",
"react/use-user.mdx",
"nextjs/auth.mdx",
"nextjs/build-clerk-props.mdx",
"nextjs/clerk-middleware-auth-object.mdx",
Expand All@@ -208,30 +232,6 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = `
"nextjs/create-sync-get-auth.mdx",
"nextjs/current-user.mdx",
"nextjs/get-auth.mdx",
"clerk-react/api-keys.mdx",
"clerk-react/checkout-button-props.mdx",
"clerk-react/checkout-button.mdx",
"clerk-react/clerk-provider-props.mdx",
"clerk-react/plan-details-button-props.mdx",
"clerk-react/plan-details-button.mdx",
"clerk-react/protect.mdx",
"clerk-react/redirect-to-create-organization.mdx",
"clerk-react/redirect-to-organization-profile.mdx",
"clerk-react/redirect-to-user-profile.mdx",
"clerk-react/subscription-details-button-props.mdx",
"clerk-react/subscription-details-button.mdx",
"clerk-react/use-auth.mdx",
"clerk-react/use-clerk.mdx",
"clerk-react/use-organization-list.mdx",
"clerk-react/use-organization.mdx",
"clerk-react/use-reverification.mdx",
"clerk-react/use-session-list.mdx",
"clerk-react/use-session.mdx",
"clerk-react/use-sign-in-signal.mdx",
"clerk-react/use-sign-in.mdx",
"clerk-react/use-sign-up-signal.mdx",
"clerk-react/use-sign-up.mdx",
"clerk-react/use-user.mdx",
"backend/allowlist-identifier.mdx",
"backend/auth-object.mdx",
"backend/authenticate-request-options.mdx",
Expand Down
2 changes: 1 addition & 1 deletion .typedoc/__tests__/file-structure.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,8 +33,8 @@ describe('Typedoc output', () => {
expect(folders).toMatchInlineSnapshot(`
[
"backend",
"clerk-react",
"nextjs",
"react",
"shared",
"types",
]
Expand Down
6 changes: 3 additions & 3 deletions docs/CONTRIBUTING.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,7 +44,7 @@ All packages of the monorepo are inside [packages](../packages). For package spe

- [`@clerk/backend`](../packages/backend): Functionalities regarded as "core" for Clerk to operate with. _Authentication resolution, API Resources etc._
- [`@clerk/clerk-js`](../packages/clerk-js): Core JavaScript implementation used by Clerk in the browser.
- [`@clerk/clerk-react`](../packages/react) Clerk package for React applications.
- [`@clerk/react`](../packages/react) Clerk package for React applications.
- [`@clerk/types`](../packages/types): Main TypeScript typings for Clerk libraries.
- Browse [packages](../packages) to see more

Expand DownExpand Up@@ -186,10 +186,10 @@ To review your changes locally, you can run `pnpm run typedoc:generate` to gener

Create a PR that includes your changes to any Typedoc comments. Once the PR has been merged and a release is published, a PR will [automatically](https://github.com/clerk/clerk-docs/blob/main/.github/workflows/typedoc.yml) be opened in `clerk-docs` to merge in the Typedoc changes.

Typedoc output is embedded in `clerk-docs` files with the `<Typedoc />` component. For example, if you updated Typedoc comments for the `useAuth()` hook in `clerk/javascript`, you'll need to make sure that in `clerk-docs`, in the `/hooks/use-auth.mdx` file, there's a `<Typedoc />` component linked to the `./clerk-typedoc/clerk-react/use-auth.mdx` file, like:
Typedoc output is embedded in `clerk-docs` files with the `<Typedoc />` component. For example, if you updated Typedoc comments for the `useAuth()` hook in `clerk/javascript`, you'll need to make sure that in `clerk-docs`, in the `/hooks/use-auth.mdx` file, there's a `<Typedoc />` component linked to the `./clerk-typedoc/react/use-auth.mdx` file, like:

```mdx
<Typedoc src='clerk-react/use-auth' />
<Typedoc src='react/use-auth' />
```

Read more about this in the [`clerk-docs` CONTRIBUTING.md](https://github.com/clerk/clerk-docs/blob/main/CONTRIBUTING.md#typedoc-).
Expand Down
2 changes: 1 addition & 1 deletion integration/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -364,7 +364,7 @@ Assuming you have a `react-parcel` template defined in `integration/templates`,
.setName('react-parcel')
.useTemplate(templates['react-parcel'])
.setEnvFormatter('public', key => `${key}`)
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || clerkReactLocal);
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || clerkReactLocal);
```

Here's what each thing is doing:
Expand Down
2 changes: 1 addition & 1 deletion integration/presets/custom-flows.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,7 @@ const reactVite = applicationConfig()
.addScript('dev', 'pnpm dev')
.addScript('build', 'pnpm build')
.addScript('serve', 'pnpm preview')
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/themes', constants.E2E_CLERK_VERSION || linkPackage('themes'));

export const customFlows = {
Expand Down
2 changes: 1 addition & 1 deletion integration/presets/react.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,7 @@ const cra = applicationConfig()
.addScript('dev', 'pnpm start')
.addScript('build', 'pnpm build')
.addScript('serve', 'pnpm start')
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/themes', constants.E2E_CLERK_VERSION || linkPackage('themes'));

const vite = cra
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { BrowserRouter, Route, Routes } from 'react-router';
import './index.css';
import { ClerkProvider } from '@clerk/clerk-react';
import { ClerkProvider } from '@clerk/react';
import { Home } from './routes/Home';
import { SignIn } from './routes/SignIn';
import { SignUp } from './routes/SignUp';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { useUser } from '@clerk/clerk-react';
import { useUser } from '@clerk/react';

export function Protected() {
const { user, isLoaded } = useUser();
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,8 +5,8 @@ import { Button } from '@/components/ui/button';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { useUser } from '@clerk/clerk-react';
import { useSignInSignal } from '@clerk/clerk-react/experimental';
import { useUser } from '@clerk/react';
import { useSignInSignal } from '@clerk/react/experimental';
import { useState } from 'react';
import { NavLink, useNavigate } from 'react-router';

Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@ import { Button } from '@/components/ui/button';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { useSignUpSignal } from '@clerk/clerk-react/experimental';
import { useSignUpSignal } from '@clerk/react/experimental';
import { NavLink, useNavigate } from 'react-router';

export function SignUp({ className, ...props }: React.ComponentProps<'div'>) {
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-cra/src/App.tsx
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
// @ts-ignore
import React from 'react';
import './App.css';
import { SignedIn, SignedOut, SignIn, UserButton } from '@clerk/clerk-react';
import { SignedIn, SignedOut, SignIn, UserButton } from '@clerk/react';

function App() {
return (
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-cra/src/index.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import { ClerkProvider } from '@clerk/clerk-react';
import { ClerkProvider } from '@clerk/react';

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
root.render(
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/App.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationSwitcher, SignedIn, SignedOut, UserButton } from '@clerk/clerk-react';
import { OrganizationSwitcher, SignedIn, SignedOut, UserButton } from '@clerk/react';
import { Link } from 'react-router-dom';
import React from 'react';
import { ClientId } from './client-id';
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/buttons/index.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { SignInButton, SignUpButton } from '@clerk/clerk-react';
import { SignInButton, SignUpButton } from '@clerk/react';

export default function Home() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { ClerkLoaded, ClerkLoading, ClerkFailed, ClerkDegraded, useClerk } from '@clerk/clerk-react';
import { ClerkLoaded, ClerkLoading, ClerkFailed, ClerkDegraded, useClerk } from '@clerk/react';

export default function ClerkStatusPage() {
const { loaded, status } = useClerk();
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/client-id.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { useClerk, useSession } from '@clerk/clerk-react';
import { useClerk, useSession } from '@clerk/react';

export function ClientId() {
const clerk = useClerk();
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { CreateOrganization } from '@clerk/clerk-react';
import { CreateOrganization } from '@clerk/react';

export default function Page() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PropsWithChildren, useContext, useState } from 'react';
import { PageContext, PageContextProvider } from '../PageContext.tsx';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { useContext } from 'react';
import { PageContext, PageContextProvider } from '../PageContext.tsx';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PageContextProvider } from '../PageContext.tsx';
import { useState } from 'react';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PageContextProvider } from '../PageContext.tsx';
import React from 'react';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PageContextProvider } from '../PageContext.tsx';
import React from 'react';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserProfile } from '@clerk/clerk-react';
import { UserProfile } from '@clerk/react';
import { useContext } from 'react';
import { PageContext, PageContextProvider } from '../PageContext.tsx';

Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/main.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { ClerkProvider } from '@clerk/clerk-react';
import { ClerkProvider } from '@clerk/react';
import React from 'react';
import ReactDOM from 'react-dom/client';
import { createBrowserRouter, Outlet, RouterProvider, useNavigate } from 'react-router-dom';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationList } from '@clerk/clerk-react';
import { OrganizationList } from '@clerk/react';

export default function Page() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationProfile } from '@clerk/clerk-react';
import { OrganizationProfile } from '@clerk/react';

export default function Page() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationSwitcher } from '@clerk/clerk-react';
import { OrganizationSwitcher } from '@clerk/react';

export default function Page() {
return (
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/protected/index.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { SignedIn } from '@clerk/clerk-react';
import { SignedIn } from '@clerk/react';

export default function Page() {
return (
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/strong-bars-learn.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
---
'@clerk/chrome-extension': patch
'@clerk/elements': patch
'@clerk/clerk-expo': patch
'@clerk/nextjs': patch
'@clerk/react-router': patch
'@clerk/tanstack-react-start': patch
---

Use new `@clerk/react` package.
5 changes: 5 additions & 0 deletions .changeset/tame-suits-try.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
'@clerk/react': major
---

Change package name to `@clerk/react`.
20 changes: 16 additions & 4 deletions .cursor/rules/monorepo.mdc
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
---
description:
globs:
description:
globs:
alwaysApply: true
---

Monorepo Architecture and Structure

Repository Overview

- This is the official Clerk JavaScript SDK monorepo containing all Clerk authentication packages
- Clerk provides streamlined user experiences for sign up, sign in, and profile management
- All packages are published under the @clerk namespace on npm
- Uses pnpm as the package manager with Turbo for build orchestration
- Supports multiple JavaScript frameworks and environments

Core Package Categories

- **Core SDK**: `@clerk/clerk-js` - Core browser SDK with UI components
- **Framework Integrations**: Next.js, React, Vue, Astro, Nuxt, Remix, Express, Fastify
- **Platform Support**: Expo (React Native), Chrome Extension
Expand All@@ -23,6 +26,7 @@ Core Package Categories
- **Specialized**: `@clerk/agent-toolkit` - AI agent integration tools

Directory Structure

- `packages/` - All publishable packages
- `integration/` - End-to-end tests and integration templates
- `playground/` - Development and testing applications
Expand All@@ -31,6 +35,7 @@ Directory Structure
- `tools/` - Internal development tools

Development Workflow

- Use `pnpm dev` to start development mode for all packages
- Use `pnpm build` to build all packages
- Use `pnpm test` to run unit tests across all packages
Expand All@@ -39,8 +44,9 @@ Development Workflow
- Changesets for version management and release automation

Framework-Specific Packages

- `@clerk/nextjs` - Next.js App Router and Pages Router support
- `@clerk/clerk-react` - React hooks and components
- `@clerk/react` - React hooks and components
- `@clerk/vue` - Vue.js composables and components
- `@clerk/astro` - Astro integration with SSR support
- `@clerk/nuxt` - Nuxt.js module
Expand All@@ -50,6 +56,7 @@ Framework-Specific Packages
- `@clerk/expo` - React Native/Expo SDK

Testing Architecture

- Unit tests with Jest and Vitest
- Integration tests with Playwright
- Component testing with React Testing Library
Expand All@@ -58,6 +65,7 @@ Testing Architecture
- Separate test configurations per framework

Build System

- Turbo for monorepo orchestration and caching
- tsup for TypeScript compilation and bundling
- ESLint with custom configurations for different package types
Expand All@@ -66,26 +74,30 @@ Build System
- Type checking with TypeScript and publint

Environment Configuration
- Supports multiple Clerk environment variables (CLERK_*, NEXT_PUBLIC_CLERK_*, etc.)

- Supports multiple Clerk environment variables (CLERK*\*, NEXT_PUBLIC_CLERK*\*, etc.)
- Development, staging, and production configurations
- Verdaccio for local npm registry testing
- Docker support for integration testing
- CI/CD with GitHub Actions

Localization Support

- `packages/localizations/` contains translations for 30+ languages
- Modular localization system allowing partial imports
- Support for RTL languages
- Framework-agnostic translation utilities

Package Interdependency Rules

- `@clerk/shared` is a common dependency for most packages
- `@clerk/types` provides TypeScript definitions used across packages
- `@clerk/backend` is independent and used for server-side operations
- Framework packages depend on `@clerk/clerk-js` for core functionality
- Integration packages build upon framework-specific packages

Release Management

- Automated releases with Changesets
- Semantic versioning across all packages
- Canary and snapshot releases for testing
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -209,7 +209,7 @@ jobs:
matrix:
include:
- node-version: 20
test-filter: '--filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@clerk/nextjs --filter=@clerk/clerk-react --filter=@clerk/shared --filter=@clerk/remix --filter=@clerk/tanstack-react-start --filter=@clerk/elements --filter=@clerk/vue --filter=@clerk/nuxt --filter=@clerk/clerk-expo'
test-filter: '--filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@clerk/nextjs --filter=@clerk/react --filter=@clerk/shared --filter=@clerk/remix --filter=@clerk/tanstack-react-start --filter=@clerk/elements --filter=@clerk/vue --filter=@clerk/nuxt --filter=@clerk/clerk-expo'
- node-version: 22
test-filter: '**'

Expand Down
48 changes: 24 additions & 24 deletions .typedoc/__tests__/__snapshots__/file-structure.test.ts.snap
Original file line numberDiff line numberDiff line change
Expand Up@@ -199,6 +199,30 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = `
"shared/use-user.mdx",
"shared/user-agent-is-robot.mdx",
"shared/version-selector.mdx",
"react/api-keys.mdx",
"react/checkout-button-props.mdx",
"react/checkout-button.mdx",
"react/clerk-provider-props.mdx",
"react/plan-details-button-props.mdx",
"react/plan-details-button.mdx",
"react/protect.mdx",
"react/redirect-to-create-organization.mdx",
"react/redirect-to-organization-profile.mdx",
"react/redirect-to-user-profile.mdx",
"react/subscription-details-button-props.mdx",
"react/subscription-details-button.mdx",
"react/use-auth.mdx",
"react/use-clerk.mdx",
"react/use-organization-list.mdx",
"react/use-organization.mdx",
"react/use-reverification.mdx",
"react/use-session-list.mdx",
"react/use-session.mdx",
"react/use-sign-in-signal.mdx",
"react/use-sign-in.mdx",
"react/use-sign-up-signal.mdx",
"react/use-sign-up.mdx",
"react/use-user.mdx",
"nextjs/auth.mdx",
"nextjs/build-clerk-props.mdx",
"nextjs/clerk-middleware-auth-object.mdx",
Expand All@@ -208,30 +232,6 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = `
"nextjs/create-sync-get-auth.mdx",
"nextjs/current-user.mdx",
"nextjs/get-auth.mdx",
"clerk-react/api-keys.mdx",
"clerk-react/checkout-button-props.mdx",
"clerk-react/checkout-button.mdx",
"clerk-react/clerk-provider-props.mdx",
"clerk-react/plan-details-button-props.mdx",
"clerk-react/plan-details-button.mdx",
"clerk-react/protect.mdx",
"clerk-react/redirect-to-create-organization.mdx",
"clerk-react/redirect-to-organization-profile.mdx",
"clerk-react/redirect-to-user-profile.mdx",
"clerk-react/subscription-details-button-props.mdx",
"clerk-react/subscription-details-button.mdx",
"clerk-react/use-auth.mdx",
"clerk-react/use-clerk.mdx",
"clerk-react/use-organization-list.mdx",
"clerk-react/use-organization.mdx",
"clerk-react/use-reverification.mdx",
"clerk-react/use-session-list.mdx",
"clerk-react/use-session.mdx",
"clerk-react/use-sign-in-signal.mdx",
"clerk-react/use-sign-in.mdx",
"clerk-react/use-sign-up-signal.mdx",
"clerk-react/use-sign-up.mdx",
"clerk-react/use-user.mdx",
"backend/allowlist-identifier.mdx",
"backend/auth-object.mdx",
"backend/authenticate-request-options.mdx",
Expand Down
2 changes: 1 addition & 1 deletion .typedoc/__tests__/file-structure.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,8 +33,8 @@ describe('Typedoc output', () => {
expect(folders).toMatchInlineSnapshot(`
[
"backend",
"clerk-react",
"nextjs",
"react",
"shared",
"types",
]
Expand Down
6 changes: 3 additions & 3 deletions docs/CONTRIBUTING.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,7 +44,7 @@ All packages of the monorepo are inside [packages](../packages). For package spe

- [`@clerk/backend`](../packages/backend): Functionalities regarded as "core" for Clerk to operate with. _Authentication resolution, API Resources etc._
- [`@clerk/clerk-js`](../packages/clerk-js): Core JavaScript implementation used by Clerk in the browser.
- [`@clerk/clerk-react`](../packages/react) Clerk package for React applications.
- [`@clerk/react`](../packages/react) Clerk package for React applications.
- [`@clerk/types`](../packages/types): Main TypeScript typings for Clerk libraries.
- Browse [packages](../packages) to see more

Expand DownExpand Up@@ -186,10 +186,10 @@ To review your changes locally, you can run `pnpm run typedoc:generate` to gener

Create a PR that includes your changes to any Typedoc comments. Once the PR has been merged and a release is published, a PR will [automatically](https://github.com/clerk/clerk-docs/blob/main/.github/workflows/typedoc.yml) be opened in `clerk-docs` to merge in the Typedoc changes.

Typedoc output is embedded in `clerk-docs` files with the `<Typedoc />` component. For example, if you updated Typedoc comments for the `useAuth()` hook in `clerk/javascript`, you'll need to make sure that in `clerk-docs`, in the `/hooks/use-auth.mdx` file, there's a `<Typedoc />` component linked to the `./clerk-typedoc/clerk-react/use-auth.mdx` file, like:
Typedoc output is embedded in `clerk-docs` files with the `<Typedoc />` component. For example, if you updated Typedoc comments for the `useAuth()` hook in `clerk/javascript`, you'll need to make sure that in `clerk-docs`, in the `/hooks/use-auth.mdx` file, there's a `<Typedoc />` component linked to the `./clerk-typedoc/react/use-auth.mdx` file, like:

```mdx
<Typedoc src='clerk-react/use-auth' />
<Typedoc src='react/use-auth' />
```

Read more about this in the [`clerk-docs` CONTRIBUTING.md](https://github.com/clerk/clerk-docs/blob/main/CONTRIBUTING.md#typedoc-).
Expand Down
2 changes: 1 addition & 1 deletion integration/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -364,7 +364,7 @@ Assuming you have a `react-parcel` template defined in `integration/templates`,
.setName('react-parcel')
.useTemplate(templates['react-parcel'])
.setEnvFormatter('public', key => `${key}`)
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || clerkReactLocal);
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || clerkReactLocal);
```

Here's what each thing is doing:
Expand Down
2 changes: 1 addition & 1 deletion integration/presets/custom-flows.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,7 @@ const reactVite = applicationConfig()
.addScript('dev', 'pnpm dev')
.addScript('build', 'pnpm build')
.addScript('serve', 'pnpm preview')
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/themes', constants.E2E_CLERK_VERSION || linkPackage('themes'));

export const customFlows = {
Expand Down
2 changes: 1 addition & 1 deletion integration/presets/react.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,7 @@ const cra = applicationConfig()
.addScript('dev', 'pnpm start')
.addScript('build', 'pnpm build')
.addScript('serve', 'pnpm start')
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/themes', constants.E2E_CLERK_VERSION || linkPackage('themes'));

const vite = cra
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { BrowserRouter, Route, Routes } from 'react-router';
import './index.css';
import { ClerkProvider } from '@clerk/clerk-react';
import { ClerkProvider } from '@clerk/react';
import { Home } from './routes/Home';
import { SignIn } from './routes/SignIn';
import { SignUp } from './routes/SignUp';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { useUser } from '@clerk/clerk-react';
import { useUser } from '@clerk/react';

export function Protected() {
const { user, isLoaded } = useUser();
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,8 +5,8 @@ import { Button } from '@/components/ui/button';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { useUser } from '@clerk/clerk-react';
import { useSignInSignal } from '@clerk/clerk-react/experimental';
import { useUser } from '@clerk/react';
import { useSignInSignal } from '@clerk/react/experimental';
import { useState } from 'react';
import { NavLink, useNavigate } from 'react-router';

Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@ import { Button } from '@/components/ui/button';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { useSignUpSignal } from '@clerk/clerk-react/experimental';
import { useSignUpSignal } from '@clerk/react/experimental';
import { NavLink, useNavigate } from 'react-router';

export function SignUp({ className, ...props }: React.ComponentProps<'div'>) {
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-cra/src/App.tsx
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
// @ts-ignore
import React from 'react';
import './App.css';
import { SignedIn, SignedOut, SignIn, UserButton } from '@clerk/clerk-react';
import { SignedIn, SignedOut, SignIn, UserButton } from '@clerk/react';

function App() {
return (
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-cra/src/index.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import { ClerkProvider } from '@clerk/clerk-react';
import { ClerkProvider } from '@clerk/react';

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
root.render(
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/App.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationSwitcher, SignedIn, SignedOut, UserButton } from '@clerk/clerk-react';
import { OrganizationSwitcher, SignedIn, SignedOut, UserButton } from '@clerk/react';
import { Link } from 'react-router-dom';
import React from 'react';
import { ClientId } from './client-id';
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/buttons/index.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { SignInButton, SignUpButton } from '@clerk/clerk-react';
import { SignInButton, SignUpButton } from '@clerk/react';

export default function Home() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { ClerkLoaded, ClerkLoading, ClerkFailed, ClerkDegraded, useClerk } from '@clerk/clerk-react';
import { ClerkLoaded, ClerkLoading, ClerkFailed, ClerkDegraded, useClerk } from '@clerk/react';

export default function ClerkStatusPage() {
const { loaded, status } = useClerk();
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/client-id.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { useClerk, useSession } from '@clerk/clerk-react';
import { useClerk, useSession } from '@clerk/react';

export function ClientId() {
const clerk = useClerk();
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { CreateOrganization } from '@clerk/clerk-react';
import { CreateOrganization } from '@clerk/react';

export default function Page() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PropsWithChildren, useContext, useState } from 'react';
import { PageContext, PageContextProvider } from '../PageContext.tsx';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { useContext } from 'react';
import { PageContext, PageContextProvider } from '../PageContext.tsx';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PageContextProvider } from '../PageContext.tsx';
import { useState } from 'react';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PageContextProvider } from '../PageContext.tsx';
import React from 'react';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PageContextProvider } from '../PageContext.tsx';
import React from 'react';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserProfile } from '@clerk/clerk-react';
import { UserProfile } from '@clerk/react';
import { useContext } from 'react';
import { PageContext, PageContextProvider } from '../PageContext.tsx';

Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/main.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { ClerkProvider } from '@clerk/clerk-react';
import { ClerkProvider } from '@clerk/react';
import React from 'react';
import ReactDOM from 'react-dom/client';
import { createBrowserRouter, Outlet, RouterProvider, useNavigate } from 'react-router-dom';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationList } from '@clerk/clerk-react';
import { OrganizationList } from '@clerk/react';

export default function Page() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationProfile } from '@clerk/clerk-react';
import { OrganizationProfile } from '@clerk/react';

export default function Page() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationSwitcher } from '@clerk/clerk-react';
import { OrganizationSwitcher } from '@clerk/react';

export default function Page() {
return (
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/protected/index.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { SignedIn } from '@clerk/clerk-react';
import { SignedIn } from '@clerk/react';

export default function Page() {
return (
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/strong-bars-learn.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
---
'@clerk/chrome-extension': patch
'@clerk/elements': patch
'@clerk/clerk-expo': patch
'@clerk/nextjs': patch
'@clerk/react-router': patch
'@clerk/tanstack-react-start': patch
---

Use new `@clerk/react` package.
5 changes: 5 additions & 0 deletions .changeset/tame-suits-try.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
'@clerk/react': major
---

Change package name to `@clerk/react`.
20 changes: 16 additions & 4 deletions .cursor/rules/monorepo.mdc
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
---
description:
globs:
description:
globs:
alwaysApply: true
---

Monorepo Architecture and Structure

Repository Overview

- This is the official Clerk JavaScript SDK monorepo containing all Clerk authentication packages
- Clerk provides streamlined user experiences for sign up, sign in, and profile management
- All packages are published under the @clerk namespace on npm
- Uses pnpm as the package manager with Turbo for build orchestration
- Supports multiple JavaScript frameworks and environments

Core Package Categories

- **Core SDK**: `@clerk/clerk-js` - Core browser SDK with UI components
- **Framework Integrations**: Next.js, React, Vue, Astro, Nuxt, Remix, Express, Fastify
- **Platform Support**: Expo (React Native), Chrome Extension
Expand All@@ -23,6 +26,7 @@ Core Package Categories
- **Specialized**: `@clerk/agent-toolkit` - AI agent integration tools

Directory Structure

- `packages/` - All publishable packages
- `integration/` - End-to-end tests and integration templates
- `playground/` - Development and testing applications
Expand All@@ -31,6 +35,7 @@ Directory Structure
- `tools/` - Internal development tools

Development Workflow

- Use `pnpm dev` to start development mode for all packages
- Use `pnpm build` to build all packages
- Use `pnpm test` to run unit tests across all packages
Expand All@@ -39,8 +44,9 @@ Development Workflow
- Changesets for version management and release automation

Framework-Specific Packages

- `@clerk/nextjs` - Next.js App Router and Pages Router support
- `@clerk/clerk-react` - React hooks and components
- `@clerk/react` - React hooks and components
- `@clerk/vue` - Vue.js composables and components
- `@clerk/astro` - Astro integration with SSR support
- `@clerk/nuxt` - Nuxt.js module
Expand All@@ -50,6 +56,7 @@ Framework-Specific Packages
- `@clerk/expo` - React Native/Expo SDK

Testing Architecture

- Unit tests with Jest and Vitest
- Integration tests with Playwright
- Component testing with React Testing Library
Expand All@@ -58,6 +65,7 @@ Testing Architecture
- Separate test configurations per framework

Build System

- Turbo for monorepo orchestration and caching
- tsup for TypeScript compilation and bundling
- ESLint with custom configurations for different package types
Expand All@@ -66,26 +74,30 @@ Build System
- Type checking with TypeScript and publint

Environment Configuration
- Supports multiple Clerk environment variables (CLERK_*, NEXT_PUBLIC_CLERK_*, etc.)

- Supports multiple Clerk environment variables (CLERK*\*, NEXT_PUBLIC_CLERK*\*, etc.)
- Development, staging, and production configurations
- Verdaccio for local npm registry testing
- Docker support for integration testing
- CI/CD with GitHub Actions

Localization Support

- `packages/localizations/` contains translations for 30+ languages
- Modular localization system allowing partial imports
- Support for RTL languages
- Framework-agnostic translation utilities

Package Interdependency Rules

- `@clerk/shared` is a common dependency for most packages
- `@clerk/types` provides TypeScript definitions used across packages
- `@clerk/backend` is independent and used for server-side operations
- Framework packages depend on `@clerk/clerk-js` for core functionality
- Integration packages build upon framework-specific packages

Release Management

- Automated releases with Changesets
- Semantic versioning across all packages
- Canary and snapshot releases for testing
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -209,7 +209,7 @@ jobs:
matrix:
include:
- node-version: 20
test-filter: '--filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@clerk/nextjs --filter=@clerk/clerk-react --filter=@clerk/shared --filter=@clerk/remix --filter=@clerk/tanstack-react-start --filter=@clerk/elements --filter=@clerk/vue --filter=@clerk/nuxt --filter=@clerk/clerk-expo'
test-filter: '--filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@clerk/nextjs --filter=@clerk/react --filter=@clerk/shared --filter=@clerk/remix --filter=@clerk/tanstack-react-start --filter=@clerk/elements --filter=@clerk/vue --filter=@clerk/nuxt --filter=@clerk/clerk-expo'
- node-version: 22
test-filter: '**'

Expand Down
48 changes: 24 additions & 24 deletions .typedoc/__tests__/__snapshots__/file-structure.test.ts.snap
Original file line numberDiff line numberDiff line change
Expand Up@@ -199,6 +199,30 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = `
"shared/use-user.mdx",
"shared/user-agent-is-robot.mdx",
"shared/version-selector.mdx",
"react/api-keys.mdx",
"react/checkout-button-props.mdx",
"react/checkout-button.mdx",
"react/clerk-provider-props.mdx",
"react/plan-details-button-props.mdx",
"react/plan-details-button.mdx",
"react/protect.mdx",
"react/redirect-to-create-organization.mdx",
"react/redirect-to-organization-profile.mdx",
"react/redirect-to-user-profile.mdx",
"react/subscription-details-button-props.mdx",
"react/subscription-details-button.mdx",
"react/use-auth.mdx",
"react/use-clerk.mdx",
"react/use-organization-list.mdx",
"react/use-organization.mdx",
"react/use-reverification.mdx",
"react/use-session-list.mdx",
"react/use-session.mdx",
"react/use-sign-in-signal.mdx",
"react/use-sign-in.mdx",
"react/use-sign-up-signal.mdx",
"react/use-sign-up.mdx",
"react/use-user.mdx",
"nextjs/auth.mdx",
"nextjs/build-clerk-props.mdx",
"nextjs/clerk-middleware-auth-object.mdx",
Expand All@@ -208,30 +232,6 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = `
"nextjs/create-sync-get-auth.mdx",
"nextjs/current-user.mdx",
"nextjs/get-auth.mdx",
"clerk-react/api-keys.mdx",
"clerk-react/checkout-button-props.mdx",
"clerk-react/checkout-button.mdx",
"clerk-react/clerk-provider-props.mdx",
"clerk-react/plan-details-button-props.mdx",
"clerk-react/plan-details-button.mdx",
"clerk-react/protect.mdx",
"clerk-react/redirect-to-create-organization.mdx",
"clerk-react/redirect-to-organization-profile.mdx",
"clerk-react/redirect-to-user-profile.mdx",
"clerk-react/subscription-details-button-props.mdx",
"clerk-react/subscription-details-button.mdx",
"clerk-react/use-auth.mdx",
"clerk-react/use-clerk.mdx",
"clerk-react/use-organization-list.mdx",
"clerk-react/use-organization.mdx",
"clerk-react/use-reverification.mdx",
"clerk-react/use-session-list.mdx",
"clerk-react/use-session.mdx",
"clerk-react/use-sign-in-signal.mdx",
"clerk-react/use-sign-in.mdx",
"clerk-react/use-sign-up-signal.mdx",
"clerk-react/use-sign-up.mdx",
"clerk-react/use-user.mdx",
"backend/allowlist-identifier.mdx",
"backend/auth-object.mdx",
"backend/authenticate-request-options.mdx",
Expand Down
2 changes: 1 addition & 1 deletion .typedoc/__tests__/file-structure.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,8 +33,8 @@ describe('Typedoc output', () => {
expect(folders).toMatchInlineSnapshot(`
[
"backend",
"clerk-react",
"nextjs",
"react",
"shared",
"types",
]
Expand Down
6 changes: 3 additions & 3 deletions docs/CONTRIBUTING.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,7 +44,7 @@ All packages of the monorepo are inside [packages](../packages). For package spe

- [`@clerk/backend`](../packages/backend): Functionalities regarded as "core" for Clerk to operate with. _Authentication resolution, API Resources etc._
- [`@clerk/clerk-js`](../packages/clerk-js): Core JavaScript implementation used by Clerk in the browser.
- [`@clerk/clerk-react`](../packages/react) Clerk package for React applications.
- [`@clerk/react`](../packages/react) Clerk package for React applications.
- [`@clerk/types`](../packages/types): Main TypeScript typings for Clerk libraries.
- Browse [packages](../packages) to see more

Expand DownExpand Up@@ -186,10 +186,10 @@ To review your changes locally, you can run `pnpm run typedoc:generate` to gener

Create a PR that includes your changes to any Typedoc comments. Once the PR has been merged and a release is published, a PR will [automatically](https://github.com/clerk/clerk-docs/blob/main/.github/workflows/typedoc.yml) be opened in `clerk-docs` to merge in the Typedoc changes.

Typedoc output is embedded in `clerk-docs` files with the `<Typedoc />` component. For example, if you updated Typedoc comments for the `useAuth()` hook in `clerk/javascript`, you'll need to make sure that in `clerk-docs`, in the `/hooks/use-auth.mdx` file, there's a `<Typedoc />` component linked to the `./clerk-typedoc/clerk-react/use-auth.mdx` file, like:
Typedoc output is embedded in `clerk-docs` files with the `<Typedoc />` component. For example, if you updated Typedoc comments for the `useAuth()` hook in `clerk/javascript`, you'll need to make sure that in `clerk-docs`, in the `/hooks/use-auth.mdx` file, there's a `<Typedoc />` component linked to the `./clerk-typedoc/react/use-auth.mdx` file, like:

```mdx
<Typedoc src='clerk-react/use-auth' />
<Typedoc src='react/use-auth' />
```

Read more about this in the [`clerk-docs` CONTRIBUTING.md](https://github.com/clerk/clerk-docs/blob/main/CONTRIBUTING.md#typedoc-).
Expand Down
2 changes: 1 addition & 1 deletion integration/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -364,7 +364,7 @@ Assuming you have a `react-parcel` template defined in `integration/templates`,
.setName('react-parcel')
.useTemplate(templates['react-parcel'])
.setEnvFormatter('public', key => `${key}`)
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || clerkReactLocal);
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || clerkReactLocal);
```

Here's what each thing is doing:
Expand Down
2 changes: 1 addition & 1 deletion integration/presets/custom-flows.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,7 @@ const reactVite = applicationConfig()
.addScript('dev', 'pnpm dev')
.addScript('build', 'pnpm build')
.addScript('serve', 'pnpm preview')
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/themes', constants.E2E_CLERK_VERSION || linkPackage('themes'));

export const customFlows = {
Expand Down
2 changes: 1 addition & 1 deletion integration/presets/react.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,7 @@ const cra = applicationConfig()
.addScript('dev', 'pnpm start')
.addScript('build', 'pnpm build')
.addScript('serve', 'pnpm start')
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/themes', constants.E2E_CLERK_VERSION || linkPackage('themes'));

const vite = cra
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { BrowserRouter, Route, Routes } from 'react-router';
import './index.css';
import { ClerkProvider } from '@clerk/clerk-react';
import { ClerkProvider } from '@clerk/react';
import { Home } from './routes/Home';
import { SignIn } from './routes/SignIn';
import { SignUp } from './routes/SignUp';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { useUser } from '@clerk/clerk-react';
import { useUser } from '@clerk/react';

export function Protected() {
const { user, isLoaded } = useUser();
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,8 +5,8 @@ import { Button } from '@/components/ui/button';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { useUser } from '@clerk/clerk-react';
import { useSignInSignal } from '@clerk/clerk-react/experimental';
import { useUser } from '@clerk/react';
import { useSignInSignal } from '@clerk/react/experimental';
import { useState } from 'react';
import { NavLink, useNavigate } from 'react-router';

Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@ import { Button } from '@/components/ui/button';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { useSignUpSignal } from '@clerk/clerk-react/experimental';
import { useSignUpSignal } from '@clerk/react/experimental';
import { NavLink, useNavigate } from 'react-router';

export function SignUp({ className, ...props }: React.ComponentProps<'div'>) {
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-cra/src/App.tsx
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
// @ts-ignore
import React from 'react';
import './App.css';
import { SignedIn, SignedOut, SignIn, UserButton } from '@clerk/clerk-react';
import { SignedIn, SignedOut, SignIn, UserButton } from '@clerk/react';

function App() {
return (
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-cra/src/index.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import { ClerkProvider } from '@clerk/clerk-react';
import { ClerkProvider } from '@clerk/react';

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
root.render(
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/App.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationSwitcher, SignedIn, SignedOut, UserButton } from '@clerk/clerk-react';
import { OrganizationSwitcher, SignedIn, SignedOut, UserButton } from '@clerk/react';
import { Link } from 'react-router-dom';
import React from 'react';
import { ClientId } from './client-id';
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/buttons/index.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { SignInButton, SignUpButton } from '@clerk/clerk-react';
import { SignInButton, SignUpButton } from '@clerk/react';

export default function Home() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { ClerkLoaded, ClerkLoading, ClerkFailed, ClerkDegraded, useClerk } from '@clerk/clerk-react';
import { ClerkLoaded, ClerkLoading, ClerkFailed, ClerkDegraded, useClerk } from '@clerk/react';

export default function ClerkStatusPage() {
const { loaded, status } = useClerk();
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/client-id.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { useClerk, useSession } from '@clerk/clerk-react';
import { useClerk, useSession } from '@clerk/react';

export function ClientId() {
const clerk = useClerk();
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { CreateOrganization } from '@clerk/clerk-react';
import { CreateOrganization } from '@clerk/react';

export default function Page() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PropsWithChildren, useContext, useState } from 'react';
import { PageContext, PageContextProvider } from '../PageContext.tsx';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { useContext } from 'react';
import { PageContext, PageContextProvider } from '../PageContext.tsx';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PageContextProvider } from '../PageContext.tsx';
import { useState } from 'react';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PageContextProvider } from '../PageContext.tsx';
import React from 'react';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PageContextProvider } from '../PageContext.tsx';
import React from 'react';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserProfile } from '@clerk/clerk-react';
import { UserProfile } from '@clerk/react';
import { useContext } from 'react';
import { PageContext, PageContextProvider } from '../PageContext.tsx';

Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/main.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { ClerkProvider } from '@clerk/clerk-react';
import { ClerkProvider } from '@clerk/react';
import React from 'react';
import ReactDOM from 'react-dom/client';
import { createBrowserRouter, Outlet, RouterProvider, useNavigate } from 'react-router-dom';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationList } from '@clerk/clerk-react';
import { OrganizationList } from '@clerk/react';

export default function Page() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationProfile } from '@clerk/clerk-react';
import { OrganizationProfile } from '@clerk/react';

export default function Page() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationSwitcher } from '@clerk/clerk-react';
import { OrganizationSwitcher } from '@clerk/react';

export default function Page() {
return (
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/protected/index.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { SignedIn } from '@clerk/clerk-react';
import { SignedIn } from '@clerk/react';

export default function Page() {
return (
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/strong-bars-learn.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
---
'@clerk/chrome-extension': patch
'@clerk/elements': patch
'@clerk/clerk-expo': patch
'@clerk/nextjs': patch
'@clerk/react-router': patch
'@clerk/tanstack-react-start': patch
---

Use new `@clerk/react` package.
5 changes: 5 additions & 0 deletions .changeset/tame-suits-try.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
'@clerk/react': major
---

Change package name to `@clerk/react`.
20 changes: 16 additions & 4 deletions .cursor/rules/monorepo.mdc
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
---
description:
globs:
description:
globs:
alwaysApply: true
---

Monorepo Architecture and Structure

Repository Overview

- This is the official Clerk JavaScript SDK monorepo containing all Clerk authentication packages
- Clerk provides streamlined user experiences for sign up, sign in, and profile management
- All packages are published under the @clerk namespace on npm
- Uses pnpm as the package manager with Turbo for build orchestration
- Supports multiple JavaScript frameworks and environments

Core Package Categories

- **Core SDK**: `@clerk/clerk-js` - Core browser SDK with UI components
- **Framework Integrations**: Next.js, React, Vue, Astro, Nuxt, Remix, Express, Fastify
- **Platform Support**: Expo (React Native), Chrome Extension
Expand All@@ -23,6 +26,7 @@ Core Package Categories
- **Specialized**: `@clerk/agent-toolkit` - AI agent integration tools

Directory Structure

- `packages/` - All publishable packages
- `integration/` - End-to-end tests and integration templates
- `playground/` - Development and testing applications
Expand All@@ -31,6 +35,7 @@ Directory Structure
- `tools/` - Internal development tools

Development Workflow

- Use `pnpm dev` to start development mode for all packages
- Use `pnpm build` to build all packages
- Use `pnpm test` to run unit tests across all packages
Expand All@@ -39,8 +44,9 @@ Development Workflow
- Changesets for version management and release automation

Framework-Specific Packages

- `@clerk/nextjs` - Next.js App Router and Pages Router support
- `@clerk/clerk-react` - React hooks and components
- `@clerk/react` - React hooks and components
- `@clerk/vue` - Vue.js composables and components
- `@clerk/astro` - Astro integration with SSR support
- `@clerk/nuxt` - Nuxt.js module
Expand All@@ -50,6 +56,7 @@ Framework-Specific Packages
- `@clerk/expo` - React Native/Expo SDK

Testing Architecture

- Unit tests with Jest and Vitest
- Integration tests with Playwright
- Component testing with React Testing Library
Expand All@@ -58,6 +65,7 @@ Testing Architecture
- Separate test configurations per framework

Build System

- Turbo for monorepo orchestration and caching
- tsup for TypeScript compilation and bundling
- ESLint with custom configurations for different package types
Expand All@@ -66,26 +74,30 @@ Build System
- Type checking with TypeScript and publint

Environment Configuration
- Supports multiple Clerk environment variables (CLERK_*, NEXT_PUBLIC_CLERK_*, etc.)

- Supports multiple Clerk environment variables (CLERK*\*, NEXT_PUBLIC_CLERK*\*, etc.)
- Development, staging, and production configurations
- Verdaccio for local npm registry testing
- Docker support for integration testing
- CI/CD with GitHub Actions

Localization Support

- `packages/localizations/` contains translations for 30+ languages
- Modular localization system allowing partial imports
- Support for RTL languages
- Framework-agnostic translation utilities

Package Interdependency Rules

- `@clerk/shared` is a common dependency for most packages
- `@clerk/types` provides TypeScript definitions used across packages
- `@clerk/backend` is independent and used for server-side operations
- Framework packages depend on `@clerk/clerk-js` for core functionality
- Integration packages build upon framework-specific packages

Release Management

- Automated releases with Changesets
- Semantic versioning across all packages
- Canary and snapshot releases for testing
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -209,7 +209,7 @@ jobs:
matrix:
include:
- node-version: 20
test-filter: '--filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@clerk/nextjs --filter=@clerk/clerk-react --filter=@clerk/shared --filter=@clerk/remix --filter=@clerk/tanstack-react-start --filter=@clerk/elements --filter=@clerk/vue --filter=@clerk/nuxt --filter=@clerk/clerk-expo'
test-filter: '--filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@clerk/nextjs --filter=@clerk/react --filter=@clerk/shared --filter=@clerk/remix --filter=@clerk/tanstack-react-start --filter=@clerk/elements --filter=@clerk/vue --filter=@clerk/nuxt --filter=@clerk/clerk-expo'
- node-version: 22
test-filter: '**'

Expand Down
48 changes: 24 additions & 24 deletions .typedoc/__tests__/__snapshots__/file-structure.test.ts.snap
Original file line numberDiff line numberDiff line change
Expand Up@@ -199,6 +199,30 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = `
"shared/use-user.mdx",
"shared/user-agent-is-robot.mdx",
"shared/version-selector.mdx",
"react/api-keys.mdx",
"react/checkout-button-props.mdx",
"react/checkout-button.mdx",
"react/clerk-provider-props.mdx",
"react/plan-details-button-props.mdx",
"react/plan-details-button.mdx",
"react/protect.mdx",
"react/redirect-to-create-organization.mdx",
"react/redirect-to-organization-profile.mdx",
"react/redirect-to-user-profile.mdx",
"react/subscription-details-button-props.mdx",
"react/subscription-details-button.mdx",
"react/use-auth.mdx",
"react/use-clerk.mdx",
"react/use-organization-list.mdx",
"react/use-organization.mdx",
"react/use-reverification.mdx",
"react/use-session-list.mdx",
"react/use-session.mdx",
"react/use-sign-in-signal.mdx",
"react/use-sign-in.mdx",
"react/use-sign-up-signal.mdx",
"react/use-sign-up.mdx",
"react/use-user.mdx",
"nextjs/auth.mdx",
"nextjs/build-clerk-props.mdx",
"nextjs/clerk-middleware-auth-object.mdx",
Expand All@@ -208,30 +232,6 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = `
"nextjs/create-sync-get-auth.mdx",
"nextjs/current-user.mdx",
"nextjs/get-auth.mdx",
"clerk-react/api-keys.mdx",
"clerk-react/checkout-button-props.mdx",
"clerk-react/checkout-button.mdx",
"clerk-react/clerk-provider-props.mdx",
"clerk-react/plan-details-button-props.mdx",
"clerk-react/plan-details-button.mdx",
"clerk-react/protect.mdx",
"clerk-react/redirect-to-create-organization.mdx",
"clerk-react/redirect-to-organization-profile.mdx",
"clerk-react/redirect-to-user-profile.mdx",
"clerk-react/subscription-details-button-props.mdx",
"clerk-react/subscription-details-button.mdx",
"clerk-react/use-auth.mdx",
"clerk-react/use-clerk.mdx",
"clerk-react/use-organization-list.mdx",
"clerk-react/use-organization.mdx",
"clerk-react/use-reverification.mdx",
"clerk-react/use-session-list.mdx",
"clerk-react/use-session.mdx",
"clerk-react/use-sign-in-signal.mdx",
"clerk-react/use-sign-in.mdx",
"clerk-react/use-sign-up-signal.mdx",
"clerk-react/use-sign-up.mdx",
"clerk-react/use-user.mdx",
"backend/allowlist-identifier.mdx",
"backend/auth-object.mdx",
"backend/authenticate-request-options.mdx",
Expand Down
2 changes: 1 addition & 1 deletion .typedoc/__tests__/file-structure.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,8 +33,8 @@ describe('Typedoc output', () => {
expect(folders).toMatchInlineSnapshot(`
[
"backend",
"clerk-react",
"nextjs",
"react",
"shared",
"types",
]
Expand Down
6 changes: 3 additions & 3 deletions docs/CONTRIBUTING.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,7 +44,7 @@ All packages of the monorepo are inside [packages](../packages). For package spe

- [`@clerk/backend`](../packages/backend): Functionalities regarded as "core" for Clerk to operate with. _Authentication resolution, API Resources etc._
- [`@clerk/clerk-js`](../packages/clerk-js): Core JavaScript implementation used by Clerk in the browser.
- [`@clerk/clerk-react`](../packages/react) Clerk package for React applications.
- [`@clerk/react`](../packages/react) Clerk package for React applications.
- [`@clerk/types`](../packages/types): Main TypeScript typings for Clerk libraries.
- Browse [packages](../packages) to see more

Expand DownExpand Up@@ -186,10 +186,10 @@ To review your changes locally, you can run `pnpm run typedoc:generate` to gener

Create a PR that includes your changes to any Typedoc comments. Once the PR has been merged and a release is published, a PR will [automatically](https://github.com/clerk/clerk-docs/blob/main/.github/workflows/typedoc.yml) be opened in `clerk-docs` to merge in the Typedoc changes.

Typedoc output is embedded in `clerk-docs` files with the `<Typedoc />` component. For example, if you updated Typedoc comments for the `useAuth()` hook in `clerk/javascript`, you'll need to make sure that in `clerk-docs`, in the `/hooks/use-auth.mdx` file, there's a `<Typedoc />` component linked to the `./clerk-typedoc/clerk-react/use-auth.mdx` file, like:
Typedoc output is embedded in `clerk-docs` files with the `<Typedoc />` component. For example, if you updated Typedoc comments for the `useAuth()` hook in `clerk/javascript`, you'll need to make sure that in `clerk-docs`, in the `/hooks/use-auth.mdx` file, there's a `<Typedoc />` component linked to the `./clerk-typedoc/react/use-auth.mdx` file, like:

```mdx
<Typedoc src='clerk-react/use-auth' />
<Typedoc src='react/use-auth' />
```

Read more about this in the [`clerk-docs` CONTRIBUTING.md](https://github.com/clerk/clerk-docs/blob/main/CONTRIBUTING.md#typedoc-).
Expand Down
2 changes: 1 addition & 1 deletion integration/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -364,7 +364,7 @@ Assuming you have a `react-parcel` template defined in `integration/templates`,
.setName('react-parcel')
.useTemplate(templates['react-parcel'])
.setEnvFormatter('public', key => `${key}`)
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || clerkReactLocal);
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || clerkReactLocal);
```

Here's what each thing is doing:
Expand Down
2 changes: 1 addition & 1 deletion integration/presets/custom-flows.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,7 @@ const reactVite = applicationConfig()
.addScript('dev', 'pnpm dev')
.addScript('build', 'pnpm build')
.addScript('serve', 'pnpm preview')
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/themes', constants.E2E_CLERK_VERSION || linkPackage('themes'));

export const customFlows = {
Expand Down
2 changes: 1 addition & 1 deletion integration/presets/react.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,7 @@ const cra = applicationConfig()
.addScript('dev', 'pnpm start')
.addScript('build', 'pnpm build')
.addScript('serve', 'pnpm start')
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/themes', constants.E2E_CLERK_VERSION || linkPackage('themes'));

const vite = cra
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { BrowserRouter, Route, Routes } from 'react-router';
import './index.css';
import { ClerkProvider } from '@clerk/clerk-react';
import { ClerkProvider } from '@clerk/react';
import { Home } from './routes/Home';
import { SignIn } from './routes/SignIn';
import { SignUp } from './routes/SignUp';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { useUser } from '@clerk/clerk-react';
import { useUser } from '@clerk/react';

export function Protected() {
const { user, isLoaded } = useUser();
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,8 +5,8 @@ import { Button } from '@/components/ui/button';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { useUser } from '@clerk/clerk-react';
import { useSignInSignal } from '@clerk/clerk-react/experimental';
import { useUser } from '@clerk/react';
import { useSignInSignal } from '@clerk/react/experimental';
import { useState } from 'react';
import { NavLink, useNavigate } from 'react-router';

Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@ import { Button } from '@/components/ui/button';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { useSignUpSignal } from '@clerk/clerk-react/experimental';
import { useSignUpSignal } from '@clerk/react/experimental';
import { NavLink, useNavigate } from 'react-router';

export function SignUp({ className, ...props }: React.ComponentProps<'div'>) {
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-cra/src/App.tsx
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
// @ts-ignore
import React from 'react';
import './App.css';
import { SignedIn, SignedOut, SignIn, UserButton } from '@clerk/clerk-react';
import { SignedIn, SignedOut, SignIn, UserButton } from '@clerk/react';

function App() {
return (
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-cra/src/index.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import { ClerkProvider } from '@clerk/clerk-react';
import { ClerkProvider } from '@clerk/react';

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
root.render(
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/App.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationSwitcher, SignedIn, SignedOut, UserButton } from '@clerk/clerk-react';
import { OrganizationSwitcher, SignedIn, SignedOut, UserButton } from '@clerk/react';
import { Link } from 'react-router-dom';
import React from 'react';
import { ClientId } from './client-id';
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/buttons/index.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { SignInButton, SignUpButton } from '@clerk/clerk-react';
import { SignInButton, SignUpButton } from '@clerk/react';

export default function Home() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { ClerkLoaded, ClerkLoading, ClerkFailed, ClerkDegraded, useClerk } from '@clerk/clerk-react';
import { ClerkLoaded, ClerkLoading, ClerkFailed, ClerkDegraded, useClerk } from '@clerk/react';

export default function ClerkStatusPage() {
const { loaded, status } = useClerk();
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/client-id.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { useClerk, useSession } from '@clerk/clerk-react';
import { useClerk, useSession } from '@clerk/react';

export function ClientId() {
const clerk = useClerk();
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { CreateOrganization } from '@clerk/clerk-react';
import { CreateOrganization } from '@clerk/react';

export default function Page() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PropsWithChildren, useContext, useState } from 'react';
import { PageContext, PageContextProvider } from '../PageContext.tsx';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { useContext } from 'react';
import { PageContext, PageContextProvider } from '../PageContext.tsx';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PageContextProvider } from '../PageContext.tsx';
import { useState } from 'react';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PageContextProvider } from '../PageContext.tsx';
import React from 'react';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PageContextProvider } from '../PageContext.tsx';
import React from 'react';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserProfile } from '@clerk/clerk-react';
import { UserProfile } from '@clerk/react';
import { useContext } from 'react';
import { PageContext, PageContextProvider } from '../PageContext.tsx';

Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/main.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { ClerkProvider } from '@clerk/clerk-react';
import { ClerkProvider } from '@clerk/react';
import React from 'react';
import ReactDOM from 'react-dom/client';
import { createBrowserRouter, Outlet, RouterProvider, useNavigate } from 'react-router-dom';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationList } from '@clerk/clerk-react';
import { OrganizationList } from '@clerk/react';

export default function Page() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationProfile } from '@clerk/clerk-react';
import { OrganizationProfile } from '@clerk/react';

export default function Page() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationSwitcher } from '@clerk/clerk-react';
import { OrganizationSwitcher } from '@clerk/react';

export default function Page() {
return (
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/protected/index.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { SignedIn } from '@clerk/clerk-react';
import { SignedIn } from '@clerk/react';

export default function Page() {
return (
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/strong-bars-learn.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
---
'@clerk/chrome-extension': patch
'@clerk/elements': patch
'@clerk/clerk-expo': patch
'@clerk/nextjs': patch
'@clerk/react-router': patch
'@clerk/tanstack-react-start': patch
---

Use new `@clerk/react` package.
5 changes: 5 additions & 0 deletions .changeset/tame-suits-try.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
'@clerk/react': major
---

Change package name to `@clerk/react`.
20 changes: 16 additions & 4 deletions .cursor/rules/monorepo.mdc
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
---
description:
globs:
description:
globs:
alwaysApply: true
---

Monorepo Architecture and Structure

Repository Overview

- This is the official Clerk JavaScript SDK monorepo containing all Clerk authentication packages
- Clerk provides streamlined user experiences for sign up, sign in, and profile management
- All packages are published under the @clerk namespace on npm
- Uses pnpm as the package manager with Turbo for build orchestration
- Supports multiple JavaScript frameworks and environments

Core Package Categories

- **Core SDK**: `@clerk/clerk-js` - Core browser SDK with UI components
- **Framework Integrations**: Next.js, React, Vue, Astro, Nuxt, Remix, Express, Fastify
- **Platform Support**: Expo (React Native), Chrome Extension
Expand All@@ -23,6 +26,7 @@ Core Package Categories
- **Specialized**: `@clerk/agent-toolkit` - AI agent integration tools

Directory Structure

- `packages/` - All publishable packages
- `integration/` - End-to-end tests and integration templates
- `playground/` - Development and testing applications
Expand All@@ -31,6 +35,7 @@ Directory Structure
- `tools/` - Internal development tools

Development Workflow

- Use `pnpm dev` to start development mode for all packages
- Use `pnpm build` to build all packages
- Use `pnpm test` to run unit tests across all packages
Expand All@@ -39,8 +44,9 @@ Development Workflow
- Changesets for version management and release automation

Framework-Specific Packages

- `@clerk/nextjs` - Next.js App Router and Pages Router support
- `@clerk/clerk-react` - React hooks and components
- `@clerk/react` - React hooks and components
- `@clerk/vue` - Vue.js composables and components
- `@clerk/astro` - Astro integration with SSR support
- `@clerk/nuxt` - Nuxt.js module
Expand All@@ -50,6 +56,7 @@ Framework-Specific Packages
- `@clerk/expo` - React Native/Expo SDK

Testing Architecture

- Unit tests with Jest and Vitest
- Integration tests with Playwright
- Component testing with React Testing Library
Expand All@@ -58,6 +65,7 @@ Testing Architecture
- Separate test configurations per framework

Build System

- Turbo for monorepo orchestration and caching
- tsup for TypeScript compilation and bundling
- ESLint with custom configurations for different package types
Expand All@@ -66,26 +74,30 @@ Build System
- Type checking with TypeScript and publint

Environment Configuration
- Supports multiple Clerk environment variables (CLERK_*, NEXT_PUBLIC_CLERK_*, etc.)

- Supports multiple Clerk environment variables (CLERK*\*, NEXT_PUBLIC_CLERK*\*, etc.)
- Development, staging, and production configurations
- Verdaccio for local npm registry testing
- Docker support for integration testing
- CI/CD with GitHub Actions

Localization Support

- `packages/localizations/` contains translations for 30+ languages
- Modular localization system allowing partial imports
- Support for RTL languages
- Framework-agnostic translation utilities

Package Interdependency Rules

- `@clerk/shared` is a common dependency for most packages
- `@clerk/types` provides TypeScript definitions used across packages
- `@clerk/backend` is independent and used for server-side operations
- Framework packages depend on `@clerk/clerk-js` for core functionality
- Integration packages build upon framework-specific packages

Release Management

- Automated releases with Changesets
- Semantic versioning across all packages
- Canary and snapshot releases for testing
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -209,7 +209,7 @@ jobs:
matrix:
include:
- node-version: 20
test-filter: '--filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@clerk/nextjs --filter=@clerk/clerk-react --filter=@clerk/shared --filter=@clerk/remix --filter=@clerk/tanstack-react-start --filter=@clerk/elements --filter=@clerk/vue --filter=@clerk/nuxt --filter=@clerk/clerk-expo'
test-filter: '--filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@clerk/nextjs --filter=@clerk/react --filter=@clerk/shared --filter=@clerk/remix --filter=@clerk/tanstack-react-start --filter=@clerk/elements --filter=@clerk/vue --filter=@clerk/nuxt --filter=@clerk/clerk-expo'
- node-version: 22
test-filter: '**'

Expand Down
48 changes: 24 additions & 24 deletions .typedoc/__tests__/__snapshots__/file-structure.test.ts.snap
Original file line numberDiff line numberDiff line change
Expand Up@@ -199,6 +199,30 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = `
"shared/use-user.mdx",
"shared/user-agent-is-robot.mdx",
"shared/version-selector.mdx",
"react/api-keys.mdx",
"react/checkout-button-props.mdx",
"react/checkout-button.mdx",
"react/clerk-provider-props.mdx",
"react/plan-details-button-props.mdx",
"react/plan-details-button.mdx",
"react/protect.mdx",
"react/redirect-to-create-organization.mdx",
"react/redirect-to-organization-profile.mdx",
"react/redirect-to-user-profile.mdx",
"react/subscription-details-button-props.mdx",
"react/subscription-details-button.mdx",
"react/use-auth.mdx",
"react/use-clerk.mdx",
"react/use-organization-list.mdx",
"react/use-organization.mdx",
"react/use-reverification.mdx",
"react/use-session-list.mdx",
"react/use-session.mdx",
"react/use-sign-in-signal.mdx",
"react/use-sign-in.mdx",
"react/use-sign-up-signal.mdx",
"react/use-sign-up.mdx",
"react/use-user.mdx",
"nextjs/auth.mdx",
"nextjs/build-clerk-props.mdx",
"nextjs/clerk-middleware-auth-object.mdx",
Expand All@@ -208,30 +232,6 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = `
"nextjs/create-sync-get-auth.mdx",
"nextjs/current-user.mdx",
"nextjs/get-auth.mdx",
"clerk-react/api-keys.mdx",
"clerk-react/checkout-button-props.mdx",
"clerk-react/checkout-button.mdx",
"clerk-react/clerk-provider-props.mdx",
"clerk-react/plan-details-button-props.mdx",
"clerk-react/plan-details-button.mdx",
"clerk-react/protect.mdx",
"clerk-react/redirect-to-create-organization.mdx",
"clerk-react/redirect-to-organization-profile.mdx",
"clerk-react/redirect-to-user-profile.mdx",
"clerk-react/subscription-details-button-props.mdx",
"clerk-react/subscription-details-button.mdx",
"clerk-react/use-auth.mdx",
"clerk-react/use-clerk.mdx",
"clerk-react/use-organization-list.mdx",
"clerk-react/use-organization.mdx",
"clerk-react/use-reverification.mdx",
"clerk-react/use-session-list.mdx",
"clerk-react/use-session.mdx",
"clerk-react/use-sign-in-signal.mdx",
"clerk-react/use-sign-in.mdx",
"clerk-react/use-sign-up-signal.mdx",
"clerk-react/use-sign-up.mdx",
"clerk-react/use-user.mdx",
"backend/allowlist-identifier.mdx",
"backend/auth-object.mdx",
"backend/authenticate-request-options.mdx",
Expand Down
2 changes: 1 addition & 1 deletion .typedoc/__tests__/file-structure.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,8 +33,8 @@ describe('Typedoc output', () => {
expect(folders).toMatchInlineSnapshot(`
[
"backend",
"clerk-react",
"nextjs",
"react",
"shared",
"types",
]
Expand Down
6 changes: 3 additions & 3 deletions docs/CONTRIBUTING.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,7 +44,7 @@ All packages of the monorepo are inside [packages](../packages). For package spe

- [`@clerk/backend`](../packages/backend): Functionalities regarded as "core" for Clerk to operate with. _Authentication resolution, API Resources etc._
- [`@clerk/clerk-js`](../packages/clerk-js): Core JavaScript implementation used by Clerk in the browser.
- [`@clerk/clerk-react`](../packages/react) Clerk package for React applications.
- [`@clerk/react`](../packages/react) Clerk package for React applications.
- [`@clerk/types`](../packages/types): Main TypeScript typings for Clerk libraries.
- Browse [packages](../packages) to see more

Expand DownExpand Up@@ -186,10 +186,10 @@ To review your changes locally, you can run `pnpm run typedoc:generate` to gener

Create a PR that includes your changes to any Typedoc comments. Once the PR has been merged and a release is published, a PR will [automatically](https://github.com/clerk/clerk-docs/blob/main/.github/workflows/typedoc.yml) be opened in `clerk-docs` to merge in the Typedoc changes.

Typedoc output is embedded in `clerk-docs` files with the `<Typedoc />` component. For example, if you updated Typedoc comments for the `useAuth()` hook in `clerk/javascript`, you'll need to make sure that in `clerk-docs`, in the `/hooks/use-auth.mdx` file, there's a `<Typedoc />` component linked to the `./clerk-typedoc/clerk-react/use-auth.mdx` file, like:
Typedoc output is embedded in `clerk-docs` files with the `<Typedoc />` component. For example, if you updated Typedoc comments for the `useAuth()` hook in `clerk/javascript`, you'll need to make sure that in `clerk-docs`, in the `/hooks/use-auth.mdx` file, there's a `<Typedoc />` component linked to the `./clerk-typedoc/react/use-auth.mdx` file, like:

```mdx
<Typedoc src='clerk-react/use-auth' />
<Typedoc src='react/use-auth' />
```

Read more about this in the [`clerk-docs` CONTRIBUTING.md](https://github.com/clerk/clerk-docs/blob/main/CONTRIBUTING.md#typedoc-).
Expand Down
2 changes: 1 addition & 1 deletion integration/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -364,7 +364,7 @@ Assuming you have a `react-parcel` template defined in `integration/templates`,
.setName('react-parcel')
.useTemplate(templates['react-parcel'])
.setEnvFormatter('public', key => `${key}`)
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || clerkReactLocal);
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || clerkReactLocal);
```

Here's what each thing is doing:
Expand Down
2 changes: 1 addition & 1 deletion integration/presets/custom-flows.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,7 @@ const reactVite = applicationConfig()
.addScript('dev', 'pnpm dev')
.addScript('build', 'pnpm build')
.addScript('serve', 'pnpm preview')
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/themes', constants.E2E_CLERK_VERSION || linkPackage('themes'));

export const customFlows = {
Expand Down
2 changes: 1 addition & 1 deletion integration/presets/react.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,7 @@ const cra = applicationConfig()
.addScript('dev', 'pnpm start')
.addScript('build', 'pnpm build')
.addScript('serve', 'pnpm start')
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/themes', constants.E2E_CLERK_VERSION || linkPackage('themes'));

const vite = cra
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { BrowserRouter, Route, Routes } from 'react-router';
import './index.css';
import { ClerkProvider } from '@clerk/clerk-react';
import { ClerkProvider } from '@clerk/react';
import { Home } from './routes/Home';
import { SignIn } from './routes/SignIn';
import { SignUp } from './routes/SignUp';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { useUser } from '@clerk/clerk-react';
import { useUser } from '@clerk/react';

export function Protected() {
const { user, isLoaded } = useUser();
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,8 +5,8 @@ import { Button } from '@/components/ui/button';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { useUser } from '@clerk/clerk-react';
import { useSignInSignal } from '@clerk/clerk-react/experimental';
import { useUser } from '@clerk/react';
import { useSignInSignal } from '@clerk/react/experimental';
import { useState } from 'react';
import { NavLink, useNavigate } from 'react-router';

Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@ import { Button } from '@/components/ui/button';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { useSignUpSignal } from '@clerk/clerk-react/experimental';
import { useSignUpSignal } from '@clerk/react/experimental';
import { NavLink, useNavigate } from 'react-router';

export function SignUp({ className, ...props }: React.ComponentProps<'div'>) {
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-cra/src/App.tsx
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
// @ts-ignore
import React from 'react';
import './App.css';
import { SignedIn, SignedOut, SignIn, UserButton } from '@clerk/clerk-react';
import { SignedIn, SignedOut, SignIn, UserButton } from '@clerk/react';

function App() {
return (
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-cra/src/index.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import { ClerkProvider } from '@clerk/clerk-react';
import { ClerkProvider } from '@clerk/react';

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
root.render(
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/App.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationSwitcher, SignedIn, SignedOut, UserButton } from '@clerk/clerk-react';
import { OrganizationSwitcher, SignedIn, SignedOut, UserButton } from '@clerk/react';
import { Link } from 'react-router-dom';
import React from 'react';
import { ClientId } from './client-id';
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/buttons/index.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { SignInButton, SignUpButton } from '@clerk/clerk-react';
import { SignInButton, SignUpButton } from '@clerk/react';

export default function Home() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { ClerkLoaded, ClerkLoading, ClerkFailed, ClerkDegraded, useClerk } from '@clerk/clerk-react';
import { ClerkLoaded, ClerkLoading, ClerkFailed, ClerkDegraded, useClerk } from '@clerk/react';

export default function ClerkStatusPage() {
const { loaded, status } = useClerk();
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/client-id.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { useClerk, useSession } from '@clerk/clerk-react';
import { useClerk, useSession } from '@clerk/react';

export function ClientId() {
const clerk = useClerk();
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { CreateOrganization } from '@clerk/clerk-react';
import { CreateOrganization } from '@clerk/react';

export default function Page() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PropsWithChildren, useContext, useState } from 'react';
import { PageContext, PageContextProvider } from '../PageContext.tsx';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { useContext } from 'react';
import { PageContext, PageContextProvider } from '../PageContext.tsx';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PageContextProvider } from '../PageContext.tsx';
import { useState } from 'react';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PageContextProvider } from '../PageContext.tsx';
import React from 'react';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PageContextProvider } from '../PageContext.tsx';
import React from 'react';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserProfile } from '@clerk/clerk-react';
import { UserProfile } from '@clerk/react';
import { useContext } from 'react';
import { PageContext, PageContextProvider } from '../PageContext.tsx';

Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/main.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { ClerkProvider } from '@clerk/clerk-react';
import { ClerkProvider } from '@clerk/react';
import React from 'react';
import ReactDOM from 'react-dom/client';
import { createBrowserRouter, Outlet, RouterProvider, useNavigate } from 'react-router-dom';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationList } from '@clerk/clerk-react';
import { OrganizationList } from '@clerk/react';

export default function Page() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationProfile } from '@clerk/clerk-react';
import { OrganizationProfile } from '@clerk/react';

export default function Page() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationSwitcher } from '@clerk/clerk-react';
import { OrganizationSwitcher } from '@clerk/react';

export default function Page() {
return (
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/protected/index.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { SignedIn } from '@clerk/clerk-react';
import { SignedIn } from '@clerk/react';

export default function Page() {
return (
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/strong-bars-learn.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
---
'@clerk/chrome-extension': patch
'@clerk/elements': patch
'@clerk/clerk-expo': patch
'@clerk/nextjs': patch
'@clerk/react-router': patch
'@clerk/tanstack-react-start': patch
---

Use new `@clerk/react` package.
5 changes: 5 additions & 0 deletions .changeset/tame-suits-try.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
'@clerk/react': major
---

Change package name to `@clerk/react`.
20 changes: 16 additions & 4 deletions .cursor/rules/monorepo.mdc
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
---
description:
globs:
description:
globs:
alwaysApply: true
---

Monorepo Architecture and Structure

Repository Overview

- This is the official Clerk JavaScript SDK monorepo containing all Clerk authentication packages
- Clerk provides streamlined user experiences for sign up, sign in, and profile management
- All packages are published under the @clerk namespace on npm
- Uses pnpm as the package manager with Turbo for build orchestration
- Supports multiple JavaScript frameworks and environments

Core Package Categories

- **Core SDK**: `@clerk/clerk-js` - Core browser SDK with UI components
- **Framework Integrations**: Next.js, React, Vue, Astro, Nuxt, Remix, Express, Fastify
- **Platform Support**: Expo (React Native), Chrome Extension
Expand All@@ -23,6 +26,7 @@ Core Package Categories
- **Specialized**: `@clerk/agent-toolkit` - AI agent integration tools

Directory Structure

- `packages/` - All publishable packages
- `integration/` - End-to-end tests and integration templates
- `playground/` - Development and testing applications
Expand All@@ -31,6 +35,7 @@ Directory Structure
- `tools/` - Internal development tools

Development Workflow

- Use `pnpm dev` to start development mode for all packages
- Use `pnpm build` to build all packages
- Use `pnpm test` to run unit tests across all packages
Expand All@@ -39,8 +44,9 @@ Development Workflow
- Changesets for version management and release automation

Framework-Specific Packages

- `@clerk/nextjs` - Next.js App Router and Pages Router support
- `@clerk/clerk-react` - React hooks and components
- `@clerk/react` - React hooks and components
- `@clerk/vue` - Vue.js composables and components
- `@clerk/astro` - Astro integration with SSR support
- `@clerk/nuxt` - Nuxt.js module
Expand All@@ -50,6 +56,7 @@ Framework-Specific Packages
- `@clerk/expo` - React Native/Expo SDK

Testing Architecture

- Unit tests with Jest and Vitest
- Integration tests with Playwright
- Component testing with React Testing Library
Expand All@@ -58,6 +65,7 @@ Testing Architecture
- Separate test configurations per framework

Build System

- Turbo for monorepo orchestration and caching
- tsup for TypeScript compilation and bundling
- ESLint with custom configurations for different package types
Expand All@@ -66,26 +74,30 @@ Build System
- Type checking with TypeScript and publint

Environment Configuration
- Supports multiple Clerk environment variables (CLERK_*, NEXT_PUBLIC_CLERK_*, etc.)

- Supports multiple Clerk environment variables (CLERK*\*, NEXT_PUBLIC_CLERK*\*, etc.)
- Development, staging, and production configurations
- Verdaccio for local npm registry testing
- Docker support for integration testing
- CI/CD with GitHub Actions

Localization Support

- `packages/localizations/` contains translations for 30+ languages
- Modular localization system allowing partial imports
- Support for RTL languages
- Framework-agnostic translation utilities

Package Interdependency Rules

- `@clerk/shared` is a common dependency for most packages
- `@clerk/types` provides TypeScript definitions used across packages
- `@clerk/backend` is independent and used for server-side operations
- Framework packages depend on `@clerk/clerk-js` for core functionality
- Integration packages build upon framework-specific packages

Release Management

- Automated releases with Changesets
- Semantic versioning across all packages
- Canary and snapshot releases for testing
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -209,7 +209,7 @@ jobs:
matrix:
include:
- node-version: 20
test-filter: '--filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@clerk/nextjs --filter=@clerk/clerk-react --filter=@clerk/shared --filter=@clerk/remix --filter=@clerk/tanstack-react-start --filter=@clerk/elements --filter=@clerk/vue --filter=@clerk/nuxt --filter=@clerk/clerk-expo'
test-filter: '--filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@clerk/nextjs --filter=@clerk/react --filter=@clerk/shared --filter=@clerk/remix --filter=@clerk/tanstack-react-start --filter=@clerk/elements --filter=@clerk/vue --filter=@clerk/nuxt --filter=@clerk/clerk-expo'
- node-version: 22
test-filter: '**'

Expand Down
48 changes: 24 additions & 24 deletions .typedoc/__tests__/__snapshots__/file-structure.test.ts.snap
Original file line numberDiff line numberDiff line change
Expand Up@@ -199,6 +199,30 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = `
"shared/use-user.mdx",
"shared/user-agent-is-robot.mdx",
"shared/version-selector.mdx",
"react/api-keys.mdx",
"react/checkout-button-props.mdx",
"react/checkout-button.mdx",
"react/clerk-provider-props.mdx",
"react/plan-details-button-props.mdx",
"react/plan-details-button.mdx",
"react/protect.mdx",
"react/redirect-to-create-organization.mdx",
"react/redirect-to-organization-profile.mdx",
"react/redirect-to-user-profile.mdx",
"react/subscription-details-button-props.mdx",
"react/subscription-details-button.mdx",
"react/use-auth.mdx",
"react/use-clerk.mdx",
"react/use-organization-list.mdx",
"react/use-organization.mdx",
"react/use-reverification.mdx",
"react/use-session-list.mdx",
"react/use-session.mdx",
"react/use-sign-in-signal.mdx",
"react/use-sign-in.mdx",
"react/use-sign-up-signal.mdx",
"react/use-sign-up.mdx",
"react/use-user.mdx",
"nextjs/auth.mdx",
"nextjs/build-clerk-props.mdx",
"nextjs/clerk-middleware-auth-object.mdx",
Expand All@@ -208,30 +232,6 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = `
"nextjs/create-sync-get-auth.mdx",
"nextjs/current-user.mdx",
"nextjs/get-auth.mdx",
"clerk-react/api-keys.mdx",
"clerk-react/checkout-button-props.mdx",
"clerk-react/checkout-button.mdx",
"clerk-react/clerk-provider-props.mdx",
"clerk-react/plan-details-button-props.mdx",
"clerk-react/plan-details-button.mdx",
"clerk-react/protect.mdx",
"clerk-react/redirect-to-create-organization.mdx",
"clerk-react/redirect-to-organization-profile.mdx",
"clerk-react/redirect-to-user-profile.mdx",
"clerk-react/subscription-details-button-props.mdx",
"clerk-react/subscription-details-button.mdx",
"clerk-react/use-auth.mdx",
"clerk-react/use-clerk.mdx",
"clerk-react/use-organization-list.mdx",
"clerk-react/use-organization.mdx",
"clerk-react/use-reverification.mdx",
"clerk-react/use-session-list.mdx",
"clerk-react/use-session.mdx",
"clerk-react/use-sign-in-signal.mdx",
"clerk-react/use-sign-in.mdx",
"clerk-react/use-sign-up-signal.mdx",
"clerk-react/use-sign-up.mdx",
"clerk-react/use-user.mdx",
"backend/allowlist-identifier.mdx",
"backend/auth-object.mdx",
"backend/authenticate-request-options.mdx",
Expand Down
2 changes: 1 addition & 1 deletion .typedoc/__tests__/file-structure.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,8 +33,8 @@ describe('Typedoc output', () => {
expect(folders).toMatchInlineSnapshot(`
[
"backend",
"clerk-react",
"nextjs",
"react",
"shared",
"types",
]
Expand Down
6 changes: 3 additions & 3 deletions docs/CONTRIBUTING.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,7 +44,7 @@ All packages of the monorepo are inside [packages](../packages). For package spe

- [`@clerk/backend`](../packages/backend): Functionalities regarded as "core" for Clerk to operate with. _Authentication resolution, API Resources etc._
- [`@clerk/clerk-js`](../packages/clerk-js): Core JavaScript implementation used by Clerk in the browser.
- [`@clerk/clerk-react`](../packages/react) Clerk package for React applications.
- [`@clerk/react`](../packages/react) Clerk package for React applications.
- [`@clerk/types`](../packages/types): Main TypeScript typings for Clerk libraries.
- Browse [packages](../packages) to see more

Expand DownExpand Up@@ -186,10 +186,10 @@ To review your changes locally, you can run `pnpm run typedoc:generate` to gener

Create a PR that includes your changes to any Typedoc comments. Once the PR has been merged and a release is published, a PR will [automatically](https://github.com/clerk/clerk-docs/blob/main/.github/workflows/typedoc.yml) be opened in `clerk-docs` to merge in the Typedoc changes.

Typedoc output is embedded in `clerk-docs` files with the `<Typedoc />` component. For example, if you updated Typedoc comments for the `useAuth()` hook in `clerk/javascript`, you'll need to make sure that in `clerk-docs`, in the `/hooks/use-auth.mdx` file, there's a `<Typedoc />` component linked to the `./clerk-typedoc/clerk-react/use-auth.mdx` file, like:
Typedoc output is embedded in `clerk-docs` files with the `<Typedoc />` component. For example, if you updated Typedoc comments for the `useAuth()` hook in `clerk/javascript`, you'll need to make sure that in `clerk-docs`, in the `/hooks/use-auth.mdx` file, there's a `<Typedoc />` component linked to the `./clerk-typedoc/react/use-auth.mdx` file, like:

```mdx
<Typedoc src='clerk-react/use-auth' />
<Typedoc src='react/use-auth' />
```

Read more about this in the [`clerk-docs` CONTRIBUTING.md](https://github.com/clerk/clerk-docs/blob/main/CONTRIBUTING.md#typedoc-).
Expand Down
2 changes: 1 addition & 1 deletion integration/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -364,7 +364,7 @@ Assuming you have a `react-parcel` template defined in `integration/templates`,
.setName('react-parcel')
.useTemplate(templates['react-parcel'])
.setEnvFormatter('public', key => `${key}`)
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || clerkReactLocal);
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || clerkReactLocal);
```

Here's what each thing is doing:
Expand Down
2 changes: 1 addition & 1 deletion integration/presets/custom-flows.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,7 @@ const reactVite = applicationConfig()
.addScript('dev', 'pnpm dev')
.addScript('build', 'pnpm build')
.addScript('serve', 'pnpm preview')
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/themes', constants.E2E_CLERK_VERSION || linkPackage('themes'));

export const customFlows = {
Expand Down
2 changes: 1 addition & 1 deletion integration/presets/react.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,7 @@ const cra = applicationConfig()
.addScript('dev', 'pnpm start')
.addScript('build', 'pnpm build')
.addScript('serve', 'pnpm start')
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/themes', constants.E2E_CLERK_VERSION || linkPackage('themes'));

const vite = cra
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { BrowserRouter, Route, Routes } from 'react-router';
import './index.css';
import { ClerkProvider } from '@clerk/clerk-react';
import { ClerkProvider } from '@clerk/react';
import { Home } from './routes/Home';
import { SignIn } from './routes/SignIn';
import { SignUp } from './routes/SignUp';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { useUser } from '@clerk/clerk-react';
import { useUser } from '@clerk/react';

export function Protected() {
const { user, isLoaded } = useUser();
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,8 +5,8 @@ import { Button } from '@/components/ui/button';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { useUser } from '@clerk/clerk-react';
import { useSignInSignal } from '@clerk/clerk-react/experimental';
import { useUser } from '@clerk/react';
import { useSignInSignal } from '@clerk/react/experimental';
import { useState } from 'react';
import { NavLink, useNavigate } from 'react-router';

Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@ import { Button } from '@/components/ui/button';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { useSignUpSignal } from '@clerk/clerk-react/experimental';
import { useSignUpSignal } from '@clerk/react/experimental';
import { NavLink, useNavigate } from 'react-router';

export function SignUp({ className, ...props }: React.ComponentProps<'div'>) {
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-cra/src/App.tsx
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
// @ts-ignore
import React from 'react';
import './App.css';
import { SignedIn, SignedOut, SignIn, UserButton } from '@clerk/clerk-react';
import { SignedIn, SignedOut, SignIn, UserButton } from '@clerk/react';

function App() {
return (
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-cra/src/index.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import { ClerkProvider } from '@clerk/clerk-react';
import { ClerkProvider } from '@clerk/react';

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
root.render(
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/App.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationSwitcher, SignedIn, SignedOut, UserButton } from '@clerk/clerk-react';
import { OrganizationSwitcher, SignedIn, SignedOut, UserButton } from '@clerk/react';
import { Link } from 'react-router-dom';
import React from 'react';
import { ClientId } from './client-id';
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/buttons/index.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { SignInButton, SignUpButton } from '@clerk/clerk-react';
import { SignInButton, SignUpButton } from '@clerk/react';

export default function Home() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { ClerkLoaded, ClerkLoading, ClerkFailed, ClerkDegraded, useClerk } from '@clerk/clerk-react';
import { ClerkLoaded, ClerkLoading, ClerkFailed, ClerkDegraded, useClerk } from '@clerk/react';

export default function ClerkStatusPage() {
const { loaded, status } = useClerk();
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/client-id.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { useClerk, useSession } from '@clerk/clerk-react';
import { useClerk, useSession } from '@clerk/react';

export function ClientId() {
const clerk = useClerk();
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { CreateOrganization } from '@clerk/clerk-react';
import { CreateOrganization } from '@clerk/react';

export default function Page() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PropsWithChildren, useContext, useState } from 'react';
import { PageContext, PageContextProvider } from '../PageContext.tsx';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { useContext } from 'react';
import { PageContext, PageContextProvider } from '../PageContext.tsx';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PageContextProvider } from '../PageContext.tsx';
import { useState } from 'react';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PageContextProvider } from '../PageContext.tsx';
import React from 'react';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PageContextProvider } from '../PageContext.tsx';
import React from 'react';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserProfile } from '@clerk/clerk-react';
import { UserProfile } from '@clerk/react';
import { useContext } from 'react';
import { PageContext, PageContextProvider } from '../PageContext.tsx';

Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/main.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { ClerkProvider } from '@clerk/clerk-react';
import { ClerkProvider } from '@clerk/react';
import React from 'react';
import ReactDOM from 'react-dom/client';
import { createBrowserRouter, Outlet, RouterProvider, useNavigate } from 'react-router-dom';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationList } from '@clerk/clerk-react';
import { OrganizationList } from '@clerk/react';

export default function Page() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationProfile } from '@clerk/clerk-react';
import { OrganizationProfile } from '@clerk/react';

export default function Page() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationSwitcher } from '@clerk/clerk-react';
import { OrganizationSwitcher } from '@clerk/react';

export default function Page() {
return (
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/protected/index.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { SignedIn } from '@clerk/clerk-react';
import { SignedIn } from '@clerk/react';

export default function Page() {
return (
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/strong-bars-learn.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
---
'@clerk/chrome-extension': patch
'@clerk/elements': patch
'@clerk/clerk-expo': patch
'@clerk/nextjs': patch
'@clerk/react-router': patch
'@clerk/tanstack-react-start': patch
---

Use new `@clerk/react` package.
5 changes: 5 additions & 0 deletions .changeset/tame-suits-try.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
---
'@clerk/react': major
---

Change package name to `@clerk/react`.
20 changes: 16 additions & 4 deletions .cursor/rules/monorepo.mdc
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
---
description:
globs:
description:
globs:
alwaysApply: true
---

Monorepo Architecture and Structure

Repository Overview

- This is the official Clerk JavaScript SDK monorepo containing all Clerk authentication packages
- Clerk provides streamlined user experiences for sign up, sign in, and profile management
- All packages are published under the @clerk namespace on npm
- Uses pnpm as the package manager with Turbo for build orchestration
- Supports multiple JavaScript frameworks and environments

Core Package Categories

- **Core SDK**: `@clerk/clerk-js` - Core browser SDK with UI components
- **Framework Integrations**: Next.js, React, Vue, Astro, Nuxt, Remix, Express, Fastify
- **Platform Support**: Expo (React Native), Chrome Extension
Expand All@@ -23,6 +26,7 @@ Core Package Categories
- **Specialized**: `@clerk/agent-toolkit` - AI agent integration tools

Directory Structure

- `packages/` - All publishable packages
- `integration/` - End-to-end tests and integration templates
- `playground/` - Development and testing applications
Expand All@@ -31,6 +35,7 @@ Directory Structure
- `tools/` - Internal development tools

Development Workflow

- Use `pnpm dev` to start development mode for all packages
- Use `pnpm build` to build all packages
- Use `pnpm test` to run unit tests across all packages
Expand All@@ -39,8 +44,9 @@ Development Workflow
- Changesets for version management and release automation

Framework-Specific Packages

- `@clerk/nextjs` - Next.js App Router and Pages Router support
- `@clerk/clerk-react` - React hooks and components
- `@clerk/react` - React hooks and components
- `@clerk/vue` - Vue.js composables and components
- `@clerk/astro` - Astro integration with SSR support
- `@clerk/nuxt` - Nuxt.js module
Expand All@@ -50,6 +56,7 @@ Framework-Specific Packages
- `@clerk/expo` - React Native/Expo SDK

Testing Architecture

- Unit tests with Jest and Vitest
- Integration tests with Playwright
- Component testing with React Testing Library
Expand All@@ -58,6 +65,7 @@ Testing Architecture
- Separate test configurations per framework

Build System

- Turbo for monorepo orchestration and caching
- tsup for TypeScript compilation and bundling
- ESLint with custom configurations for different package types
Expand All@@ -66,26 +74,30 @@ Build System
- Type checking with TypeScript and publint

Environment Configuration
- Supports multiple Clerk environment variables (CLERK_*, NEXT_PUBLIC_CLERK_*, etc.)

- Supports multiple Clerk environment variables (CLERK*\*, NEXT_PUBLIC_CLERK*\*, etc.)
- Development, staging, and production configurations
- Verdaccio for local npm registry testing
- Docker support for integration testing
- CI/CD with GitHub Actions

Localization Support

- `packages/localizations/` contains translations for 30+ languages
- Modular localization system allowing partial imports
- Support for RTL languages
- Framework-agnostic translation utilities

Package Interdependency Rules

- `@clerk/shared` is a common dependency for most packages
- `@clerk/types` provides TypeScript definitions used across packages
- `@clerk/backend` is independent and used for server-side operations
- Framework packages depend on `@clerk/clerk-js` for core functionality
- Integration packages build upon framework-specific packages

Release Management

- Automated releases with Changesets
- Semantic versioning across all packages
- Canary and snapshot releases for testing
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -209,7 +209,7 @@ jobs:
matrix:
include:
- node-version: 20
test-filter: '--filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@clerk/nextjs --filter=@clerk/clerk-react --filter=@clerk/shared --filter=@clerk/remix --filter=@clerk/tanstack-react-start --filter=@clerk/elements --filter=@clerk/vue --filter=@clerk/nuxt --filter=@clerk/clerk-expo'
test-filter: '--filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@clerk/nextjs --filter=@clerk/react --filter=@clerk/shared --filter=@clerk/remix --filter=@clerk/tanstack-react-start --filter=@clerk/elements --filter=@clerk/vue --filter=@clerk/nuxt --filter=@clerk/clerk-expo'
- node-version: 22
test-filter: '**'

Expand Down
48 changes: 24 additions & 24 deletions .typedoc/__tests__/__snapshots__/file-structure.test.ts.snap
Original file line numberDiff line numberDiff line change
Expand Up@@ -199,6 +199,30 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = `
"shared/use-user.mdx",
"shared/user-agent-is-robot.mdx",
"shared/version-selector.mdx",
"react/api-keys.mdx",
"react/checkout-button-props.mdx",
"react/checkout-button.mdx",
"react/clerk-provider-props.mdx",
"react/plan-details-button-props.mdx",
"react/plan-details-button.mdx",
"react/protect.mdx",
"react/redirect-to-create-organization.mdx",
"react/redirect-to-organization-profile.mdx",
"react/redirect-to-user-profile.mdx",
"react/subscription-details-button-props.mdx",
"react/subscription-details-button.mdx",
"react/use-auth.mdx",
"react/use-clerk.mdx",
"react/use-organization-list.mdx",
"react/use-organization.mdx",
"react/use-reverification.mdx",
"react/use-session-list.mdx",
"react/use-session.mdx",
"react/use-sign-in-signal.mdx",
"react/use-sign-in.mdx",
"react/use-sign-up-signal.mdx",
"react/use-sign-up.mdx",
"react/use-user.mdx",
"nextjs/auth.mdx",
"nextjs/build-clerk-props.mdx",
"nextjs/clerk-middleware-auth-object.mdx",
Expand All@@ -208,30 +232,6 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = `
"nextjs/create-sync-get-auth.mdx",
"nextjs/current-user.mdx",
"nextjs/get-auth.mdx",
"clerk-react/api-keys.mdx",
"clerk-react/checkout-button-props.mdx",
"clerk-react/checkout-button.mdx",
"clerk-react/clerk-provider-props.mdx",
"clerk-react/plan-details-button-props.mdx",
"clerk-react/plan-details-button.mdx",
"clerk-react/protect.mdx",
"clerk-react/redirect-to-create-organization.mdx",
"clerk-react/redirect-to-organization-profile.mdx",
"clerk-react/redirect-to-user-profile.mdx",
"clerk-react/subscription-details-button-props.mdx",
"clerk-react/subscription-details-button.mdx",
"clerk-react/use-auth.mdx",
"clerk-react/use-clerk.mdx",
"clerk-react/use-organization-list.mdx",
"clerk-react/use-organization.mdx",
"clerk-react/use-reverification.mdx",
"clerk-react/use-session-list.mdx",
"clerk-react/use-session.mdx",
"clerk-react/use-sign-in-signal.mdx",
"clerk-react/use-sign-in.mdx",
"clerk-react/use-sign-up-signal.mdx",
"clerk-react/use-sign-up.mdx",
"clerk-react/use-user.mdx",
"backend/allowlist-identifier.mdx",
"backend/auth-object.mdx",
"backend/authenticate-request-options.mdx",
Expand Down
2 changes: 1 addition & 1 deletion .typedoc/__tests__/file-structure.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,8 +33,8 @@ describe('Typedoc output', () => {
expect(folders).toMatchInlineSnapshot(`
[
"backend",
"clerk-react",
"nextjs",
"react",
"shared",
"types",
]
Expand Down
6 changes: 3 additions & 3 deletions docs/CONTRIBUTING.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,7 +44,7 @@ All packages of the monorepo are inside [packages](../packages). For package spe

- [`@clerk/backend`](../packages/backend): Functionalities regarded as "core" for Clerk to operate with. _Authentication resolution, API Resources etc._
- [`@clerk/clerk-js`](../packages/clerk-js): Core JavaScript implementation used by Clerk in the browser.
- [`@clerk/clerk-react`](../packages/react) Clerk package for React applications.
- [`@clerk/react`](../packages/react) Clerk package for React applications.
- [`@clerk/types`](../packages/types): Main TypeScript typings for Clerk libraries.
- Browse [packages](../packages) to see more

Expand DownExpand Up@@ -186,10 +186,10 @@ To review your changes locally, you can run `pnpm run typedoc:generate` to gener

Create a PR that includes your changes to any Typedoc comments. Once the PR has been merged and a release is published, a PR will [automatically](https://github.com/clerk/clerk-docs/blob/main/.github/workflows/typedoc.yml) be opened in `clerk-docs` to merge in the Typedoc changes.

Typedoc output is embedded in `clerk-docs` files with the `<Typedoc />` component. For example, if you updated Typedoc comments for the `useAuth()` hook in `clerk/javascript`, you'll need to make sure that in `clerk-docs`, in the `/hooks/use-auth.mdx` file, there's a `<Typedoc />` component linked to the `./clerk-typedoc/clerk-react/use-auth.mdx` file, like:
Typedoc output is embedded in `clerk-docs` files with the `<Typedoc />` component. For example, if you updated Typedoc comments for the `useAuth()` hook in `clerk/javascript`, you'll need to make sure that in `clerk-docs`, in the `/hooks/use-auth.mdx` file, there's a `<Typedoc />` component linked to the `./clerk-typedoc/react/use-auth.mdx` file, like:

```mdx
<Typedoc src='clerk-react/use-auth' />
<Typedoc src='react/use-auth' />
```

Read more about this in the [`clerk-docs` CONTRIBUTING.md](https://github.com/clerk/clerk-docs/blob/main/CONTRIBUTING.md#typedoc-).
Expand Down
2 changes: 1 addition & 1 deletion integration/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -364,7 +364,7 @@ Assuming you have a `react-parcel` template defined in `integration/templates`,
.setName('react-parcel')
.useTemplate(templates['react-parcel'])
.setEnvFormatter('public', key => `${key}`)
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || clerkReactLocal);
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || clerkReactLocal);
```

Here's what each thing is doing:
Expand Down
2 changes: 1 addition & 1 deletion integration/presets/custom-flows.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,7 @@ const reactVite = applicationConfig()
.addScript('dev', 'pnpm dev')
.addScript('build', 'pnpm build')
.addScript('serve', 'pnpm preview')
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/themes', constants.E2E_CLERK_VERSION || linkPackage('themes'));

export const customFlows = {
Expand Down
2 changes: 1 addition & 1 deletion integration/presets/react.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,7 @@ const cra = applicationConfig()
.addScript('dev', 'pnpm start')
.addScript('build', 'pnpm build')
.addScript('serve', 'pnpm start')
.addDependency('@clerk/clerk-react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/react', constants.E2E_CLERK_VERSION || linkPackage('react'))
.addDependency('@clerk/themes', constants.E2E_CLERK_VERSION || linkPackage('themes'));

const vite = cra
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { BrowserRouter, Route, Routes } from 'react-router';
import './index.css';
import { ClerkProvider } from '@clerk/clerk-react';
import { ClerkProvider } from '@clerk/react';
import { Home } from './routes/Home';
import { SignIn } from './routes/SignIn';
import { SignUp } from './routes/SignUp';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { useUser } from '@clerk/clerk-react';
import { useUser } from '@clerk/react';

export function Protected() {
const { user, isLoaded } = useUser();
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,8 +5,8 @@ import { Button } from '@/components/ui/button';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { useUser } from '@clerk/clerk-react';
import { useSignInSignal } from '@clerk/clerk-react/experimental';
import { useUser } from '@clerk/react';
import { useSignInSignal } from '@clerk/react/experimental';
import { useState } from 'react';
import { NavLink, useNavigate } from 'react-router';

Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@ import { Button } from '@/components/ui/button';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { useSignUpSignal } from '@clerk/clerk-react/experimental';
import { useSignUpSignal } from '@clerk/react/experimental';
import { NavLink, useNavigate } from 'react-router';

export function SignUp({ className, ...props }: React.ComponentProps<'div'>) {
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-cra/src/App.tsx
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
// @ts-ignore
import React from 'react';
import './App.css';
import { SignedIn, SignedOut, SignIn, UserButton } from '@clerk/clerk-react';
import { SignedIn, SignedOut, SignIn, UserButton } from '@clerk/react';

function App() {
return (
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-cra/src/index.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import { ClerkProvider } from '@clerk/clerk-react';
import { ClerkProvider } from '@clerk/react';

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
root.render(
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/App.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationSwitcher, SignedIn, SignedOut, UserButton } from '@clerk/clerk-react';
import { OrganizationSwitcher, SignedIn, SignedOut, UserButton } from '@clerk/react';
import { Link } from 'react-router-dom';
import React from 'react';
import { ClientId } from './client-id';
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/buttons/index.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { SignInButton, SignUpButton } from '@clerk/clerk-react';
import { SignInButton, SignUpButton } from '@clerk/react';

export default function Home() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { ClerkLoaded, ClerkLoading, ClerkFailed, ClerkDegraded, useClerk } from '@clerk/clerk-react';
import { ClerkLoaded, ClerkLoading, ClerkFailed, ClerkDegraded, useClerk } from '@clerk/react';

export default function ClerkStatusPage() {
const { loaded, status } = useClerk();
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/client-id.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { useClerk, useSession } from '@clerk/clerk-react';
import { useClerk, useSession } from '@clerk/react';

export function ClientId() {
const clerk = useClerk();
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { CreateOrganization } from '@clerk/clerk-react';
import { CreateOrganization } from '@clerk/react';

export default function Page() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PropsWithChildren, useContext, useState } from 'react';
import { PageContext, PageContextProvider } from '../PageContext.tsx';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { useContext } from 'react';
import { PageContext, PageContextProvider } from '../PageContext.tsx';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PageContextProvider } from '../PageContext.tsx';
import { useState } from 'react';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PageContextProvider } from '../PageContext.tsx';
import React from 'react';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserButton } from '@clerk/clerk-react';
import { UserButton } from '@clerk/react';
import { PageContextProvider } from '../PageContext.tsx';
import React from 'react';

Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { UserProfile } from '@clerk/clerk-react';
import { UserProfile } from '@clerk/react';
import { useContext } from 'react';
import { PageContext, PageContextProvider } from '../PageContext.tsx';

Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/main.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { ClerkProvider } from '@clerk/clerk-react';
import { ClerkProvider } from '@clerk/react';
import React from 'react';
import ReactDOM from 'react-dom/client';
import { createBrowserRouter, Outlet, RouterProvider, useNavigate } from 'react-router-dom';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationList } from '@clerk/clerk-react';
import { OrganizationList } from '@clerk/react';

export default function Page() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationProfile } from '@clerk/clerk-react';
import { OrganizationProfile } from '@clerk/react';

export default function Page() {
return (
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { OrganizationSwitcher } from '@clerk/clerk-react';
import { OrganizationSwitcher } from '@clerk/react';

export default function Page() {
return (
Expand Down
2 changes: 1 addition & 1 deletion integration/templates/react-vite/src/protected/index.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { SignedIn } from '@clerk/clerk-react';
import { SignedIn } from '@clerk/react';

export default function Page() {
return (
Expand Down
Loading
Loading