[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-clerk-clerk-react-router-patterns":3,"mdc-uh2m3v-key":37,"related-org-clerk-clerk-react-router-patterns":3278,"related-repo-clerk-clerk-react-router-patterns":3468},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":26,"repoUrl":27,"updatedAt":28,"license":29,"forks":30,"topics":31,"repo":32,"sourceUrl":35,"mdContent":36},"clerk-react-router-patterns","implement Clerk auth in React Router v7","React Router v7\u002Fv8 patterns with Clerk — rootAuthLoader, getAuth in loaders, clerkMiddleware, protected routes, SSR user data, org switching. Triggers on: react-router auth, rootAuthLoader, getAuth loader, react-router protected route, loader authentication, SSR auth react-router, useNavigate may be used only in the context of a Router.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"clerk","Clerk","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fclerk.png",[12,16,17,20,23],{"name":13,"slug":14,"type":15},"Backend","backend","tag",{"name":9,"slug":8,"type":15},{"name":18,"slug":19,"type":15},"Authentication","authentication",{"name":21,"slug":22,"type":15},"Frontend","frontend",{"name":24,"slug":25,"type":15},"React Router","react-router",59,"https:\u002F\u002Fgithub.com\u002Fclerk\u002Fskills","2026-04-07T04:46:15.924706","MIT",4,[],{"repoUrl":27,"stars":26,"forks":30,"topics":33,"description":34},[],"AI Skills to enhance working with Clerk","https:\u002F\u002Fgithub.com\u002Fclerk\u002Fskills\u002Ftree\u002FHEAD\u002Fskills\u002Fframeworks\u002Fclerk-react-router-patterns","---\nname: clerk-react-router-patterns\ndescription: 'React Router v7\u002Fv8 patterns with Clerk — rootAuthLoader, getAuth in loaders,\n  clerkMiddleware, protected routes, SSR user data, org switching. Triggers on: react-router\n  auth, rootAuthLoader, getAuth loader, react-router protected route, loader authentication,\n  SSR auth react-router, useNavigate may be used only in the context of a Router.'\nlicense: MIT\nallowed-tools: WebFetch\nmetadata:\n  author: clerk\n  version: 1.1.0\n---\n\n# React Router Patterns\n\nSDK: `@clerk\u002Freact-router` v3.5+. Supports React Router v7.9+ and v8.\n\n## What Do You Need?\n\n| Task | Reference |\n|------|-----------|\n| Auth in loaders and actions | references\u002Floaders-actions.md |\n| Protected routes and redirects | references\u002Fprotected-routes.md |\n| SSR user data and session | references\u002Fssr-auth.md |\n\n## React Router v7 vs v8\n\nCheck the installed `react-router` major version before scaffolding — the config differs:\n\n| | v7.9+ | v8+ |\n|--|--|--|\n| Middleware API | Opt-in: set `future: { v8_middleware: true }` in `react-router.config.ts` | Always on — do NOT set the flag (v8 removed it) |\n| `ssr.noExternal` workaround (below) | Not needed | **Required** |\n\n## Minimal Setup\n\n### 1. vite.config.ts (v8 only — REQUIRED)\n\nReact Router v8 ships development\u002Fproduction conditional exports. In `react-router dev`,\nVite externalizes `@clerk\u002Freact-router` for SSR, so Node resolves the production build of\nreact-router while the app code gets the development build — two module instances, two\nRouter contexts. Every request then fails during SSR with:\n\n```\nError: useNavigate() may be used only in the context of a \u003CRouter> component.\n```\n\n**`npm ls react-router` shows a single copy — that does NOT rule this out.** The\nduplication is per export condition, not per installed copy. Do not chase duplicate\ninstalls; add the workaround (upstream issue:\nhttps:\u002F\u002Fgithub.com\u002Fremix-run\u002Freact-router\u002Fissues\u002F15232):\n\n```ts\nimport { reactRouter } from '@react-router\u002Fdev\u002Fvite'\nimport { defineConfig } from 'vite'\n\nexport default defineConfig({\n  plugins: [reactRouter()],\n  ssr: {\n    noExternal: ['@clerk\u002Freact-router'],\n  },\n})\n```\n\n### 2. root.tsx\n\n```tsx\nimport { Outlet } from 'react-router'\nimport { rootAuthLoader, clerkMiddleware } from '@clerk\u002Freact-router\u002Fserver'\nimport { ClerkProvider } from '@clerk\u002Freact-router'\nimport type { Route } from '.\u002F+types\u002Froot'\n\nexport const middleware: Route.MiddlewareFunction[] = [clerkMiddleware()]\n\nexport async function loader(args: Route.LoaderArgs) {\n  return rootAuthLoader(args)\n}\n\nexport default function App({ loaderData }: Route.ComponentProps) {\n  return (\n    \u003CClerkProvider loaderData={loaderData}>\n      \u003COutlet \u002F>\n    \u003C\u002FClerkProvider>\n  )\n}\n```\n\nThere is no `ClerkApp` HOC in `@clerk\u002Freact-router` (that was the `@clerk\u002Fremix` API).\nRender `\u003CClerkProvider loaderData={loaderData}>` inside the default export and pass it\nthe root route's `loaderData`.\n\n### 3. react-router.config.ts (v7 only)\n\n```ts\nimport type { Config } from '@react-router\u002Fdev\u002Fconfig'\n\nexport default {\n  future: {\n    v8_middleware: true,\n  },\n} satisfies Config\n```\n\nOn v8, omit the `future` block entirely — the flag no longer exists.\n\n> **Required**: `rootAuthLoader` must be called in `root.tsx`'s loader. Without it, `getAuth` throws in nested loaders.\n\n## Mental Model\n\nReact Router v7\u002Fv8 uses a middleware + loader pipeline. Clerk plugs into both layers:\n\n- **Middleware** (`clerkMiddleware()`) — runs on every request, attaches auth to context\n- **`rootAuthLoader`** — required in `root.tsx` to pass Clerk state to the client\n- **`getAuth(args)`** — called inside any loader\u002Faction to get the current user\n\n```\nRequest → clerkMiddleware() → rootAuthLoader → page loader → component\n                 ↓                   ↓               ↓\n           attaches auth      injects state     getAuth(args)\n           to context         to response       reads context\n```\n\n## Auth in Loaders\n\n```tsx\nimport { getAuth } from '@clerk\u002Freact-router\u002Fserver'\nimport type { Route } from '.\u002F+types\u002Fdashboard'\n\nexport async function loader(args: Route.LoaderArgs) {\n  const { userId } = await getAuth(args)\n  if (!userId) throw redirect('\u002Fsign-in')\n\n  const data = await fetchUserData(userId)\n  return { data }\n}\n```\n\n## Auth in Actions\n\n```tsx\nimport { getAuth } from '@clerk\u002Freact-router\u002Fserver'\n\nexport async function action(args: Route.ActionArgs) {\n  const { userId, orgId } = await getAuth(args)\n  if (!userId) throw new Response('Unauthorized', { status: 401 })\n\n  const formData = await args.request.formData()\n  await saveData(userId, orgId, formData)\n  return redirect('\u002Fdashboard')\n}\n```\n\n## Client Components\n\n```tsx\nimport { useAuth, useUser } from '@clerk\u002Freact-router'\n\nexport function Profile() {\n  const { userId, isSignedIn } = useAuth()\n  const { user } = useUser()\n  if (!isSignedIn) return null\n  return \u003Cp>{user?.firstName}\u003C\u002Fp>\n}\n```\n\n## Org Switching\n\n```tsx\nimport { OrganizationSwitcher } from '@clerk\u002Freact-router'\n\nexport function Nav() {\n  return \u003COrganizationSwitcher afterSelectOrganizationUrl=\"\u002Fdashboard\" \u002F>\n}\n```\n\n```tsx\nexport async function loader(args: Route.LoaderArgs) {\n  const { userId, orgId } = await getAuth(args)\n  if (!userId) throw redirect('\u002Fsign-in')\n  if (!orgId) throw redirect('\u002Fselect-org')\n\n  return { data: await fetchOrgData(orgId) }\n}\n```\n\n## Common Pitfalls\n\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| `useNavigate() may be used only in the context of a \u003CRouter>` thrown from ClerkProvider during SSR in dev (v8) | Vite dev SSR externalizes `@clerk\u002Freact-router`, which then loads react-router's production build while the app uses the development build — two Router contexts. A single copy in `npm ls` does not rule this out. | Add `ssr: { noExternal: ['@clerk\u002Freact-router'] }` to `vite.config.ts`. Do NOT downgrade to v7 |\n| Build error: `ClerkApp` is not exported | `ClerkApp` does not exist in `@clerk\u002Freact-router` | Use `\u003CClerkProvider loaderData={loaderData}>` in root.tsx's default export |\n| `clerkMiddleware() not detected` | Missing middleware (or on v7, missing `v8_middleware` future flag) | Export `middleware = [clerkMiddleware()]` from root route; on v7 also set `future: { v8_middleware: true }` |\n| Unknown future flag error\u002Fwarning (v8) | `v8_middleware` flag left in `react-router.config.ts` after upgrading | Remove the `future.v8_middleware` entry — middleware is always on in v8 |\n| `getAuth` returns empty userId | `rootAuthLoader` not called | Call `rootAuthLoader(args)` in `root.tsx` loader |\n| Infinite redirect loop | Redirect target is also protected | Exclude `\u002Fsign-in` from protection check |\n| `redirect` not working in action | Using `Response` instead of `throw redirect()` | Use `throw redirect('\u002Fpath')` from `react-router` |\n\n## Import Map\n\n| What | Import From |\n|------|-------------|\n| `getAuth` | `@clerk\u002Freact-router\u002Fserver` |\n| `rootAuthLoader` | `@clerk\u002Freact-router\u002Fserver` |\n| `clerkMiddleware` | `@clerk\u002Freact-router\u002Fserver` |\n| `ClerkProvider` | `@clerk\u002Freact-router` |\n| `useAuth`, `useUser` | `@clerk\u002Freact-router` |\n| `OrganizationSwitcher` | `@clerk\u002Freact-router` |\n\n## See Also\n\n- `clerk-setup` - Initial Clerk install\n- `clerk-custom-ui` - Custom flows & appearance\n- `clerk-orgs` - B2B organizations\n\n## Docs\n\n[React Router SDK](https:\u002F\u002Fclerk.com\u002Fdocs\u002Freact-router\u002Fgetting-started\u002Fquickstart)\n",{"data":38,"body":42},{"name":4,"description":6,"license":29,"allowed-tools":39,"metadata":40},"WebFetch",{"author":8,"version":41},"1.1.0",{"type":43,"children":44},"root",[45,54,69,76,143,149,161,246,252,259,279,291,317,567,573,1074,1116,1122,1254,1267,1304,1310,1315,1372,1381,1387,1704,1710,2084,2090,2336,2342,2465,2736,2742,3063,3069,3214,3220,3256,3262,3272],{"type":46,"tag":47,"props":48,"children":50},"element","h1",{"id":49},"react-router-patterns",[51],{"type":52,"value":53},"text","React Router Patterns",{"type":46,"tag":55,"props":56,"children":57},"p",{},[58,60,67],{"type":52,"value":59},"SDK: ",{"type":46,"tag":61,"props":62,"children":64},"code",{"className":63},[],[65],{"type":52,"value":66},"@clerk\u002Freact-router",{"type":52,"value":68}," v3.5+. Supports React Router v7.9+ and v8.",{"type":46,"tag":70,"props":71,"children":73},"h2",{"id":72},"what-do-you-need",[74],{"type":52,"value":75},"What Do You Need?",{"type":46,"tag":77,"props":78,"children":79},"table",{},[80,99],{"type":46,"tag":81,"props":82,"children":83},"thead",{},[84],{"type":46,"tag":85,"props":86,"children":87},"tr",{},[88,94],{"type":46,"tag":89,"props":90,"children":91},"th",{},[92],{"type":52,"value":93},"Task",{"type":46,"tag":89,"props":95,"children":96},{},[97],{"type":52,"value":98},"Reference",{"type":46,"tag":100,"props":101,"children":102},"tbody",{},[103,117,130],{"type":46,"tag":85,"props":104,"children":105},{},[106,112],{"type":46,"tag":107,"props":108,"children":109},"td",{},[110],{"type":52,"value":111},"Auth in loaders and actions",{"type":46,"tag":107,"props":113,"children":114},{},[115],{"type":52,"value":116},"references\u002Floaders-actions.md",{"type":46,"tag":85,"props":118,"children":119},{},[120,125],{"type":46,"tag":107,"props":121,"children":122},{},[123],{"type":52,"value":124},"Protected routes and redirects",{"type":46,"tag":107,"props":126,"children":127},{},[128],{"type":52,"value":129},"references\u002Fprotected-routes.md",{"type":46,"tag":85,"props":131,"children":132},{},[133,138],{"type":46,"tag":107,"props":134,"children":135},{},[136],{"type":52,"value":137},"SSR user data and session",{"type":46,"tag":107,"props":139,"children":140},{},[141],{"type":52,"value":142},"references\u002Fssr-auth.md",{"type":46,"tag":70,"props":144,"children":146},{"id":145},"react-router-v7-vs-v8",[147],{"type":52,"value":148},"React Router v7 vs v8",{"type":46,"tag":55,"props":150,"children":151},{},[152,154,159],{"type":52,"value":153},"Check the installed ",{"type":46,"tag":61,"props":155,"children":157},{"className":156},[],[158],{"type":52,"value":25},{"type":52,"value":160}," major version before scaffolding — the config differs:",{"type":46,"tag":77,"props":162,"children":163},{},[164,183],{"type":46,"tag":81,"props":165,"children":166},{},[167],{"type":46,"tag":85,"props":168,"children":169},{},[170,173,178],{"type":46,"tag":89,"props":171,"children":172},{},[],{"type":46,"tag":89,"props":174,"children":175},{},[176],{"type":52,"value":177},"v7.9+",{"type":46,"tag":89,"props":179,"children":180},{},[181],{"type":52,"value":182},"v8+",{"type":46,"tag":100,"props":184,"children":185},{},[186,218],{"type":46,"tag":85,"props":187,"children":188},{},[189,194,213],{"type":46,"tag":107,"props":190,"children":191},{},[192],{"type":52,"value":193},"Middleware API",{"type":46,"tag":107,"props":195,"children":196},{},[197,199,205,207],{"type":52,"value":198},"Opt-in: set ",{"type":46,"tag":61,"props":200,"children":202},{"className":201},[],[203],{"type":52,"value":204},"future: { v8_middleware: true }",{"type":52,"value":206}," in ",{"type":46,"tag":61,"props":208,"children":210},{"className":209},[],[211],{"type":52,"value":212},"react-router.config.ts",{"type":46,"tag":107,"props":214,"children":215},{},[216],{"type":52,"value":217},"Always on — do NOT set the flag (v8 removed it)",{"type":46,"tag":85,"props":219,"children":220},{},[221,232,237],{"type":46,"tag":107,"props":222,"children":223},{},[224,230],{"type":46,"tag":61,"props":225,"children":227},{"className":226},[],[228],{"type":52,"value":229},"ssr.noExternal",{"type":52,"value":231}," workaround (below)",{"type":46,"tag":107,"props":233,"children":234},{},[235],{"type":52,"value":236},"Not needed",{"type":46,"tag":107,"props":238,"children":239},{},[240],{"type":46,"tag":241,"props":242,"children":243},"strong",{},[244],{"type":52,"value":245},"Required",{"type":46,"tag":70,"props":247,"children":249},{"id":248},"minimal-setup",[250],{"type":52,"value":251},"Minimal Setup",{"type":46,"tag":253,"props":254,"children":256},"h3",{"id":255},"_1-viteconfigts-v8-only-required",[257],{"type":52,"value":258},"1. vite.config.ts (v8 only — REQUIRED)",{"type":46,"tag":55,"props":260,"children":261},{},[262,264,270,272,277],{"type":52,"value":263},"React Router v8 ships development\u002Fproduction conditional exports. In ",{"type":46,"tag":61,"props":265,"children":267},{"className":266},[],[268],{"type":52,"value":269},"react-router dev",{"type":52,"value":271},",\nVite externalizes ",{"type":46,"tag":61,"props":273,"children":275},{"className":274},[],[276],{"type":52,"value":66},{"type":52,"value":278}," for SSR, so Node resolves the production build of\nreact-router while the app code gets the development build — two module instances, two\nRouter contexts. Every request then fails during SSR with:",{"type":46,"tag":280,"props":281,"children":285},"pre",{"className":282,"code":284,"language":52},[283],"language-text","Error: useNavigate() may be used only in the context of a \u003CRouter> component.\n",[286],{"type":46,"tag":61,"props":287,"children":289},{"__ignoreMap":288},"",[290],{"type":52,"value":284},{"type":46,"tag":55,"props":292,"children":293},{},[294,305,307,315],{"type":46,"tag":241,"props":295,"children":296},{},[297,303],{"type":46,"tag":61,"props":298,"children":300},{"className":299},[],[301],{"type":52,"value":302},"npm ls react-router",{"type":52,"value":304}," shows a single copy — that does NOT rule this out.",{"type":52,"value":306}," The\nduplication is per export condition, not per installed copy. Do not chase duplicate\ninstalls; add the workaround (upstream issue:\n",{"type":46,"tag":308,"props":309,"children":313},"a",{"href":310,"rel":311},"https:\u002F\u002Fgithub.com\u002Fremix-run\u002Freact-router\u002Fissues\u002F15232",[312],"nofollow",[314],{"type":52,"value":310},{"type":52,"value":316},"):",{"type":46,"tag":280,"props":318,"children":322},{"className":319,"code":320,"language":321,"meta":288,"style":288},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { reactRouter } from '@react-router\u002Fdev\u002Fvite'\nimport { defineConfig } from 'vite'\n\nexport default defineConfig({\n  plugins: [reactRouter()],\n  ssr: {\n    noExternal: ['@clerk\u002Freact-router'],\n  },\n})\n","ts",[323],{"type":46,"tag":61,"props":324,"children":325},{"__ignoreMap":288},[326,376,414,424,452,487,505,544,553],{"type":46,"tag":327,"props":328,"children":331},"span",{"class":329,"line":330},"line",1,[332,338,344,350,355,360,365,371],{"type":46,"tag":327,"props":333,"children":335},{"style":334},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[336],{"type":52,"value":337},"import",{"type":46,"tag":327,"props":339,"children":341},{"style":340},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[342],{"type":52,"value":343}," {",{"type":46,"tag":327,"props":345,"children":347},{"style":346},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[348],{"type":52,"value":349}," reactRouter",{"type":46,"tag":327,"props":351,"children":352},{"style":340},[353],{"type":52,"value":354}," }",{"type":46,"tag":327,"props":356,"children":357},{"style":334},[358],{"type":52,"value":359}," from",{"type":46,"tag":327,"props":361,"children":362},{"style":340},[363],{"type":52,"value":364}," '",{"type":46,"tag":327,"props":366,"children":368},{"style":367},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[369],{"type":52,"value":370},"@react-router\u002Fdev\u002Fvite",{"type":46,"tag":327,"props":372,"children":373},{"style":340},[374],{"type":52,"value":375},"'\n",{"type":46,"tag":327,"props":377,"children":379},{"class":329,"line":378},2,[380,384,388,393,397,401,405,410],{"type":46,"tag":327,"props":381,"children":382},{"style":334},[383],{"type":52,"value":337},{"type":46,"tag":327,"props":385,"children":386},{"style":340},[387],{"type":52,"value":343},{"type":46,"tag":327,"props":389,"children":390},{"style":346},[391],{"type":52,"value":392}," defineConfig",{"type":46,"tag":327,"props":394,"children":395},{"style":340},[396],{"type":52,"value":354},{"type":46,"tag":327,"props":398,"children":399},{"style":334},[400],{"type":52,"value":359},{"type":46,"tag":327,"props":402,"children":403},{"style":340},[404],{"type":52,"value":364},{"type":46,"tag":327,"props":406,"children":407},{"style":367},[408],{"type":52,"value":409},"vite",{"type":46,"tag":327,"props":411,"children":412},{"style":340},[413],{"type":52,"value":375},{"type":46,"tag":327,"props":415,"children":417},{"class":329,"line":416},3,[418],{"type":46,"tag":327,"props":419,"children":421},{"emptyLinePlaceholder":420},true,[422],{"type":52,"value":423},"\n",{"type":46,"tag":327,"props":425,"children":426},{"class":329,"line":30},[427,432,437,442,447],{"type":46,"tag":327,"props":428,"children":429},{"style":334},[430],{"type":52,"value":431},"export",{"type":46,"tag":327,"props":433,"children":434},{"style":334},[435],{"type":52,"value":436}," default",{"type":46,"tag":327,"props":438,"children":440},{"style":439},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[441],{"type":52,"value":392},{"type":46,"tag":327,"props":443,"children":444},{"style":346},[445],{"type":52,"value":446},"(",{"type":46,"tag":327,"props":448,"children":449},{"style":340},[450],{"type":52,"value":451},"{\n",{"type":46,"tag":327,"props":453,"children":455},{"class":329,"line":454},5,[456,462,467,472,477,482],{"type":46,"tag":327,"props":457,"children":459},{"style":458},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[460],{"type":52,"value":461},"  plugins",{"type":46,"tag":327,"props":463,"children":464},{"style":340},[465],{"type":52,"value":466},":",{"type":46,"tag":327,"props":468,"children":469},{"style":346},[470],{"type":52,"value":471}," [",{"type":46,"tag":327,"props":473,"children":474},{"style":439},[475],{"type":52,"value":476},"reactRouter",{"type":46,"tag":327,"props":478,"children":479},{"style":346},[480],{"type":52,"value":481},"()]",{"type":46,"tag":327,"props":483,"children":484},{"style":340},[485],{"type":52,"value":486},",\n",{"type":46,"tag":327,"props":488,"children":490},{"class":329,"line":489},6,[491,496,500],{"type":46,"tag":327,"props":492,"children":493},{"style":458},[494],{"type":52,"value":495},"  ssr",{"type":46,"tag":327,"props":497,"children":498},{"style":340},[499],{"type":52,"value":466},{"type":46,"tag":327,"props":501,"children":502},{"style":340},[503],{"type":52,"value":504}," {\n",{"type":46,"tag":327,"props":506,"children":508},{"class":329,"line":507},7,[509,514,518,522,527,531,535,540],{"type":46,"tag":327,"props":510,"children":511},{"style":458},[512],{"type":52,"value":513},"    noExternal",{"type":46,"tag":327,"props":515,"children":516},{"style":340},[517],{"type":52,"value":466},{"type":46,"tag":327,"props":519,"children":520},{"style":346},[521],{"type":52,"value":471},{"type":46,"tag":327,"props":523,"children":524},{"style":340},[525],{"type":52,"value":526},"'",{"type":46,"tag":327,"props":528,"children":529},{"style":367},[530],{"type":52,"value":66},{"type":46,"tag":327,"props":532,"children":533},{"style":340},[534],{"type":52,"value":526},{"type":46,"tag":327,"props":536,"children":537},{"style":346},[538],{"type":52,"value":539},"]",{"type":46,"tag":327,"props":541,"children":542},{"style":340},[543],{"type":52,"value":486},{"type":46,"tag":327,"props":545,"children":547},{"class":329,"line":546},8,[548],{"type":46,"tag":327,"props":549,"children":550},{"style":340},[551],{"type":52,"value":552},"  },\n",{"type":46,"tag":327,"props":554,"children":556},{"class":329,"line":555},9,[557,562],{"type":46,"tag":327,"props":558,"children":559},{"style":340},[560],{"type":52,"value":561},"}",{"type":46,"tag":327,"props":563,"children":564},{"style":346},[565],{"type":52,"value":566},")\n",{"type":46,"tag":253,"props":568,"children":570},{"id":569},"_2-roottsx",[571],{"type":52,"value":572},"2. root.tsx",{"type":46,"tag":280,"props":574,"children":578},{"className":575,"code":576,"language":577,"meta":288,"style":288},"language-tsx shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { Outlet } from 'react-router'\nimport { rootAuthLoader, clerkMiddleware } from '@clerk\u002Freact-router\u002Fserver'\nimport { ClerkProvider } from '@clerk\u002Freact-router'\nimport type { Route } from '.\u002F+types\u002Froot'\n\nexport const middleware: Route.MiddlewareFunction[] = [clerkMiddleware()]\n\nexport async function loader(args: Route.LoaderArgs) {\n  return rootAuthLoader(args)\n}\n\nexport default function App({ loaderData }: Route.ComponentProps) {\n  return (\n    \u003CClerkProvider loaderData={loaderData}>\n      \u003COutlet \u002F>\n    \u003C\u002FClerkProvider>\n  )\n}\n","tsx",[579],{"type":46,"tag":61,"props":580,"children":581},{"__ignoreMap":288},[582,618,665,701,743,750,811,818,876,900,909,917,974,987,1020,1039,1057,1066],{"type":46,"tag":327,"props":583,"children":584},{"class":329,"line":330},[585,589,593,598,602,606,610,614],{"type":46,"tag":327,"props":586,"children":587},{"style":334},[588],{"type":52,"value":337},{"type":46,"tag":327,"props":590,"children":591},{"style":340},[592],{"type":52,"value":343},{"type":46,"tag":327,"props":594,"children":595},{"style":346},[596],{"type":52,"value":597}," Outlet",{"type":46,"tag":327,"props":599,"children":600},{"style":340},[601],{"type":52,"value":354},{"type":46,"tag":327,"props":603,"children":604},{"style":334},[605],{"type":52,"value":359},{"type":46,"tag":327,"props":607,"children":608},{"style":340},[609],{"type":52,"value":364},{"type":46,"tag":327,"props":611,"children":612},{"style":367},[613],{"type":52,"value":25},{"type":46,"tag":327,"props":615,"children":616},{"style":340},[617],{"type":52,"value":375},{"type":46,"tag":327,"props":619,"children":620},{"class":329,"line":378},[621,625,629,634,639,644,648,652,656,661],{"type":46,"tag":327,"props":622,"children":623},{"style":334},[624],{"type":52,"value":337},{"type":46,"tag":327,"props":626,"children":627},{"style":340},[628],{"type":52,"value":343},{"type":46,"tag":327,"props":630,"children":631},{"style":346},[632],{"type":52,"value":633}," rootAuthLoader",{"type":46,"tag":327,"props":635,"children":636},{"style":340},[637],{"type":52,"value":638},",",{"type":46,"tag":327,"props":640,"children":641},{"style":346},[642],{"type":52,"value":643}," clerkMiddleware",{"type":46,"tag":327,"props":645,"children":646},{"style":340},[647],{"type":52,"value":354},{"type":46,"tag":327,"props":649,"children":650},{"style":334},[651],{"type":52,"value":359},{"type":46,"tag":327,"props":653,"children":654},{"style":340},[655],{"type":52,"value":364},{"type":46,"tag":327,"props":657,"children":658},{"style":367},[659],{"type":52,"value":660},"@clerk\u002Freact-router\u002Fserver",{"type":46,"tag":327,"props":662,"children":663},{"style":340},[664],{"type":52,"value":375},{"type":46,"tag":327,"props":666,"children":667},{"class":329,"line":416},[668,672,676,681,685,689,693,697],{"type":46,"tag":327,"props":669,"children":670},{"style":334},[671],{"type":52,"value":337},{"type":46,"tag":327,"props":673,"children":674},{"style":340},[675],{"type":52,"value":343},{"type":46,"tag":327,"props":677,"children":678},{"style":346},[679],{"type":52,"value":680}," ClerkProvider",{"type":46,"tag":327,"props":682,"children":683},{"style":340},[684],{"type":52,"value":354},{"type":46,"tag":327,"props":686,"children":687},{"style":334},[688],{"type":52,"value":359},{"type":46,"tag":327,"props":690,"children":691},{"style":340},[692],{"type":52,"value":364},{"type":46,"tag":327,"props":694,"children":695},{"style":367},[696],{"type":52,"value":66},{"type":46,"tag":327,"props":698,"children":699},{"style":340},[700],{"type":52,"value":375},{"type":46,"tag":327,"props":702,"children":703},{"class":329,"line":30},[704,708,713,717,722,726,730,734,739],{"type":46,"tag":327,"props":705,"children":706},{"style":334},[707],{"type":52,"value":337},{"type":46,"tag":327,"props":709,"children":710},{"style":334},[711],{"type":52,"value":712}," type",{"type":46,"tag":327,"props":714,"children":715},{"style":340},[716],{"type":52,"value":343},{"type":46,"tag":327,"props":718,"children":719},{"style":346},[720],{"type":52,"value":721}," Route",{"type":46,"tag":327,"props":723,"children":724},{"style":340},[725],{"type":52,"value":354},{"type":46,"tag":327,"props":727,"children":728},{"style":334},[729],{"type":52,"value":359},{"type":46,"tag":327,"props":731,"children":732},{"style":340},[733],{"type":52,"value":364},{"type":46,"tag":327,"props":735,"children":736},{"style":367},[737],{"type":52,"value":738},".\u002F+types\u002Froot",{"type":46,"tag":327,"props":740,"children":741},{"style":340},[742],{"type":52,"value":375},{"type":46,"tag":327,"props":744,"children":745},{"class":329,"line":454},[746],{"type":46,"tag":327,"props":747,"children":748},{"emptyLinePlaceholder":420},[749],{"type":52,"value":423},{"type":46,"tag":327,"props":751,"children":752},{"class":329,"line":489},[753,757,763,768,772,777,782,787,792,797,801,806],{"type":46,"tag":327,"props":754,"children":755},{"style":334},[756],{"type":52,"value":431},{"type":46,"tag":327,"props":758,"children":760},{"style":759},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[761],{"type":52,"value":762}," const",{"type":46,"tag":327,"props":764,"children":765},{"style":346},[766],{"type":52,"value":767}," middleware",{"type":46,"tag":327,"props":769,"children":770},{"style":340},[771],{"type":52,"value":466},{"type":46,"tag":327,"props":773,"children":775},{"style":774},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[776],{"type":52,"value":721},{"type":46,"tag":327,"props":778,"children":779},{"style":340},[780],{"type":52,"value":781},".",{"type":46,"tag":327,"props":783,"children":784},{"style":774},[785],{"type":52,"value":786},"MiddlewareFunction",{"type":46,"tag":327,"props":788,"children":789},{"style":346},[790],{"type":52,"value":791},"[] ",{"type":46,"tag":327,"props":793,"children":794},{"style":340},[795],{"type":52,"value":796},"=",{"type":46,"tag":327,"props":798,"children":799},{"style":346},[800],{"type":52,"value":471},{"type":46,"tag":327,"props":802,"children":803},{"style":439},[804],{"type":52,"value":805},"clerkMiddleware",{"type":46,"tag":327,"props":807,"children":808},{"style":346},[809],{"type":52,"value":810},"()]\n",{"type":46,"tag":327,"props":812,"children":813},{"class":329,"line":507},[814],{"type":46,"tag":327,"props":815,"children":816},{"emptyLinePlaceholder":420},[817],{"type":52,"value":423},{"type":46,"tag":327,"props":819,"children":820},{"class":329,"line":546},[821,825,830,835,840,844,850,854,858,862,867,872],{"type":46,"tag":327,"props":822,"children":823},{"style":334},[824],{"type":52,"value":431},{"type":46,"tag":327,"props":826,"children":827},{"style":759},[828],{"type":52,"value":829}," async",{"type":46,"tag":327,"props":831,"children":832},{"style":759},[833],{"type":52,"value":834}," function",{"type":46,"tag":327,"props":836,"children":837},{"style":439},[838],{"type":52,"value":839}," loader",{"type":46,"tag":327,"props":841,"children":842},{"style":340},[843],{"type":52,"value":446},{"type":46,"tag":327,"props":845,"children":847},{"style":846},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[848],{"type":52,"value":849},"args",{"type":46,"tag":327,"props":851,"children":852},{"style":340},[853],{"type":52,"value":466},{"type":46,"tag":327,"props":855,"children":856},{"style":774},[857],{"type":52,"value":721},{"type":46,"tag":327,"props":859,"children":860},{"style":340},[861],{"type":52,"value":781},{"type":46,"tag":327,"props":863,"children":864},{"style":774},[865],{"type":52,"value":866},"LoaderArgs",{"type":46,"tag":327,"props":868,"children":869},{"style":340},[870],{"type":52,"value":871},")",{"type":46,"tag":327,"props":873,"children":874},{"style":340},[875],{"type":52,"value":504},{"type":46,"tag":327,"props":877,"children":878},{"class":329,"line":555},[879,884,888,892,896],{"type":46,"tag":327,"props":880,"children":881},{"style":334},[882],{"type":52,"value":883},"  return",{"type":46,"tag":327,"props":885,"children":886},{"style":439},[887],{"type":52,"value":633},{"type":46,"tag":327,"props":889,"children":890},{"style":458},[891],{"type":52,"value":446},{"type":46,"tag":327,"props":893,"children":894},{"style":346},[895],{"type":52,"value":849},{"type":46,"tag":327,"props":897,"children":898},{"style":458},[899],{"type":52,"value":566},{"type":46,"tag":327,"props":901,"children":903},{"class":329,"line":902},10,[904],{"type":46,"tag":327,"props":905,"children":906},{"style":340},[907],{"type":52,"value":908},"}\n",{"type":46,"tag":327,"props":910,"children":912},{"class":329,"line":911},11,[913],{"type":46,"tag":327,"props":914,"children":915},{"emptyLinePlaceholder":420},[916],{"type":52,"value":423},{"type":46,"tag":327,"props":918,"children":920},{"class":329,"line":919},12,[921,925,929,933,938,943,948,953,957,961,966,970],{"type":46,"tag":327,"props":922,"children":923},{"style":334},[924],{"type":52,"value":431},{"type":46,"tag":327,"props":926,"children":927},{"style":334},[928],{"type":52,"value":436},{"type":46,"tag":327,"props":930,"children":931},{"style":759},[932],{"type":52,"value":834},{"type":46,"tag":327,"props":934,"children":935},{"style":439},[936],{"type":52,"value":937}," App",{"type":46,"tag":327,"props":939,"children":940},{"style":340},[941],{"type":52,"value":942},"({",{"type":46,"tag":327,"props":944,"children":945},{"style":846},[946],{"type":52,"value":947}," loaderData",{"type":46,"tag":327,"props":949,"children":950},{"style":340},[951],{"type":52,"value":952}," }:",{"type":46,"tag":327,"props":954,"children":955},{"style":774},[956],{"type":52,"value":721},{"type":46,"tag":327,"props":958,"children":959},{"style":340},[960],{"type":52,"value":781},{"type":46,"tag":327,"props":962,"children":963},{"style":774},[964],{"type":52,"value":965},"ComponentProps",{"type":46,"tag":327,"props":967,"children":968},{"style":340},[969],{"type":52,"value":871},{"type":46,"tag":327,"props":971,"children":972},{"style":340},[973],{"type":52,"value":504},{"type":46,"tag":327,"props":975,"children":977},{"class":329,"line":976},13,[978,982],{"type":46,"tag":327,"props":979,"children":980},{"style":334},[981],{"type":52,"value":883},{"type":46,"tag":327,"props":983,"children":984},{"style":458},[985],{"type":52,"value":986}," (\n",{"type":46,"tag":327,"props":988,"children":990},{"class":329,"line":989},14,[991,996,1001,1005,1010,1015],{"type":46,"tag":327,"props":992,"children":993},{"style":340},[994],{"type":52,"value":995},"    \u003C",{"type":46,"tag":327,"props":997,"children":998},{"style":774},[999],{"type":52,"value":1000},"ClerkProvider",{"type":46,"tag":327,"props":1002,"children":1003},{"style":759},[1004],{"type":52,"value":947},{"type":46,"tag":327,"props":1006,"children":1007},{"style":340},[1008],{"type":52,"value":1009},"={",{"type":46,"tag":327,"props":1011,"children":1012},{"style":346},[1013],{"type":52,"value":1014},"loaderData",{"type":46,"tag":327,"props":1016,"children":1017},{"style":340},[1018],{"type":52,"value":1019},"}>\n",{"type":46,"tag":327,"props":1021,"children":1023},{"class":329,"line":1022},15,[1024,1029,1034],{"type":46,"tag":327,"props":1025,"children":1026},{"style":340},[1027],{"type":52,"value":1028},"      \u003C",{"type":46,"tag":327,"props":1030,"children":1031},{"style":774},[1032],{"type":52,"value":1033},"Outlet",{"type":46,"tag":327,"props":1035,"children":1036},{"style":340},[1037],{"type":52,"value":1038}," \u002F>\n",{"type":46,"tag":327,"props":1040,"children":1042},{"class":329,"line":1041},16,[1043,1048,1052],{"type":46,"tag":327,"props":1044,"children":1045},{"style":340},[1046],{"type":52,"value":1047},"    \u003C\u002F",{"type":46,"tag":327,"props":1049,"children":1050},{"style":774},[1051],{"type":52,"value":1000},{"type":46,"tag":327,"props":1053,"children":1054},{"style":340},[1055],{"type":52,"value":1056},">\n",{"type":46,"tag":327,"props":1058,"children":1060},{"class":329,"line":1059},17,[1061],{"type":46,"tag":327,"props":1062,"children":1063},{"style":458},[1064],{"type":52,"value":1065},"  )\n",{"type":46,"tag":327,"props":1067,"children":1069},{"class":329,"line":1068},18,[1070],{"type":46,"tag":327,"props":1071,"children":1072},{"style":340},[1073],{"type":52,"value":908},{"type":46,"tag":55,"props":1075,"children":1076},{},[1077,1079,1085,1087,1092,1094,1100,1102,1108,1110,1115],{"type":52,"value":1078},"There is no ",{"type":46,"tag":61,"props":1080,"children":1082},{"className":1081},[],[1083],{"type":52,"value":1084},"ClerkApp",{"type":52,"value":1086}," HOC in ",{"type":46,"tag":61,"props":1088,"children":1090},{"className":1089},[],[1091],{"type":52,"value":66},{"type":52,"value":1093}," (that was the ",{"type":46,"tag":61,"props":1095,"children":1097},{"className":1096},[],[1098],{"type":52,"value":1099},"@clerk\u002Fremix",{"type":52,"value":1101}," API).\nRender ",{"type":46,"tag":61,"props":1103,"children":1105},{"className":1104},[],[1106],{"type":52,"value":1107},"\u003CClerkProvider loaderData={loaderData}>",{"type":52,"value":1109}," inside the default export and pass it\nthe root route's ",{"type":46,"tag":61,"props":1111,"children":1113},{"className":1112},[],[1114],{"type":52,"value":1014},{"type":52,"value":781},{"type":46,"tag":253,"props":1117,"children":1119},{"id":1118},"_3-react-routerconfigts-v7-only",[1120],{"type":52,"value":1121},"3. react-router.config.ts (v7 only)",{"type":46,"tag":280,"props":1123,"children":1125},{"className":319,"code":1124,"language":321,"meta":288,"style":288},"import type { Config } from '@react-router\u002Fdev\u002Fconfig'\n\nexport default {\n  future: {\n    v8_middleware: true,\n  },\n} satisfies Config\n",[1126],{"type":46,"tag":61,"props":1127,"children":1128},{"__ignoreMap":288},[1129,1170,1177,1192,1208,1230,1237],{"type":46,"tag":327,"props":1130,"children":1131},{"class":329,"line":330},[1132,1136,1140,1144,1149,1153,1157,1161,1166],{"type":46,"tag":327,"props":1133,"children":1134},{"style":334},[1135],{"type":52,"value":337},{"type":46,"tag":327,"props":1137,"children":1138},{"style":334},[1139],{"type":52,"value":712},{"type":46,"tag":327,"props":1141,"children":1142},{"style":340},[1143],{"type":52,"value":343},{"type":46,"tag":327,"props":1145,"children":1146},{"style":346},[1147],{"type":52,"value":1148}," Config",{"type":46,"tag":327,"props":1150,"children":1151},{"style":340},[1152],{"type":52,"value":354},{"type":46,"tag":327,"props":1154,"children":1155},{"style":334},[1156],{"type":52,"value":359},{"type":46,"tag":327,"props":1158,"children":1159},{"style":340},[1160],{"type":52,"value":364},{"type":46,"tag":327,"props":1162,"children":1163},{"style":367},[1164],{"type":52,"value":1165},"@react-router\u002Fdev\u002Fconfig",{"type":46,"tag":327,"props":1167,"children":1168},{"style":340},[1169],{"type":52,"value":375},{"type":46,"tag":327,"props":1171,"children":1172},{"class":329,"line":378},[1173],{"type":46,"tag":327,"props":1174,"children":1175},{"emptyLinePlaceholder":420},[1176],{"type":52,"value":423},{"type":46,"tag":327,"props":1178,"children":1179},{"class":329,"line":416},[1180,1184,1188],{"type":46,"tag":327,"props":1181,"children":1182},{"style":334},[1183],{"type":52,"value":431},{"type":46,"tag":327,"props":1185,"children":1186},{"style":334},[1187],{"type":52,"value":436},{"type":46,"tag":327,"props":1189,"children":1190},{"style":340},[1191],{"type":52,"value":504},{"type":46,"tag":327,"props":1193,"children":1194},{"class":329,"line":30},[1195,1200,1204],{"type":46,"tag":327,"props":1196,"children":1197},{"style":458},[1198],{"type":52,"value":1199},"  future",{"type":46,"tag":327,"props":1201,"children":1202},{"style":340},[1203],{"type":52,"value":466},{"type":46,"tag":327,"props":1205,"children":1206},{"style":340},[1207],{"type":52,"value":504},{"type":46,"tag":327,"props":1209,"children":1210},{"class":329,"line":454},[1211,1216,1220,1226],{"type":46,"tag":327,"props":1212,"children":1213},{"style":458},[1214],{"type":52,"value":1215},"    v8_middleware",{"type":46,"tag":327,"props":1217,"children":1218},{"style":340},[1219],{"type":52,"value":466},{"type":46,"tag":327,"props":1221,"children":1223},{"style":1222},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[1224],{"type":52,"value":1225}," true",{"type":46,"tag":327,"props":1227,"children":1228},{"style":340},[1229],{"type":52,"value":486},{"type":46,"tag":327,"props":1231,"children":1232},{"class":329,"line":489},[1233],{"type":46,"tag":327,"props":1234,"children":1235},{"style":340},[1236],{"type":52,"value":552},{"type":46,"tag":327,"props":1238,"children":1239},{"class":329,"line":507},[1240,1244,1249],{"type":46,"tag":327,"props":1241,"children":1242},{"style":340},[1243],{"type":52,"value":561},{"type":46,"tag":327,"props":1245,"children":1246},{"style":334},[1247],{"type":52,"value":1248}," satisfies",{"type":46,"tag":327,"props":1250,"children":1251},{"style":774},[1252],{"type":52,"value":1253}," Config\n",{"type":46,"tag":55,"props":1255,"children":1256},{},[1257,1259,1265],{"type":52,"value":1258},"On v8, omit the ",{"type":46,"tag":61,"props":1260,"children":1262},{"className":1261},[],[1263],{"type":52,"value":1264},"future",{"type":52,"value":1266}," block entirely — the flag no longer exists.",{"type":46,"tag":1268,"props":1269,"children":1270},"blockquote",{},[1271],{"type":46,"tag":55,"props":1272,"children":1273},{},[1274,1278,1280,1286,1288,1294,1296,1302],{"type":46,"tag":241,"props":1275,"children":1276},{},[1277],{"type":52,"value":245},{"type":52,"value":1279},": ",{"type":46,"tag":61,"props":1281,"children":1283},{"className":1282},[],[1284],{"type":52,"value":1285},"rootAuthLoader",{"type":52,"value":1287}," must be called in ",{"type":46,"tag":61,"props":1289,"children":1291},{"className":1290},[],[1292],{"type":52,"value":1293},"root.tsx",{"type":52,"value":1295},"'s loader. Without it, ",{"type":46,"tag":61,"props":1297,"children":1299},{"className":1298},[],[1300],{"type":52,"value":1301},"getAuth",{"type":52,"value":1303}," throws in nested loaders.",{"type":46,"tag":70,"props":1305,"children":1307},{"id":1306},"mental-model",[1308],{"type":52,"value":1309},"Mental Model",{"type":46,"tag":55,"props":1311,"children":1312},{},[1313],{"type":52,"value":1314},"React Router v7\u002Fv8 uses a middleware + loader pipeline. Clerk plugs into both layers:",{"type":46,"tag":1316,"props":1317,"children":1318},"ul",{},[1319,1338,1358],{"type":46,"tag":1320,"props":1321,"children":1322},"li",{},[1323,1328,1330,1336],{"type":46,"tag":241,"props":1324,"children":1325},{},[1326],{"type":52,"value":1327},"Middleware",{"type":52,"value":1329}," (",{"type":46,"tag":61,"props":1331,"children":1333},{"className":1332},[],[1334],{"type":52,"value":1335},"clerkMiddleware()",{"type":52,"value":1337},") — runs on every request, attaches auth to context",{"type":46,"tag":1320,"props":1339,"children":1340},{},[1341,1349,1351,1356],{"type":46,"tag":241,"props":1342,"children":1343},{},[1344],{"type":46,"tag":61,"props":1345,"children":1347},{"className":1346},[],[1348],{"type":52,"value":1285},{"type":52,"value":1350}," — required in ",{"type":46,"tag":61,"props":1352,"children":1354},{"className":1353},[],[1355],{"type":52,"value":1293},{"type":52,"value":1357}," to pass Clerk state to the client",{"type":46,"tag":1320,"props":1359,"children":1360},{},[1361,1370],{"type":46,"tag":241,"props":1362,"children":1363},{},[1364],{"type":46,"tag":61,"props":1365,"children":1367},{"className":1366},[],[1368],{"type":52,"value":1369},"getAuth(args)",{"type":52,"value":1371}," — called inside any loader\u002Faction to get the current user",{"type":46,"tag":280,"props":1373,"children":1376},{"className":1374,"code":1375,"language":52},[283],"Request → clerkMiddleware() → rootAuthLoader → page loader → component\n                 ↓                   ↓               ↓\n           attaches auth      injects state     getAuth(args)\n           to context         to response       reads context\n",[1377],{"type":46,"tag":61,"props":1378,"children":1379},{"__ignoreMap":288},[1380],{"type":52,"value":1375},{"type":46,"tag":70,"props":1382,"children":1384},{"id":1383},"auth-in-loaders",[1385],{"type":52,"value":1386},"Auth in Loaders",{"type":46,"tag":280,"props":1388,"children":1390},{"className":575,"code":1389,"language":577,"meta":288,"style":288},"import { getAuth } from '@clerk\u002Freact-router\u002Fserver'\nimport type { Route } from '.\u002F+types\u002Fdashboard'\n\nexport async function loader(args: Route.LoaderArgs) {\n  const { userId } = await getAuth(args)\n  if (!userId) throw redirect('\u002Fsign-in')\n\n  const data = await fetchUserData(userId)\n  return { data }\n}\n",[1391],{"type":46,"tag":61,"props":1392,"children":1393},{"__ignoreMap":288},[1394,1430,1470,1477,1528,1575,1633,1640,1677,1697],{"type":46,"tag":327,"props":1395,"children":1396},{"class":329,"line":330},[1397,1401,1405,1410,1414,1418,1422,1426],{"type":46,"tag":327,"props":1398,"children":1399},{"style":334},[1400],{"type":52,"value":337},{"type":46,"tag":327,"props":1402,"children":1403},{"style":340},[1404],{"type":52,"value":343},{"type":46,"tag":327,"props":1406,"children":1407},{"style":346},[1408],{"type":52,"value":1409}," getAuth",{"type":46,"tag":327,"props":1411,"children":1412},{"style":340},[1413],{"type":52,"value":354},{"type":46,"tag":327,"props":1415,"children":1416},{"style":334},[1417],{"type":52,"value":359},{"type":46,"tag":327,"props":1419,"children":1420},{"style":340},[1421],{"type":52,"value":364},{"type":46,"tag":327,"props":1423,"children":1424},{"style":367},[1425],{"type":52,"value":660},{"type":46,"tag":327,"props":1427,"children":1428},{"style":340},[1429],{"type":52,"value":375},{"type":46,"tag":327,"props":1431,"children":1432},{"class":329,"line":378},[1433,1437,1441,1445,1449,1453,1457,1461,1466],{"type":46,"tag":327,"props":1434,"children":1435},{"style":334},[1436],{"type":52,"value":337},{"type":46,"tag":327,"props":1438,"children":1439},{"style":334},[1440],{"type":52,"value":712},{"type":46,"tag":327,"props":1442,"children":1443},{"style":340},[1444],{"type":52,"value":343},{"type":46,"tag":327,"props":1446,"children":1447},{"style":346},[1448],{"type":52,"value":721},{"type":46,"tag":327,"props":1450,"children":1451},{"style":340},[1452],{"type":52,"value":354},{"type":46,"tag":327,"props":1454,"children":1455},{"style":334},[1456],{"type":52,"value":359},{"type":46,"tag":327,"props":1458,"children":1459},{"style":340},[1460],{"type":52,"value":364},{"type":46,"tag":327,"props":1462,"children":1463},{"style":367},[1464],{"type":52,"value":1465},".\u002F+types\u002Fdashboard",{"type":46,"tag":327,"props":1467,"children":1468},{"style":340},[1469],{"type":52,"value":375},{"type":46,"tag":327,"props":1471,"children":1472},{"class":329,"line":416},[1473],{"type":46,"tag":327,"props":1474,"children":1475},{"emptyLinePlaceholder":420},[1476],{"type":52,"value":423},{"type":46,"tag":327,"props":1478,"children":1479},{"class":329,"line":30},[1480,1484,1488,1492,1496,1500,1504,1508,1512,1516,1520,1524],{"type":46,"tag":327,"props":1481,"children":1482},{"style":334},[1483],{"type":52,"value":431},{"type":46,"tag":327,"props":1485,"children":1486},{"style":759},[1487],{"type":52,"value":829},{"type":46,"tag":327,"props":1489,"children":1490},{"style":759},[1491],{"type":52,"value":834},{"type":46,"tag":327,"props":1493,"children":1494},{"style":439},[1495],{"type":52,"value":839},{"type":46,"tag":327,"props":1497,"children":1498},{"style":340},[1499],{"type":52,"value":446},{"type":46,"tag":327,"props":1501,"children":1502},{"style":846},[1503],{"type":52,"value":849},{"type":46,"tag":327,"props":1505,"children":1506},{"style":340},[1507],{"type":52,"value":466},{"type":46,"tag":327,"props":1509,"children":1510},{"style":774},[1511],{"type":52,"value":721},{"type":46,"tag":327,"props":1513,"children":1514},{"style":340},[1515],{"type":52,"value":781},{"type":46,"tag":327,"props":1517,"children":1518},{"style":774},[1519],{"type":52,"value":866},{"type":46,"tag":327,"props":1521,"children":1522},{"style":340},[1523],{"type":52,"value":871},{"type":46,"tag":327,"props":1525,"children":1526},{"style":340},[1527],{"type":52,"value":504},{"type":46,"tag":327,"props":1529,"children":1530},{"class":329,"line":454},[1531,1536,1540,1545,1549,1554,1559,1563,1567,1571],{"type":46,"tag":327,"props":1532,"children":1533},{"style":759},[1534],{"type":52,"value":1535},"  const",{"type":46,"tag":327,"props":1537,"children":1538},{"style":340},[1539],{"type":52,"value":343},{"type":46,"tag":327,"props":1541,"children":1542},{"style":346},[1543],{"type":52,"value":1544}," userId",{"type":46,"tag":327,"props":1546,"children":1547},{"style":340},[1548],{"type":52,"value":354},{"type":46,"tag":327,"props":1550,"children":1551},{"style":340},[1552],{"type":52,"value":1553}," =",{"type":46,"tag":327,"props":1555,"children":1556},{"style":334},[1557],{"type":52,"value":1558}," await",{"type":46,"tag":327,"props":1560,"children":1561},{"style":439},[1562],{"type":52,"value":1409},{"type":46,"tag":327,"props":1564,"children":1565},{"style":458},[1566],{"type":52,"value":446},{"type":46,"tag":327,"props":1568,"children":1569},{"style":346},[1570],{"type":52,"value":849},{"type":46,"tag":327,"props":1572,"children":1573},{"style":458},[1574],{"type":52,"value":566},{"type":46,"tag":327,"props":1576,"children":1577},{"class":329,"line":489},[1578,1583,1587,1592,1597,1602,1607,1612,1616,1620,1625,1629],{"type":46,"tag":327,"props":1579,"children":1580},{"style":334},[1581],{"type":52,"value":1582},"  if",{"type":46,"tag":327,"props":1584,"children":1585},{"style":458},[1586],{"type":52,"value":1329},{"type":46,"tag":327,"props":1588,"children":1589},{"style":340},[1590],{"type":52,"value":1591},"!",{"type":46,"tag":327,"props":1593,"children":1594},{"style":346},[1595],{"type":52,"value":1596},"userId",{"type":46,"tag":327,"props":1598,"children":1599},{"style":458},[1600],{"type":52,"value":1601},") ",{"type":46,"tag":327,"props":1603,"children":1604},{"style":334},[1605],{"type":52,"value":1606},"throw",{"type":46,"tag":327,"props":1608,"children":1609},{"style":439},[1610],{"type":52,"value":1611}," redirect",{"type":46,"tag":327,"props":1613,"children":1614},{"style":458},[1615],{"type":52,"value":446},{"type":46,"tag":327,"props":1617,"children":1618},{"style":340},[1619],{"type":52,"value":526},{"type":46,"tag":327,"props":1621,"children":1622},{"style":367},[1623],{"type":52,"value":1624},"\u002Fsign-in",{"type":46,"tag":327,"props":1626,"children":1627},{"style":340},[1628],{"type":52,"value":526},{"type":46,"tag":327,"props":1630,"children":1631},{"style":458},[1632],{"type":52,"value":566},{"type":46,"tag":327,"props":1634,"children":1635},{"class":329,"line":507},[1636],{"type":46,"tag":327,"props":1637,"children":1638},{"emptyLinePlaceholder":420},[1639],{"type":52,"value":423},{"type":46,"tag":327,"props":1641,"children":1642},{"class":329,"line":546},[1643,1647,1652,1656,1660,1665,1669,1673],{"type":46,"tag":327,"props":1644,"children":1645},{"style":759},[1646],{"type":52,"value":1535},{"type":46,"tag":327,"props":1648,"children":1649},{"style":346},[1650],{"type":52,"value":1651}," data",{"type":46,"tag":327,"props":1653,"children":1654},{"style":340},[1655],{"type":52,"value":1553},{"type":46,"tag":327,"props":1657,"children":1658},{"style":334},[1659],{"type":52,"value":1558},{"type":46,"tag":327,"props":1661,"children":1662},{"style":439},[1663],{"type":52,"value":1664}," fetchUserData",{"type":46,"tag":327,"props":1666,"children":1667},{"style":458},[1668],{"type":52,"value":446},{"type":46,"tag":327,"props":1670,"children":1671},{"style":346},[1672],{"type":52,"value":1596},{"type":46,"tag":327,"props":1674,"children":1675},{"style":458},[1676],{"type":52,"value":566},{"type":46,"tag":327,"props":1678,"children":1679},{"class":329,"line":555},[1680,1684,1688,1692],{"type":46,"tag":327,"props":1681,"children":1682},{"style":334},[1683],{"type":52,"value":883},{"type":46,"tag":327,"props":1685,"children":1686},{"style":340},[1687],{"type":52,"value":343},{"type":46,"tag":327,"props":1689,"children":1690},{"style":346},[1691],{"type":52,"value":1651},{"type":46,"tag":327,"props":1693,"children":1694},{"style":340},[1695],{"type":52,"value":1696}," }\n",{"type":46,"tag":327,"props":1698,"children":1699},{"class":329,"line":902},[1700],{"type":46,"tag":327,"props":1701,"children":1702},{"style":340},[1703],{"type":52,"value":908},{"type":46,"tag":70,"props":1705,"children":1707},{"id":1706},"auth-in-actions",[1708],{"type":52,"value":1709},"Auth in Actions",{"type":46,"tag":280,"props":1711,"children":1713},{"className":575,"code":1712,"language":577,"meta":288,"style":288},"import { getAuth } from '@clerk\u002Freact-router\u002Fserver'\n\nexport async function action(args: Route.ActionArgs) {\n  const { userId, orgId } = await getAuth(args)\n  if (!userId) throw new Response('Unauthorized', { status: 401 })\n\n  const formData = await args.request.formData()\n  await saveData(userId, orgId, formData)\n  return redirect('\u002Fdashboard')\n}\n",[1714],{"type":46,"tag":61,"props":1715,"children":1716},{"__ignoreMap":288},[1717,1752,1759,1812,1864,1949,1956,2004,2045,2077],{"type":46,"tag":327,"props":1718,"children":1719},{"class":329,"line":330},[1720,1724,1728,1732,1736,1740,1744,1748],{"type":46,"tag":327,"props":1721,"children":1722},{"style":334},[1723],{"type":52,"value":337},{"type":46,"tag":327,"props":1725,"children":1726},{"style":340},[1727],{"type":52,"value":343},{"type":46,"tag":327,"props":1729,"children":1730},{"style":346},[1731],{"type":52,"value":1409},{"type":46,"tag":327,"props":1733,"children":1734},{"style":340},[1735],{"type":52,"value":354},{"type":46,"tag":327,"props":1737,"children":1738},{"style":334},[1739],{"type":52,"value":359},{"type":46,"tag":327,"props":1741,"children":1742},{"style":340},[1743],{"type":52,"value":364},{"type":46,"tag":327,"props":1745,"children":1746},{"style":367},[1747],{"type":52,"value":660},{"type":46,"tag":327,"props":1749,"children":1750},{"style":340},[1751],{"type":52,"value":375},{"type":46,"tag":327,"props":1753,"children":1754},{"class":329,"line":378},[1755],{"type":46,"tag":327,"props":1756,"children":1757},{"emptyLinePlaceholder":420},[1758],{"type":52,"value":423},{"type":46,"tag":327,"props":1760,"children":1761},{"class":329,"line":416},[1762,1766,1770,1774,1779,1783,1787,1791,1795,1799,1804,1808],{"type":46,"tag":327,"props":1763,"children":1764},{"style":334},[1765],{"type":52,"value":431},{"type":46,"tag":327,"props":1767,"children":1768},{"style":759},[1769],{"type":52,"value":829},{"type":46,"tag":327,"props":1771,"children":1772},{"style":759},[1773],{"type":52,"value":834},{"type":46,"tag":327,"props":1775,"children":1776},{"style":439},[1777],{"type":52,"value":1778}," action",{"type":46,"tag":327,"props":1780,"children":1781},{"style":340},[1782],{"type":52,"value":446},{"type":46,"tag":327,"props":1784,"children":1785},{"style":846},[1786],{"type":52,"value":849},{"type":46,"tag":327,"props":1788,"children":1789},{"style":340},[1790],{"type":52,"value":466},{"type":46,"tag":327,"props":1792,"children":1793},{"style":774},[1794],{"type":52,"value":721},{"type":46,"tag":327,"props":1796,"children":1797},{"style":340},[1798],{"type":52,"value":781},{"type":46,"tag":327,"props":1800,"children":1801},{"style":774},[1802],{"type":52,"value":1803},"ActionArgs",{"type":46,"tag":327,"props":1805,"children":1806},{"style":340},[1807],{"type":52,"value":871},{"type":46,"tag":327,"props":1809,"children":1810},{"style":340},[1811],{"type":52,"value":504},{"type":46,"tag":327,"props":1813,"children":1814},{"class":329,"line":30},[1815,1819,1823,1827,1831,1836,1840,1844,1848,1852,1856,1860],{"type":46,"tag":327,"props":1816,"children":1817},{"style":759},[1818],{"type":52,"value":1535},{"type":46,"tag":327,"props":1820,"children":1821},{"style":340},[1822],{"type":52,"value":343},{"type":46,"tag":327,"props":1824,"children":1825},{"style":346},[1826],{"type":52,"value":1544},{"type":46,"tag":327,"props":1828,"children":1829},{"style":340},[1830],{"type":52,"value":638},{"type":46,"tag":327,"props":1832,"children":1833},{"style":346},[1834],{"type":52,"value":1835}," orgId",{"type":46,"tag":327,"props":1837,"children":1838},{"style":340},[1839],{"type":52,"value":354},{"type":46,"tag":327,"props":1841,"children":1842},{"style":340},[1843],{"type":52,"value":1553},{"type":46,"tag":327,"props":1845,"children":1846},{"style":334},[1847],{"type":52,"value":1558},{"type":46,"tag":327,"props":1849,"children":1850},{"style":439},[1851],{"type":52,"value":1409},{"type":46,"tag":327,"props":1853,"children":1854},{"style":458},[1855],{"type":52,"value":446},{"type":46,"tag":327,"props":1857,"children":1858},{"style":346},[1859],{"type":52,"value":849},{"type":46,"tag":327,"props":1861,"children":1862},{"style":458},[1863],{"type":52,"value":566},{"type":46,"tag":327,"props":1865,"children":1866},{"class":329,"line":454},[1867,1871,1875,1879,1883,1887,1891,1896,1901,1905,1909,1914,1918,1922,1926,1931,1935,1941,1945],{"type":46,"tag":327,"props":1868,"children":1869},{"style":334},[1870],{"type":52,"value":1582},{"type":46,"tag":327,"props":1872,"children":1873},{"style":458},[1874],{"type":52,"value":1329},{"type":46,"tag":327,"props":1876,"children":1877},{"style":340},[1878],{"type":52,"value":1591},{"type":46,"tag":327,"props":1880,"children":1881},{"style":346},[1882],{"type":52,"value":1596},{"type":46,"tag":327,"props":1884,"children":1885},{"style":458},[1886],{"type":52,"value":1601},{"type":46,"tag":327,"props":1888,"children":1889},{"style":334},[1890],{"type":52,"value":1606},{"type":46,"tag":327,"props":1892,"children":1893},{"style":340},[1894],{"type":52,"value":1895}," new",{"type":46,"tag":327,"props":1897,"children":1898},{"style":439},[1899],{"type":52,"value":1900}," Response",{"type":46,"tag":327,"props":1902,"children":1903},{"style":458},[1904],{"type":52,"value":446},{"type":46,"tag":327,"props":1906,"children":1907},{"style":340},[1908],{"type":52,"value":526},{"type":46,"tag":327,"props":1910,"children":1911},{"style":367},[1912],{"type":52,"value":1913},"Unauthorized",{"type":46,"tag":327,"props":1915,"children":1916},{"style":340},[1917],{"type":52,"value":526},{"type":46,"tag":327,"props":1919,"children":1920},{"style":340},[1921],{"type":52,"value":638},{"type":46,"tag":327,"props":1923,"children":1924},{"style":340},[1925],{"type":52,"value":343},{"type":46,"tag":327,"props":1927,"children":1928},{"style":458},[1929],{"type":52,"value":1930}," status",{"type":46,"tag":327,"props":1932,"children":1933},{"style":340},[1934],{"type":52,"value":466},{"type":46,"tag":327,"props":1936,"children":1938},{"style":1937},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[1939],{"type":52,"value":1940}," 401",{"type":46,"tag":327,"props":1942,"children":1943},{"style":340},[1944],{"type":52,"value":354},{"type":46,"tag":327,"props":1946,"children":1947},{"style":458},[1948],{"type":52,"value":566},{"type":46,"tag":327,"props":1950,"children":1951},{"class":329,"line":489},[1952],{"type":46,"tag":327,"props":1953,"children":1954},{"emptyLinePlaceholder":420},[1955],{"type":52,"value":423},{"type":46,"tag":327,"props":1957,"children":1958},{"class":329,"line":507},[1959,1963,1968,1972,1976,1981,1985,1990,1994,1999],{"type":46,"tag":327,"props":1960,"children":1961},{"style":759},[1962],{"type":52,"value":1535},{"type":46,"tag":327,"props":1964,"children":1965},{"style":346},[1966],{"type":52,"value":1967}," formData",{"type":46,"tag":327,"props":1969,"children":1970},{"style":340},[1971],{"type":52,"value":1553},{"type":46,"tag":327,"props":1973,"children":1974},{"style":334},[1975],{"type":52,"value":1558},{"type":46,"tag":327,"props":1977,"children":1978},{"style":346},[1979],{"type":52,"value":1980}," args",{"type":46,"tag":327,"props":1982,"children":1983},{"style":340},[1984],{"type":52,"value":781},{"type":46,"tag":327,"props":1986,"children":1987},{"style":346},[1988],{"type":52,"value":1989},"request",{"type":46,"tag":327,"props":1991,"children":1992},{"style":340},[1993],{"type":52,"value":781},{"type":46,"tag":327,"props":1995,"children":1996},{"style":439},[1997],{"type":52,"value":1998},"formData",{"type":46,"tag":327,"props":2000,"children":2001},{"style":458},[2002],{"type":52,"value":2003},"()\n",{"type":46,"tag":327,"props":2005,"children":2006},{"class":329,"line":546},[2007,2012,2017,2021,2025,2029,2033,2037,2041],{"type":46,"tag":327,"props":2008,"children":2009},{"style":334},[2010],{"type":52,"value":2011},"  await",{"type":46,"tag":327,"props":2013,"children":2014},{"style":439},[2015],{"type":52,"value":2016}," saveData",{"type":46,"tag":327,"props":2018,"children":2019},{"style":458},[2020],{"type":52,"value":446},{"type":46,"tag":327,"props":2022,"children":2023},{"style":346},[2024],{"type":52,"value":1596},{"type":46,"tag":327,"props":2026,"children":2027},{"style":340},[2028],{"type":52,"value":638},{"type":46,"tag":327,"props":2030,"children":2031},{"style":346},[2032],{"type":52,"value":1835},{"type":46,"tag":327,"props":2034,"children":2035},{"style":340},[2036],{"type":52,"value":638},{"type":46,"tag":327,"props":2038,"children":2039},{"style":346},[2040],{"type":52,"value":1967},{"type":46,"tag":327,"props":2042,"children":2043},{"style":458},[2044],{"type":52,"value":566},{"type":46,"tag":327,"props":2046,"children":2047},{"class":329,"line":555},[2048,2052,2056,2060,2064,2069,2073],{"type":46,"tag":327,"props":2049,"children":2050},{"style":334},[2051],{"type":52,"value":883},{"type":46,"tag":327,"props":2053,"children":2054},{"style":439},[2055],{"type":52,"value":1611},{"type":46,"tag":327,"props":2057,"children":2058},{"style":458},[2059],{"type":52,"value":446},{"type":46,"tag":327,"props":2061,"children":2062},{"style":340},[2063],{"type":52,"value":526},{"type":46,"tag":327,"props":2065,"children":2066},{"style":367},[2067],{"type":52,"value":2068},"\u002Fdashboard",{"type":46,"tag":327,"props":2070,"children":2071},{"style":340},[2072],{"type":52,"value":526},{"type":46,"tag":327,"props":2074,"children":2075},{"style":458},[2076],{"type":52,"value":566},{"type":46,"tag":327,"props":2078,"children":2079},{"class":329,"line":902},[2080],{"type":46,"tag":327,"props":2081,"children":2082},{"style":340},[2083],{"type":52,"value":908},{"type":46,"tag":70,"props":2085,"children":2087},{"id":2086},"client-components",[2088],{"type":52,"value":2089},"Client Components",{"type":46,"tag":280,"props":2091,"children":2093},{"className":575,"code":2092,"language":577,"meta":288,"style":288},"import { useAuth, useUser } from '@clerk\u002Freact-router'\n\nexport function Profile() {\n  const { userId, isSignedIn } = useAuth()\n  const { user } = useUser()\n  if (!isSignedIn) return null\n  return \u003Cp>{user?.firstName}\u003C\u002Fp>\n}\n",[2094],{"type":46,"tag":61,"props":2095,"children":2096},{"__ignoreMap":288},[2097,2142,2149,2174,2214,2246,2280,2329],{"type":46,"tag":327,"props":2098,"children":2099},{"class":329,"line":330},[2100,2104,2108,2113,2117,2122,2126,2130,2134,2138],{"type":46,"tag":327,"props":2101,"children":2102},{"style":334},[2103],{"type":52,"value":337},{"type":46,"tag":327,"props":2105,"children":2106},{"style":340},[2107],{"type":52,"value":343},{"type":46,"tag":327,"props":2109,"children":2110},{"style":346},[2111],{"type":52,"value":2112}," useAuth",{"type":46,"tag":327,"props":2114,"children":2115},{"style":340},[2116],{"type":52,"value":638},{"type":46,"tag":327,"props":2118,"children":2119},{"style":346},[2120],{"type":52,"value":2121}," useUser",{"type":46,"tag":327,"props":2123,"children":2124},{"style":340},[2125],{"type":52,"value":354},{"type":46,"tag":327,"props":2127,"children":2128},{"style":334},[2129],{"type":52,"value":359},{"type":46,"tag":327,"props":2131,"children":2132},{"style":340},[2133],{"type":52,"value":364},{"type":46,"tag":327,"props":2135,"children":2136},{"style":367},[2137],{"type":52,"value":66},{"type":46,"tag":327,"props":2139,"children":2140},{"style":340},[2141],{"type":52,"value":375},{"type":46,"tag":327,"props":2143,"children":2144},{"class":329,"line":378},[2145],{"type":46,"tag":327,"props":2146,"children":2147},{"emptyLinePlaceholder":420},[2148],{"type":52,"value":423},{"type":46,"tag":327,"props":2150,"children":2151},{"class":329,"line":416},[2152,2156,2160,2165,2170],{"type":46,"tag":327,"props":2153,"children":2154},{"style":334},[2155],{"type":52,"value":431},{"type":46,"tag":327,"props":2157,"children":2158},{"style":759},[2159],{"type":52,"value":834},{"type":46,"tag":327,"props":2161,"children":2162},{"style":439},[2163],{"type":52,"value":2164}," Profile",{"type":46,"tag":327,"props":2166,"children":2167},{"style":340},[2168],{"type":52,"value":2169},"()",{"type":46,"tag":327,"props":2171,"children":2172},{"style":340},[2173],{"type":52,"value":504},{"type":46,"tag":327,"props":2175,"children":2176},{"class":329,"line":30},[2177,2181,2185,2189,2193,2198,2202,2206,2210],{"type":46,"tag":327,"props":2178,"children":2179},{"style":759},[2180],{"type":52,"value":1535},{"type":46,"tag":327,"props":2182,"children":2183},{"style":340},[2184],{"type":52,"value":343},{"type":46,"tag":327,"props":2186,"children":2187},{"style":346},[2188],{"type":52,"value":1544},{"type":46,"tag":327,"props":2190,"children":2191},{"style":340},[2192],{"type":52,"value":638},{"type":46,"tag":327,"props":2194,"children":2195},{"style":346},[2196],{"type":52,"value":2197}," isSignedIn",{"type":46,"tag":327,"props":2199,"children":2200},{"style":340},[2201],{"type":52,"value":354},{"type":46,"tag":327,"props":2203,"children":2204},{"style":340},[2205],{"type":52,"value":1553},{"type":46,"tag":327,"props":2207,"children":2208},{"style":439},[2209],{"type":52,"value":2112},{"type":46,"tag":327,"props":2211,"children":2212},{"style":458},[2213],{"type":52,"value":2003},{"type":46,"tag":327,"props":2215,"children":2216},{"class":329,"line":454},[2217,2221,2225,2230,2234,2238,2242],{"type":46,"tag":327,"props":2218,"children":2219},{"style":759},[2220],{"type":52,"value":1535},{"type":46,"tag":327,"props":2222,"children":2223},{"style":340},[2224],{"type":52,"value":343},{"type":46,"tag":327,"props":2226,"children":2227},{"style":346},[2228],{"type":52,"value":2229}," user",{"type":46,"tag":327,"props":2231,"children":2232},{"style":340},[2233],{"type":52,"value":354},{"type":46,"tag":327,"props":2235,"children":2236},{"style":340},[2237],{"type":52,"value":1553},{"type":46,"tag":327,"props":2239,"children":2240},{"style":439},[2241],{"type":52,"value":2121},{"type":46,"tag":327,"props":2243,"children":2244},{"style":458},[2245],{"type":52,"value":2003},{"type":46,"tag":327,"props":2247,"children":2248},{"class":329,"line":489},[2249,2253,2257,2261,2266,2270,2275],{"type":46,"tag":327,"props":2250,"children":2251},{"style":334},[2252],{"type":52,"value":1582},{"type":46,"tag":327,"props":2254,"children":2255},{"style":458},[2256],{"type":52,"value":1329},{"type":46,"tag":327,"props":2258,"children":2259},{"style":340},[2260],{"type":52,"value":1591},{"type":46,"tag":327,"props":2262,"children":2263},{"style":346},[2264],{"type":52,"value":2265},"isSignedIn",{"type":46,"tag":327,"props":2267,"children":2268},{"style":458},[2269],{"type":52,"value":1601},{"type":46,"tag":327,"props":2271,"children":2272},{"style":334},[2273],{"type":52,"value":2274},"return",{"type":46,"tag":327,"props":2276,"children":2277},{"style":340},[2278],{"type":52,"value":2279}," null\n",{"type":46,"tag":327,"props":2281,"children":2282},{"class":329,"line":507},[2283,2287,2292,2296,2301,2306,2311,2316,2321,2325],{"type":46,"tag":327,"props":2284,"children":2285},{"style":334},[2286],{"type":52,"value":883},{"type":46,"tag":327,"props":2288,"children":2289},{"style":340},[2290],{"type":52,"value":2291}," \u003C",{"type":46,"tag":327,"props":2293,"children":2294},{"style":458},[2295],{"type":52,"value":55},{"type":46,"tag":327,"props":2297,"children":2298},{"style":340},[2299],{"type":52,"value":2300},">{",{"type":46,"tag":327,"props":2302,"children":2303},{"style":346},[2304],{"type":52,"value":2305},"user",{"type":46,"tag":327,"props":2307,"children":2308},{"style":340},[2309],{"type":52,"value":2310},"?.",{"type":46,"tag":327,"props":2312,"children":2313},{"style":346},[2314],{"type":52,"value":2315},"firstName",{"type":46,"tag":327,"props":2317,"children":2318},{"style":340},[2319],{"type":52,"value":2320},"}\u003C\u002F",{"type":46,"tag":327,"props":2322,"children":2323},{"style":458},[2324],{"type":52,"value":55},{"type":46,"tag":327,"props":2326,"children":2327},{"style":340},[2328],{"type":52,"value":1056},{"type":46,"tag":327,"props":2330,"children":2331},{"class":329,"line":546},[2332],{"type":46,"tag":327,"props":2333,"children":2334},{"style":340},[2335],{"type":52,"value":908},{"type":46,"tag":70,"props":2337,"children":2339},{"id":2338},"org-switching",[2340],{"type":52,"value":2341},"Org Switching",{"type":46,"tag":280,"props":2343,"children":2345},{"className":575,"code":2344,"language":577,"meta":288,"style":288},"import { OrganizationSwitcher } from '@clerk\u002Freact-router'\n\nexport function Nav() {\n  return \u003COrganizationSwitcher afterSelectOrganizationUrl=\"\u002Fdashboard\" \u002F>\n}\n",[2346],{"type":46,"tag":61,"props":2347,"children":2348},{"__ignoreMap":288},[2349,2385,2392,2416,2458],{"type":46,"tag":327,"props":2350,"children":2351},{"class":329,"line":330},[2352,2356,2360,2365,2369,2373,2377,2381],{"type":46,"tag":327,"props":2353,"children":2354},{"style":334},[2355],{"type":52,"value":337},{"type":46,"tag":327,"props":2357,"children":2358},{"style":340},[2359],{"type":52,"value":343},{"type":46,"tag":327,"props":2361,"children":2362},{"style":346},[2363],{"type":52,"value":2364}," OrganizationSwitcher",{"type":46,"tag":327,"props":2366,"children":2367},{"style":340},[2368],{"type":52,"value":354},{"type":46,"tag":327,"props":2370,"children":2371},{"style":334},[2372],{"type":52,"value":359},{"type":46,"tag":327,"props":2374,"children":2375},{"style":340},[2376],{"type":52,"value":364},{"type":46,"tag":327,"props":2378,"children":2379},{"style":367},[2380],{"type":52,"value":66},{"type":46,"tag":327,"props":2382,"children":2383},{"style":340},[2384],{"type":52,"value":375},{"type":46,"tag":327,"props":2386,"children":2387},{"class":329,"line":378},[2388],{"type":46,"tag":327,"props":2389,"children":2390},{"emptyLinePlaceholder":420},[2391],{"type":52,"value":423},{"type":46,"tag":327,"props":2393,"children":2394},{"class":329,"line":416},[2395,2399,2403,2408,2412],{"type":46,"tag":327,"props":2396,"children":2397},{"style":334},[2398],{"type":52,"value":431},{"type":46,"tag":327,"props":2400,"children":2401},{"style":759},[2402],{"type":52,"value":834},{"type":46,"tag":327,"props":2404,"children":2405},{"style":439},[2406],{"type":52,"value":2407}," Nav",{"type":46,"tag":327,"props":2409,"children":2410},{"style":340},[2411],{"type":52,"value":2169},{"type":46,"tag":327,"props":2413,"children":2414},{"style":340},[2415],{"type":52,"value":504},{"type":46,"tag":327,"props":2417,"children":2418},{"class":329,"line":30},[2419,2423,2427,2432,2437,2441,2446,2450,2454],{"type":46,"tag":327,"props":2420,"children":2421},{"style":334},[2422],{"type":52,"value":883},{"type":46,"tag":327,"props":2424,"children":2425},{"style":340},[2426],{"type":52,"value":2291},{"type":46,"tag":327,"props":2428,"children":2429},{"style":774},[2430],{"type":52,"value":2431},"OrganizationSwitcher",{"type":46,"tag":327,"props":2433,"children":2434},{"style":759},[2435],{"type":52,"value":2436}," afterSelectOrganizationUrl",{"type":46,"tag":327,"props":2438,"children":2439},{"style":340},[2440],{"type":52,"value":796},{"type":46,"tag":327,"props":2442,"children":2443},{"style":340},[2444],{"type":52,"value":2445},"\"",{"type":46,"tag":327,"props":2447,"children":2448},{"style":367},[2449],{"type":52,"value":2068},{"type":46,"tag":327,"props":2451,"children":2452},{"style":340},[2453],{"type":52,"value":2445},{"type":46,"tag":327,"props":2455,"children":2456},{"style":340},[2457],{"type":52,"value":1038},{"type":46,"tag":327,"props":2459,"children":2460},{"class":329,"line":454},[2461],{"type":46,"tag":327,"props":2462,"children":2463},{"style":340},[2464],{"type":52,"value":908},{"type":46,"tag":280,"props":2466,"children":2468},{"className":575,"code":2467,"language":577,"meta":288,"style":288},"export async function loader(args: Route.LoaderArgs) {\n  const { userId, orgId } = await getAuth(args)\n  if (!userId) throw redirect('\u002Fsign-in')\n  if (!orgId) throw redirect('\u002Fselect-org')\n\n  return { data: await fetchOrgData(orgId) }\n}\n",[2469],{"type":46,"tag":61,"props":2470,"children":2471},{"__ignoreMap":288},[2472,2523,2574,2625,2678,2685,2729],{"type":46,"tag":327,"props":2473,"children":2474},{"class":329,"line":330},[2475,2479,2483,2487,2491,2495,2499,2503,2507,2511,2515,2519],{"type":46,"tag":327,"props":2476,"children":2477},{"style":334},[2478],{"type":52,"value":431},{"type":46,"tag":327,"props":2480,"children":2481},{"style":759},[2482],{"type":52,"value":829},{"type":46,"tag":327,"props":2484,"children":2485},{"style":759},[2486],{"type":52,"value":834},{"type":46,"tag":327,"props":2488,"children":2489},{"style":439},[2490],{"type":52,"value":839},{"type":46,"tag":327,"props":2492,"children":2493},{"style":340},[2494],{"type":52,"value":446},{"type":46,"tag":327,"props":2496,"children":2497},{"style":846},[2498],{"type":52,"value":849},{"type":46,"tag":327,"props":2500,"children":2501},{"style":340},[2502],{"type":52,"value":466},{"type":46,"tag":327,"props":2504,"children":2505},{"style":774},[2506],{"type":52,"value":721},{"type":46,"tag":327,"props":2508,"children":2509},{"style":340},[2510],{"type":52,"value":781},{"type":46,"tag":327,"props":2512,"children":2513},{"style":774},[2514],{"type":52,"value":866},{"type":46,"tag":327,"props":2516,"children":2517},{"style":340},[2518],{"type":52,"value":871},{"type":46,"tag":327,"props":2520,"children":2521},{"style":340},[2522],{"type":52,"value":504},{"type":46,"tag":327,"props":2524,"children":2525},{"class":329,"line":378},[2526,2530,2534,2538,2542,2546,2550,2554,2558,2562,2566,2570],{"type":46,"tag":327,"props":2527,"children":2528},{"style":759},[2529],{"type":52,"value":1535},{"type":46,"tag":327,"props":2531,"children":2532},{"style":340},[2533],{"type":52,"value":343},{"type":46,"tag":327,"props":2535,"children":2536},{"style":346},[2537],{"type":52,"value":1544},{"type":46,"tag":327,"props":2539,"children":2540},{"style":340},[2541],{"type":52,"value":638},{"type":46,"tag":327,"props":2543,"children":2544},{"style":346},[2545],{"type":52,"value":1835},{"type":46,"tag":327,"props":2547,"children":2548},{"style":340},[2549],{"type":52,"value":354},{"type":46,"tag":327,"props":2551,"children":2552},{"style":340},[2553],{"type":52,"value":1553},{"type":46,"tag":327,"props":2555,"children":2556},{"style":334},[2557],{"type":52,"value":1558},{"type":46,"tag":327,"props":2559,"children":2560},{"style":439},[2561],{"type":52,"value":1409},{"type":46,"tag":327,"props":2563,"children":2564},{"style":458},[2565],{"type":52,"value":446},{"type":46,"tag":327,"props":2567,"children":2568},{"style":346},[2569],{"type":52,"value":849},{"type":46,"tag":327,"props":2571,"children":2572},{"style":458},[2573],{"type":52,"value":566},{"type":46,"tag":327,"props":2575,"children":2576},{"class":329,"line":416},[2577,2581,2585,2589,2593,2597,2601,2605,2609,2613,2617,2621],{"type":46,"tag":327,"props":2578,"children":2579},{"style":334},[2580],{"type":52,"value":1582},{"type":46,"tag":327,"props":2582,"children":2583},{"style":458},[2584],{"type":52,"value":1329},{"type":46,"tag":327,"props":2586,"children":2587},{"style":340},[2588],{"type":52,"value":1591},{"type":46,"tag":327,"props":2590,"children":2591},{"style":346},[2592],{"type":52,"value":1596},{"type":46,"tag":327,"props":2594,"children":2595},{"style":458},[2596],{"type":52,"value":1601},{"type":46,"tag":327,"props":2598,"children":2599},{"style":334},[2600],{"type":52,"value":1606},{"type":46,"tag":327,"props":2602,"children":2603},{"style":439},[2604],{"type":52,"value":1611},{"type":46,"tag":327,"props":2606,"children":2607},{"style":458},[2608],{"type":52,"value":446},{"type":46,"tag":327,"props":2610,"children":2611},{"style":340},[2612],{"type":52,"value":526},{"type":46,"tag":327,"props":2614,"children":2615},{"style":367},[2616],{"type":52,"value":1624},{"type":46,"tag":327,"props":2618,"children":2619},{"style":340},[2620],{"type":52,"value":526},{"type":46,"tag":327,"props":2622,"children":2623},{"style":458},[2624],{"type":52,"value":566},{"type":46,"tag":327,"props":2626,"children":2627},{"class":329,"line":30},[2628,2632,2636,2640,2645,2649,2653,2657,2661,2665,2670,2674],{"type":46,"tag":327,"props":2629,"children":2630},{"style":334},[2631],{"type":52,"value":1582},{"type":46,"tag":327,"props":2633,"children":2634},{"style":458},[2635],{"type":52,"value":1329},{"type":46,"tag":327,"props":2637,"children":2638},{"style":340},[2639],{"type":52,"value":1591},{"type":46,"tag":327,"props":2641,"children":2642},{"style":346},[2643],{"type":52,"value":2644},"orgId",{"type":46,"tag":327,"props":2646,"children":2647},{"style":458},[2648],{"type":52,"value":1601},{"type":46,"tag":327,"props":2650,"children":2651},{"style":334},[2652],{"type":52,"value":1606},{"type":46,"tag":327,"props":2654,"children":2655},{"style":439},[2656],{"type":52,"value":1611},{"type":46,"tag":327,"props":2658,"children":2659},{"style":458},[2660],{"type":52,"value":446},{"type":46,"tag":327,"props":2662,"children":2663},{"style":340},[2664],{"type":52,"value":526},{"type":46,"tag":327,"props":2666,"children":2667},{"style":367},[2668],{"type":52,"value":2669},"\u002Fselect-org",{"type":46,"tag":327,"props":2671,"children":2672},{"style":340},[2673],{"type":52,"value":526},{"type":46,"tag":327,"props":2675,"children":2676},{"style":458},[2677],{"type":52,"value":566},{"type":46,"tag":327,"props":2679,"children":2680},{"class":329,"line":454},[2681],{"type":46,"tag":327,"props":2682,"children":2683},{"emptyLinePlaceholder":420},[2684],{"type":52,"value":423},{"type":46,"tag":327,"props":2686,"children":2687},{"class":329,"line":489},[2688,2692,2696,2700,2704,2708,2713,2717,2721,2725],{"type":46,"tag":327,"props":2689,"children":2690},{"style":334},[2691],{"type":52,"value":883},{"type":46,"tag":327,"props":2693,"children":2694},{"style":340},[2695],{"type":52,"value":343},{"type":46,"tag":327,"props":2697,"children":2698},{"style":458},[2699],{"type":52,"value":1651},{"type":46,"tag":327,"props":2701,"children":2702},{"style":340},[2703],{"type":52,"value":466},{"type":46,"tag":327,"props":2705,"children":2706},{"style":334},[2707],{"type":52,"value":1558},{"type":46,"tag":327,"props":2709,"children":2710},{"style":439},[2711],{"type":52,"value":2712}," fetchOrgData",{"type":46,"tag":327,"props":2714,"children":2715},{"style":458},[2716],{"type":52,"value":446},{"type":46,"tag":327,"props":2718,"children":2719},{"style":346},[2720],{"type":52,"value":2644},{"type":46,"tag":327,"props":2722,"children":2723},{"style":458},[2724],{"type":52,"value":1601},{"type":46,"tag":327,"props":2726,"children":2727},{"style":340},[2728],{"type":52,"value":908},{"type":46,"tag":327,"props":2730,"children":2731},{"class":329,"line":507},[2732],{"type":46,"tag":327,"props":2733,"children":2734},{"style":340},[2735],{"type":52,"value":908},{"type":46,"tag":70,"props":2737,"children":2739},{"id":2738},"common-pitfalls",[2740],{"type":52,"value":2741},"Common Pitfalls",{"type":46,"tag":77,"props":2743,"children":2744},{},[2745,2766],{"type":46,"tag":81,"props":2746,"children":2747},{},[2748],{"type":46,"tag":85,"props":2749,"children":2750},{},[2751,2756,2761],{"type":46,"tag":89,"props":2752,"children":2753},{},[2754],{"type":52,"value":2755},"Symptom",{"type":46,"tag":89,"props":2757,"children":2758},{},[2759],{"type":52,"value":2760},"Cause",{"type":46,"tag":89,"props":2762,"children":2763},{},[2764],{"type":52,"value":2765},"Fix",{"type":46,"tag":100,"props":2767,"children":2768},{},[2769,2824,2866,2909,2947,2988,3013],{"type":46,"tag":85,"props":2770,"children":2771},{},[2772,2783,2803],{"type":46,"tag":107,"props":2773,"children":2774},{},[2775,2781],{"type":46,"tag":61,"props":2776,"children":2778},{"className":2777},[],[2779],{"type":52,"value":2780},"useNavigate() may be used only in the context of a \u003CRouter>",{"type":52,"value":2782}," thrown from ClerkProvider during SSR in dev (v8)",{"type":46,"tag":107,"props":2784,"children":2785},{},[2786,2788,2793,2795,2801],{"type":52,"value":2787},"Vite dev SSR externalizes ",{"type":46,"tag":61,"props":2789,"children":2791},{"className":2790},[],[2792],{"type":52,"value":66},{"type":52,"value":2794},", which then loads react-router's production build while the app uses the development build — two Router contexts. A single copy in ",{"type":46,"tag":61,"props":2796,"children":2798},{"className":2797},[],[2799],{"type":52,"value":2800},"npm ls",{"type":52,"value":2802}," does not rule this out.",{"type":46,"tag":107,"props":2804,"children":2805},{},[2806,2808,2814,2816,2822],{"type":52,"value":2807},"Add ",{"type":46,"tag":61,"props":2809,"children":2811},{"className":2810},[],[2812],{"type":52,"value":2813},"ssr: { noExternal: ['@clerk\u002Freact-router'] }",{"type":52,"value":2815}," to ",{"type":46,"tag":61,"props":2817,"children":2819},{"className":2818},[],[2820],{"type":52,"value":2821},"vite.config.ts",{"type":52,"value":2823},". Do NOT downgrade to v7",{"type":46,"tag":85,"props":2825,"children":2826},{},[2827,2839,2854],{"type":46,"tag":107,"props":2828,"children":2829},{},[2830,2832,2837],{"type":52,"value":2831},"Build error: ",{"type":46,"tag":61,"props":2833,"children":2835},{"className":2834},[],[2836],{"type":52,"value":1084},{"type":52,"value":2838}," is not exported",{"type":46,"tag":107,"props":2840,"children":2841},{},[2842,2847,2849],{"type":46,"tag":61,"props":2843,"children":2845},{"className":2844},[],[2846],{"type":52,"value":1084},{"type":52,"value":2848}," does not exist in ",{"type":46,"tag":61,"props":2850,"children":2852},{"className":2851},[],[2853],{"type":52,"value":66},{"type":46,"tag":107,"props":2855,"children":2856},{},[2857,2859,2864],{"type":52,"value":2858},"Use ",{"type":46,"tag":61,"props":2860,"children":2862},{"className":2861},[],[2863],{"type":52,"value":1107},{"type":52,"value":2865}," in root.tsx's default export",{"type":46,"tag":85,"props":2867,"children":2868},{},[2869,2878,2891],{"type":46,"tag":107,"props":2870,"children":2871},{},[2872],{"type":46,"tag":61,"props":2873,"children":2875},{"className":2874},[],[2876],{"type":52,"value":2877},"clerkMiddleware() not detected",{"type":46,"tag":107,"props":2879,"children":2880},{},[2881,2883,2889],{"type":52,"value":2882},"Missing middleware (or on v7, missing ",{"type":46,"tag":61,"props":2884,"children":2886},{"className":2885},[],[2887],{"type":52,"value":2888},"v8_middleware",{"type":52,"value":2890}," future flag)",{"type":46,"tag":107,"props":2892,"children":2893},{},[2894,2896,2902,2904],{"type":52,"value":2895},"Export ",{"type":46,"tag":61,"props":2897,"children":2899},{"className":2898},[],[2900],{"type":52,"value":2901},"middleware = [clerkMiddleware()]",{"type":52,"value":2903}," from root route; on v7 also set ",{"type":46,"tag":61,"props":2905,"children":2907},{"className":2906},[],[2908],{"type":52,"value":204},{"type":46,"tag":85,"props":2910,"children":2911},{},[2912,2917,2934],{"type":46,"tag":107,"props":2913,"children":2914},{},[2915],{"type":52,"value":2916},"Unknown future flag error\u002Fwarning (v8)",{"type":46,"tag":107,"props":2918,"children":2919},{},[2920,2925,2927,2932],{"type":46,"tag":61,"props":2921,"children":2923},{"className":2922},[],[2924],{"type":52,"value":2888},{"type":52,"value":2926}," flag left in ",{"type":46,"tag":61,"props":2928,"children":2930},{"className":2929},[],[2931],{"type":52,"value":212},{"type":52,"value":2933}," after upgrading",{"type":46,"tag":107,"props":2935,"children":2936},{},[2937,2939,2945],{"type":52,"value":2938},"Remove the ",{"type":46,"tag":61,"props":2940,"children":2942},{"className":2941},[],[2943],{"type":52,"value":2944},"future.v8_middleware",{"type":52,"value":2946}," entry — middleware is always on in v8",{"type":46,"tag":85,"props":2948,"children":2949},{},[2950,2960,2970],{"type":46,"tag":107,"props":2951,"children":2952},{},[2953,2958],{"type":46,"tag":61,"props":2954,"children":2956},{"className":2955},[],[2957],{"type":52,"value":1301},{"type":52,"value":2959}," returns empty userId",{"type":46,"tag":107,"props":2961,"children":2962},{},[2963,2968],{"type":46,"tag":61,"props":2964,"children":2966},{"className":2965},[],[2967],{"type":52,"value":1285},{"type":52,"value":2969}," not called",{"type":46,"tag":107,"props":2971,"children":2972},{},[2973,2975,2981,2982,2987],{"type":52,"value":2974},"Call ",{"type":46,"tag":61,"props":2976,"children":2978},{"className":2977},[],[2979],{"type":52,"value":2980},"rootAuthLoader(args)",{"type":52,"value":206},{"type":46,"tag":61,"props":2983,"children":2985},{"className":2984},[],[2986],{"type":52,"value":1293},{"type":52,"value":839},{"type":46,"tag":85,"props":2989,"children":2990},{},[2991,2996,3001],{"type":46,"tag":107,"props":2992,"children":2993},{},[2994],{"type":52,"value":2995},"Infinite redirect loop",{"type":46,"tag":107,"props":2997,"children":2998},{},[2999],{"type":52,"value":3000},"Redirect target is also protected",{"type":46,"tag":107,"props":3002,"children":3003},{},[3004,3006,3011],{"type":52,"value":3005},"Exclude ",{"type":46,"tag":61,"props":3007,"children":3009},{"className":3008},[],[3010],{"type":52,"value":1624},{"type":52,"value":3012}," from protection check",{"type":46,"tag":85,"props":3014,"children":3015},{},[3016,3027,3046],{"type":46,"tag":107,"props":3017,"children":3018},{},[3019,3025],{"type":46,"tag":61,"props":3020,"children":3022},{"className":3021},[],[3023],{"type":52,"value":3024},"redirect",{"type":52,"value":3026}," not working in action",{"type":46,"tag":107,"props":3028,"children":3029},{},[3030,3032,3038,3040],{"type":52,"value":3031},"Using ",{"type":46,"tag":61,"props":3033,"children":3035},{"className":3034},[],[3036],{"type":52,"value":3037},"Response",{"type":52,"value":3039}," instead of ",{"type":46,"tag":61,"props":3041,"children":3043},{"className":3042},[],[3044],{"type":52,"value":3045},"throw redirect()",{"type":46,"tag":107,"props":3047,"children":3048},{},[3049,3050,3056,3058],{"type":52,"value":2858},{"type":46,"tag":61,"props":3051,"children":3053},{"className":3052},[],[3054],{"type":52,"value":3055},"throw redirect('\u002Fpath')",{"type":52,"value":3057}," from ",{"type":46,"tag":61,"props":3059,"children":3061},{"className":3060},[],[3062],{"type":52,"value":25},{"type":46,"tag":70,"props":3064,"children":3066},{"id":3065},"import-map",[3067],{"type":52,"value":3068},"Import Map",{"type":46,"tag":77,"props":3070,"children":3071},{},[3072,3088],{"type":46,"tag":81,"props":3073,"children":3074},{},[3075],{"type":46,"tag":85,"props":3076,"children":3077},{},[3078,3083],{"type":46,"tag":89,"props":3079,"children":3080},{},[3081],{"type":52,"value":3082},"What",{"type":46,"tag":89,"props":3084,"children":3085},{},[3086],{"type":52,"value":3087},"Import From",{"type":46,"tag":100,"props":3089,"children":3090},{},[3091,3110,3129,3148,3167,3195],{"type":46,"tag":85,"props":3092,"children":3093},{},[3094,3102],{"type":46,"tag":107,"props":3095,"children":3096},{},[3097],{"type":46,"tag":61,"props":3098,"children":3100},{"className":3099},[],[3101],{"type":52,"value":1301},{"type":46,"tag":107,"props":3103,"children":3104},{},[3105],{"type":46,"tag":61,"props":3106,"children":3108},{"className":3107},[],[3109],{"type":52,"value":660},{"type":46,"tag":85,"props":3111,"children":3112},{},[3113,3121],{"type":46,"tag":107,"props":3114,"children":3115},{},[3116],{"type":46,"tag":61,"props":3117,"children":3119},{"className":3118},[],[3120],{"type":52,"value":1285},{"type":46,"tag":107,"props":3122,"children":3123},{},[3124],{"type":46,"tag":61,"props":3125,"children":3127},{"className":3126},[],[3128],{"type":52,"value":660},{"type":46,"tag":85,"props":3130,"children":3131},{},[3132,3140],{"type":46,"tag":107,"props":3133,"children":3134},{},[3135],{"type":46,"tag":61,"props":3136,"children":3138},{"className":3137},[],[3139],{"type":52,"value":805},{"type":46,"tag":107,"props":3141,"children":3142},{},[3143],{"type":46,"tag":61,"props":3144,"children":3146},{"className":3145},[],[3147],{"type":52,"value":660},{"type":46,"tag":85,"props":3149,"children":3150},{},[3151,3159],{"type":46,"tag":107,"props":3152,"children":3153},{},[3154],{"type":46,"tag":61,"props":3155,"children":3157},{"className":3156},[],[3158],{"type":52,"value":1000},{"type":46,"tag":107,"props":3160,"children":3161},{},[3162],{"type":46,"tag":61,"props":3163,"children":3165},{"className":3164},[],[3166],{"type":52,"value":66},{"type":46,"tag":85,"props":3168,"children":3169},{},[3170,3187],{"type":46,"tag":107,"props":3171,"children":3172},{},[3173,3179,3181],{"type":46,"tag":61,"props":3174,"children":3176},{"className":3175},[],[3177],{"type":52,"value":3178},"useAuth",{"type":52,"value":3180},", ",{"type":46,"tag":61,"props":3182,"children":3184},{"className":3183},[],[3185],{"type":52,"value":3186},"useUser",{"type":46,"tag":107,"props":3188,"children":3189},{},[3190],{"type":46,"tag":61,"props":3191,"children":3193},{"className":3192},[],[3194],{"type":52,"value":66},{"type":46,"tag":85,"props":3196,"children":3197},{},[3198,3206],{"type":46,"tag":107,"props":3199,"children":3200},{},[3201],{"type":46,"tag":61,"props":3202,"children":3204},{"className":3203},[],[3205],{"type":52,"value":2431},{"type":46,"tag":107,"props":3207,"children":3208},{},[3209],{"type":46,"tag":61,"props":3210,"children":3212},{"className":3211},[],[3213],{"type":52,"value":66},{"type":46,"tag":70,"props":3215,"children":3217},{"id":3216},"see-also",[3218],{"type":52,"value":3219},"See Also",{"type":46,"tag":1316,"props":3221,"children":3222},{},[3223,3234,3245],{"type":46,"tag":1320,"props":3224,"children":3225},{},[3226,3232],{"type":46,"tag":61,"props":3227,"children":3229},{"className":3228},[],[3230],{"type":52,"value":3231},"clerk-setup",{"type":52,"value":3233}," - Initial Clerk install",{"type":46,"tag":1320,"props":3235,"children":3236},{},[3237,3243],{"type":46,"tag":61,"props":3238,"children":3240},{"className":3239},[],[3241],{"type":52,"value":3242},"clerk-custom-ui",{"type":52,"value":3244}," - Custom flows & appearance",{"type":46,"tag":1320,"props":3246,"children":3247},{},[3248,3254],{"type":46,"tag":61,"props":3249,"children":3251},{"className":3250},[],[3252],{"type":52,"value":3253},"clerk-orgs",{"type":52,"value":3255}," - B2B organizations",{"type":46,"tag":70,"props":3257,"children":3259},{"id":3258},"docs",[3260],{"type":52,"value":3261},"Docs",{"type":46,"tag":55,"props":3263,"children":3264},{},[3265],{"type":46,"tag":308,"props":3266,"children":3269},{"href":3267,"rel":3268},"https:\u002F\u002Fclerk.com\u002Fdocs\u002Freact-router\u002Fgetting-started\u002Fquickstart",[312],[3270],{"type":52,"value":3271},"React Router SDK",{"type":46,"tag":3273,"props":3274,"children":3275},"style",{},[3276],{"type":52,"value":3277},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":3279,"total":3467},[3280,3294,3309,3325,3341,3357,3375,3392,3407,3424,3439,3453],{"slug":8,"name":8,"fn":3281,"description":3282,"org":3283,"tags":3284,"stars":26,"repoUrl":27,"updatedAt":3293},"route Clerk authentication requests","Clerk authentication router. Use when user asks about Clerk CLI operations, adding authentication, setting up Clerk, custom sign-in flows, Swift or native iOS auth, native Android auth, Next.js patterns, React patterns, Vue patterns, Nuxt patterns, Astro patterns, TanStack Start patterns, Expo patterns, React Router patterns, Chrome Extension patterns, organizations, billing, subscriptions, payments, pricing, plans, seat-based pricing, feature entitlements, syncing users, testing, impersonating a user, or testing webhooks locally. Automatically routes to the specific skill based on their task.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3285,3286,3287,3290],{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"name":3288,"slug":3289,"type":15},"Mobile","mobile",{"name":3291,"slug":3292,"type":15},"Web Development","web-development","2026-07-18T05:12:23.438307",{"slug":3295,"name":3295,"fn":3296,"description":3297,"org":3298,"tags":3299,"stars":26,"repoUrl":27,"updatedAt":3308},"clerk-android","implement Clerk auth for native Android apps","Implement Clerk authentication for native Android apps using Kotlin and Jetpack Compose with clerk-android source-guided patterns. Use for prebuilt AuthView\u002FUserButton or custom API-driven auth flows. Do not use for Expo or React Native projects.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3300,3303,3304,3307],{"name":3301,"slug":3302,"type":15},"Android","android",{"name":9,"slug":8,"type":15},{"name":3305,"slug":3306,"type":15},"Kotlin","kotlin",{"name":3288,"slug":3289,"type":15},"2026-04-10T05:00:18.622871",{"slug":3310,"name":3310,"fn":3311,"description":3312,"org":3313,"tags":3314,"stars":26,"repoUrl":27,"updatedAt":3324},"clerk-astro-patterns","implement Clerk auth in Astro apps","Astro patterns with Clerk — middleware, SSR pages, island components, API routes, static vs SSR rendering. Triggers on: astro clerk, clerk astro middleware, astro protected page, clerk island component, astro API route auth, clerk astro SSR.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3315,3318,3319,3320,3321],{"name":3316,"slug":3317,"type":15},"Astro","astro",{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"name":21,"slug":22,"type":15},{"name":3322,"slug":3323,"type":15},"Serverless","serverless","2026-04-07T04:46:14.731808",{"slug":3326,"name":3326,"fn":3327,"description":3328,"org":3329,"tags":3330,"stars":26,"repoUrl":27,"updatedAt":3340},"clerk-backend-api","execute Clerk Backend API requests","Clerk Backend REST API explorer and executor. Browse tags, inspect endpoint schemas, and execute authenticated requests. Use when listing users, managing organizations, or calling any Clerk API endpoint.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3331,3334,3335,3336,3337],{"name":3332,"slug":3333,"type":15},"API Development","api-development",{"name":18,"slug":19,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":3338,"slug":3339,"type":15},"REST API","rest-api","2026-04-10T05:00:08.728072",{"slug":3342,"name":3342,"fn":3343,"description":3344,"org":3345,"tags":3346,"stars":26,"repoUrl":27,"updatedAt":3356},"clerk-billing","manage subscriptions with Clerk Billing","Clerk Billing for subscription management - render Clerk's PricingTable and in-app checkout drawer, configure subscription plans, seat-limit plans for B2B, feature entitlements with has(), and billing webhooks. Use for SaaS monetization, plan gating, checkout flows, trials, invoicing, and subscription lifecycle management.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3347,3348,3349,3350,3353],{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"name":21,"slug":22,"type":15},{"name":3351,"slug":3352,"type":15},"Payments","payments",{"name":3354,"slug":3355,"type":15},"SaaS","saas","2026-04-29T05:37:27.130955",{"slug":3358,"name":3358,"fn":3359,"description":3360,"org":3361,"tags":3362,"stars":26,"repoUrl":27,"updatedAt":3374},"clerk-chrome-extension-patterns","implement Clerk auth in Chrome Extensions","Chrome Extension auth with @clerk\u002Fchrome-extension -- popup\u002Fsidepanel setup, syncHost for OAuth\u002FSAML via web app, createClerkClient for service workers and headless extensions, stable CRX ID. Triggers on: Chrome extension auth, Plasmo clerk, popup sign-in, syncHost, background service worker token, createClerkClient, headless extension.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3363,3366,3367,3368,3371],{"name":3364,"slug":3365,"type":15},"Auth","auth",{"name":9,"slug":8,"type":15},{"name":21,"slug":22,"type":15},{"name":3369,"slug":3370,"type":15},"OAuth","oauth",{"name":3372,"slug":3373,"type":15},"Security","security","2026-04-07T04:46:08.489328",{"slug":3376,"name":3376,"fn":3377,"description":3378,"org":3379,"tags":3380,"stars":26,"repoUrl":27,"updatedAt":3391},"clerk-cli","manage Clerk authentication and instances via CLI","Operate the Clerk CLI (`clerk` binary) for authentication, user\u002Forg\u002Fsession management, impersonation, local webhook testing, deploy verification, instance config, env keys, feature toggles, and any Clerk Backend, Platform, or Frontend API call. Use when the user mentions Clerk management tasks, \"list clerk users\", \"impersonate a user\", \"test webhooks locally\", \"enable orgs\", \"enable billing\", \"clerk env pull\", \"clerk doctor\", \"clerk deploy\", \"clerk api\", or any ad-hoc Clerk API request. Prefer the CLI over raw HTTP: it handles auth, key resolution, app\u002Finstance targeting, and formatting automatically.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3381,3382,3383,3384,3387,3390],{"name":3332,"slug":3333,"type":15},{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"name":3385,"slug":3386,"type":15},"CLI","cli",{"name":3388,"slug":3389,"type":15},"Deployment","deployment",{"name":3372,"slug":3373,"type":15},"2026-07-31T05:52:40.580813",{"slug":3242,"name":3242,"fn":3393,"description":3394,"org":3395,"tags":3396,"stars":26,"repoUrl":27,"updatedAt":3406},"customize Clerk UI and auth flows","Custom authentication flows and component appearance - hooks (useSignIn, useSignUp), themes, colors, fonts, CSS. Use for custom sign-in\u002Fsign-up flows, appearance styling, visual customization, branding.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3397,3398,3401,3402,3405],{"name":18,"slug":19,"type":15},{"name":3399,"slug":3400,"type":15},"Branding","branding",{"name":9,"slug":8,"type":15},{"name":3403,"slug":3404,"type":15},"Design","design",{"name":21,"slug":22,"type":15},"2026-04-10T05:00:10.109158",{"slug":3408,"name":3408,"fn":3409,"description":3410,"org":3411,"tags":3412,"stars":26,"repoUrl":27,"updatedAt":3423},"clerk-expo","implement Clerk authentication in Expo apps","Add Clerk authentication to Expo and React Native apps using @clerk\u002Fexpo. Use for Expo setup, prebuilt native components (AuthView, UserButton), custom sign-in\u002Fsign-up flows (email, password, SMS\u002Fphone OTP, MFA), OAuth\u002FSSO, native Google\u002FApple sign-in, Expo Router protected routes, biometrics, and push notifications. Do not use for native Swift\u002FiOS, native Android\u002FKotlin, or web-only framework projects.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3413,3414,3415,3418,3419,3420],{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"name":3416,"slug":3417,"type":15},"Expo","expo",{"name":21,"slug":22,"type":15},{"name":3288,"slug":3289,"type":15},{"name":3421,"slug":3422,"type":15},"React Native","react-native","2026-05-19T06:48:47.074181",{"slug":3425,"name":3425,"fn":3426,"description":3427,"org":3428,"tags":3429,"stars":26,"repoUrl":27,"updatedAt":3438},"clerk-nextjs-patterns","implement advanced Next.js patterns with Clerk","Advanced Next.js patterns - middleware, Server Actions, caching with Clerk.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3430,3431,3432,3435],{"name":9,"slug":8,"type":15},{"name":21,"slug":22,"type":15},{"name":3433,"slug":3434,"type":15},"Next.js","next-js",{"name":3436,"slug":3437,"type":15},"Performance","performance","2026-04-10T05:00:15.80215",{"slug":3440,"name":3440,"fn":3441,"description":3442,"org":3443,"tags":3444,"stars":26,"repoUrl":27,"updatedAt":3452},"clerk-nuxt-patterns","implement Clerk auth in Nuxt 3 apps","Nuxt 3 auth patterns with @clerk\u002Fnuxt - middleware, composables, server API routes, SSR. Triggers on: Nuxt auth, useAuth composable, clerkMiddleware Nuxt, server API Clerk, Nuxt route protection.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3445,3446,3447,3448,3449],{"name":18,"slug":19,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":21,"slug":22,"type":15},{"name":3450,"slug":3451,"type":15},"Nuxt","nuxt","2026-04-07T04:46:18.337538",{"slug":3253,"name":3253,"fn":3454,"description":3455,"org":3456,"tags":3457,"stars":26,"repoUrl":27,"updatedAt":3466},"manage Clerk Organizations for B2B SaaS","Clerk Organizations for B2B SaaS - create multi-tenant apps with org switching, role-based access, verified domains, and enterprise SSO. Use for team workspaces, RBAC, org-based routing, member management.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3458,3459,3462,3465],{"name":9,"slug":8,"type":15},{"name":3460,"slug":3461,"type":15},"Multi-Tenant","multi-tenant",{"name":3463,"slug":3464,"type":15},"RBAC","rbac",{"name":3354,"slug":3355,"type":15},"2026-04-10T05:00:14.40165",20,{"items":3469,"total":3467},[3470,3477,3484,3492,3500,3508,3516],{"slug":8,"name":8,"fn":3281,"description":3282,"org":3471,"tags":3472,"stars":26,"repoUrl":27,"updatedAt":3293},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3473,3474,3475,3476],{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"name":3288,"slug":3289,"type":15},{"name":3291,"slug":3292,"type":15},{"slug":3295,"name":3295,"fn":3296,"description":3297,"org":3478,"tags":3479,"stars":26,"repoUrl":27,"updatedAt":3308},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3480,3481,3482,3483],{"name":3301,"slug":3302,"type":15},{"name":9,"slug":8,"type":15},{"name":3305,"slug":3306,"type":15},{"name":3288,"slug":3289,"type":15},{"slug":3310,"name":3310,"fn":3311,"description":3312,"org":3485,"tags":3486,"stars":26,"repoUrl":27,"updatedAt":3324},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3487,3488,3489,3490,3491],{"name":3316,"slug":3317,"type":15},{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"name":21,"slug":22,"type":15},{"name":3322,"slug":3323,"type":15},{"slug":3326,"name":3326,"fn":3327,"description":3328,"org":3493,"tags":3494,"stars":26,"repoUrl":27,"updatedAt":3340},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3495,3496,3497,3498,3499],{"name":3332,"slug":3333,"type":15},{"name":18,"slug":19,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"name":3338,"slug":3339,"type":15},{"slug":3342,"name":3342,"fn":3343,"description":3344,"org":3501,"tags":3502,"stars":26,"repoUrl":27,"updatedAt":3356},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3503,3504,3505,3506,3507],{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"name":21,"slug":22,"type":15},{"name":3351,"slug":3352,"type":15},{"name":3354,"slug":3355,"type":15},{"slug":3358,"name":3358,"fn":3359,"description":3360,"org":3509,"tags":3510,"stars":26,"repoUrl":27,"updatedAt":3374},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3511,3512,3513,3514,3515],{"name":3364,"slug":3365,"type":15},{"name":9,"slug":8,"type":15},{"name":21,"slug":22,"type":15},{"name":3369,"slug":3370,"type":15},{"name":3372,"slug":3373,"type":15},{"slug":3376,"name":3376,"fn":3377,"description":3378,"org":3517,"tags":3518,"stars":26,"repoUrl":27,"updatedAt":3391},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3519,3520,3521,3522,3523,3524],{"name":3332,"slug":3333,"type":15},{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"name":3385,"slug":3386,"type":15},{"name":3388,"slug":3389,"type":15},{"name":3372,"slug":3373,"type":15}]