[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-clerk-clerk-billing":3,"mdc-2k430k-key":37,"related-org-clerk-clerk-billing":7404,"related-repo-clerk-clerk-billing":7588},{"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-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},"clerk","Clerk","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fclerk.png",[12,14,17,20,23],{"name":9,"slug":8,"type":13},"tag",{"name":15,"slug":16,"type":13},"SaaS","saas",{"name":18,"slug":19,"type":13},"Payments","payments",{"name":21,"slug":22,"type":13},"Authentication","authentication",{"name":24,"slug":25,"type":13},"Frontend","frontend",59,"https:\u002F\u002Fgithub.com\u002Fclerk\u002Fskills","2026-04-29T05:37:27.130955","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\u002Ffeatures\u002Fclerk-billing","---\nname: clerk-billing\ndescription: Clerk Billing for subscription management - render Clerk's PricingTable\n  and in-app checkout drawer, configure subscription plans, seat-limit plans for\n  B2B, feature entitlements with has(), and billing webhooks. Use for SaaS\n  monetization, plan gating, checkout flows, trials, invoicing, and subscription\n  lifecycle management.\nallowed-tools: WebFetch\nlicense: MIT\ncompatibility: Requires NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY, CLERK_SECRET_KEY, and CLERK_WEBHOOK_SIGNING_SECRET. Billing must be enabled in Clerk Dashboard → Billing. Development instances can use the shared Clerk development gateway; production instances require a Stripe account for payment processing.\nmetadata:\n  author: clerk\n  version: 1.0.0\n---\n\n# Billing\n\n> **STOP, prerequisite.** Billing must be enabled before any `\u003CPricingTable \u002F>`, `\u003CCheckoutButton \u002F>`, `has({ plan })`, or `has({ feature })` usage works. Two paths: (1) [Dashboard → Billing → Settings](https:\u002F\u002Fdashboard.clerk.com\u002Flast-active?path=billing\u002Fsettings), or (2) `clerk enable billing` (see \"Agent-first: Programmatic billing config\" below). Enabling auto-creates default `free_user` \u002F `free_org` plans. Dev instances can use the shared Clerk development gateway (no Stripe account needed); production requires a Stripe account for payment processing only.\n>\n> **Note**: Billing APIs are still experimental. Pin your `@clerk\u002Fnextjs` and `clerk-js` package versions. See `clerk` skill for the supported version table.\n\n## Quick Start\n\n1. **Enable Billing**, via [Dashboard → Billing → Settings](https:\u002F\u002Fdashboard.clerk.com\u002Flast-active?path=billing\u002Fsettings) or `clerk enable billing` (see Agent-first section). Skipping this throws `cannot_render_billing_disabled` in dev and renders empty in prod.\n2. **Create plans in the matching tab**, [Dashboard → Billing → Plans](https:\u002F\u002Fdashboard.clerk.com\u002Flast-active?path=billing\u002Fplans). Two tabs, slugs scoped per tab, not movable after creation:\n   - **User Plans** → `\u003CPricingTable \u002F>` (default `for=\"user\"`)\n   - **Organization Plans** → `\u003CPricingTable for=\"organization\" \u002F>`\n\n   Wrong-tab is the #1 cause of an empty `\u003CPricingTable \u002F>`. Plans live in Clerk; not synced to Stripe.\n3. **Add features inside a plan**, open the plan in Dashboard → Billing → Plans, use its Features section. Features are scoped per plan, not global. The same slug can attach to multiple plans; `has({ feature: 'export' })` matches if the active plan contains that slug.\n4. **Render `\u003CPricingTable \u002F>`** (pass `for=\"organization\"` for B2B).\n5. **Gate access** with `has({ plan })` or `has({ feature })` from `auth()`.\n6. **Handle billing webhooks** for subscription lifecycle.\n\n## Dashboard shortcuts\n\n| Action | URL |\n|---|---|\n| Enable Billing | `https:\u002F\u002Fdashboard.clerk.com\u002Flast-active?path=billing\u002Fsettings` |\n| Create \u002F edit plans | `https:\u002F\u002Fdashboard.clerk.com\u002Flast-active?path=billing\u002Fplans` |\n| Membership mode (B2C + B2B coexistence) | `https:\u002F\u002Fdashboard.clerk.com\u002Flast-active?path=organizations-settings` |\n| Edit features | Plans → click a plan → Features section (no direct URL) |\n\n## Agent-first: Programmatic billing config\n\nThe full billing config (enable toggles, plans, features, plan-feature attachments) is editable via PLAPI without touching the Dashboard. Useful for agents seeding plans, replicating config across instances, or version-controlling billing structure.\n\nPre-req: project linked to the Clerk app (`clerk auth login` + `clerk link`, see `clerk-setup`).\n\n### Enable Billing via CLI\n\n```bash\nclerk enable billing                # both targets (default, auto-creates free_user + free_org plans)\nclerk enable billing --for org      # org only\nclerk enable billing --for user     # user only\n```\n\n### Pull current billing config\n\n```bash\nclerk config pull --keys billing > billing.json\n```\n\nThis writes the current billing config (toggles + plans + features) for the linked instance to `billing.json`.\n\n### Edit and apply\n\nEdit `billing.json` to add\u002Fremove plans or features, then preview the diff and apply:\n\n```bash\nclerk config patch --file billing.json --dry-run\nclerk config patch --file billing.json\n```\n\nPass `--instance prod` to target the production instance instead of dev.\n\n### Raw PATCH (full control)\n\nFor one-shot plan\u002Ffeature updates without a config file:\n\n```bash\nclerk api --platform PATCH \u002Fv1\u002Fplatform\u002Fapplications\u002F\u003Capp_id>\u002Finstances\u002F\u003Cins_id>\u002Fconfig \\\n  -d '{\"billing\":{\"plans\":[{\"slug\":\"pro\",\"name\":\"Pro\",\"amount\":2000,\"currency\":\"usd\",\"payer_type\":\"user\",\"is_recurring\":true}],\"features\":[{\"slug\":\"export\",\"name\":\"Export\"}]}}'\n```\n\n### Notes\n\n- This handles **billing config** (toggles + plans + features catalog). **Subscription lifecycle** (users picking a plan, checkout, renewal, cancellation) still flows through `\u003CPricingTable \u002F>` + billing webhooks, see `clerk-webhooks` skill for the lifecycle events.\n- Top-level `features` map manipulation and plan-feature attachments (sync) are fully supported via the PLAPI billing config handler.\n\n## What Do You Need?\n\n| Task | Reference |\n|------|-----------|\n| `\u003CPricingTable \u002F>` props, `\u003CCheckoutButton \u002F>`, `\u003CShow>` billing patterns | references\u002Fbilling-components.md |\n| B2C patterns (individual user subscriptions, `Membership optional` prerequisite) | references\u002Fb2c-patterns.md |\n| B2B patterns (org subscriptions, seat-limit plans, admin-gated billing UI) | references\u002Fb2b-patterns.md |\n| Webhook event catalog, payload shapes, handler templates | references\u002Fbilling-webhooks.md |\n\n## References\n\n| Reference | Description |\n|-----------|-------------|\n| `references\u002Fbilling-components.md` | `\u003CPricingTable \u002F>` and subscription UI |\n| `references\u002Fb2c-patterns.md` | B2C subscription billing patterns |\n| `references\u002Fb2b-patterns.md` | B2B billing with organization subscriptions and seat-limit plans |\n| `references\u002Fbilling-webhooks.md` | Subscription lifecycle event handling |\n\n## Documentation\n\n- [Billing overview](https:\u002F\u002Fclerk.com\u002Fdocs\u002Fguides\u002Fbilling\u002Foverview)\n- [B2B SaaS billing](https:\u002F\u002Fclerk.com\u002Fdocs\u002Fguides\u002Fbilling\u002Ffor-b2b)\n- [B2C SaaS billing](https:\u002F\u002Fclerk.com\u002Fdocs\u002Fguides\u002Fbilling\u002Ffor-b2c)\n- [Billing webhooks](https:\u002F\u002Fclerk.com\u002Fdocs\u002Fguides\u002Fdevelopment\u002Fwebhooks\u002Fbilling)\n\n## Features vs Plans: When to Use Which\n\n**Use `has({ feature: 'slug' })` when gating a specific capability**, export, analytics, API access, audit logs.\n\n**Use `has({ plan: 'slug' })` when gating a tier**, showing the pro dashboard, checking org subscription level, redirecting free users.\n\n| Scenario | Correct check |\n|----------|---------------|\n| Gate the \"Export CSV\" button | `has({ feature: 'export' })` |\n| Gate the \"Analytics\" section | `has({ feature: 'analytics' })` |\n| Gate all of \u002Fdashboard\u002Fpro | `has({ plan: 'pro' })` |\n| Check if org has team subscription | `has({ plan: 'org:team' })` |\n| Gate SSO configuration | `has({ feature: 'sso' })` |\n\nWhen a user says \"gate the export feature\" or \"gate analytics\", always use `has({ feature })`. Only use `has({ plan })` when the gate is the plan tier itself, not a specific capability within it.\n\n## Key Patterns\n\n### 1. Render the Pricing Table\n\nShow available plans to users with a single component:\n\n```tsx\nimport { PricingTable } from '@clerk\u002Fnextjs'\n\nexport default function PricingPage() {\n\treturn (\n\t\t\u003Cmain>\n\t\t\t\u003Ch1>Choose a plan\u003C\u002Fh1>\n\t\t\t\u003CPricingTable \u002F>\n\t\t\u003C\u002Fmain>\n\t)\n}\n```\n\n`\u003CPricingTable \u002F>` automatically renders all plans configured in the Clerk Dashboard. Selecting a plan opens Clerk's in-app checkout drawer. No props needed for basic usage. For B2B, pass `for=\"organization\"` to render org-level plans instead of user plans.\n\n### 2. Check Feature Entitlements (Server-Side)\n\nGate by individual features, this is the preferred approach for specific capabilities:\n\n```typescript\nimport { auth } from '@clerk\u002Fnextjs\u002Fserver'\n\nexport default async function AnalyticsPage() {\n\tconst { has } = await auth()\n\n\tconst canViewAnalytics = has({ feature: 'analytics' })\n\tconst canExport = has({ feature: 'export' })\n\n\treturn (\n\t\t\u003Cdiv>\n\t\t\t{canViewAnalytics && \u003CAnalyticsChart \u002F>}\n\t\t\t{canExport && \u003CExportButton \u002F>}\n\t\t\u003C\u002Fdiv>\n\t)\n}\n```\n\nFeatures are configured in Clerk Dashboard → Billing → Features and assigned to plans. Use `has({ feature })` instead of `has({ plan })` when gating granular capabilities, check the feature, not the plan.\n\n### 3. Check Feature Entitlements (Client-Side)\n\nUse `useAuth()` for client-side feature gating. Combine with server-side checks for full coverage:\n\n```tsx\n'use client'\nimport { useAuth } from '@clerk\u002Fnextjs'\n\nexport function FeatureGatedUI() {\n\tconst { has, isLoaded } = useAuth()\n\tif (!isLoaded) return null\n\n\tconst canExport = has?.({ feature: 'export' })\n\tconst canAnalytics = has?.({ feature: 'analytics' })\n\n\treturn (\n\t\t\u003Cdiv>\n\t\t\t{canAnalytics && \u003CAnalyticsSection \u002F>}\n\t\t\t{canExport ? \u003CExportButton \u002F> : \u003CUpgradeToExport \u002F>}\n\t\t\u003C\u002Fdiv>\n\t)\n}\n```\n\nServer Components use `auth()`, Client Components use `useAuth()`. Both support `has({ feature })` and `has({ plan })`.\n\n### 4. Check Subscription Plan Server-Side\n\nGate access by subscription plan (use this for tier-level gates, not individual features):\n\n```typescript\nimport { auth } from '@clerk\u002Fnextjs\u002Fserver'\nimport { redirect } from 'next\u002Fnavigation'\n\nexport default async function ProDashboard() {\n\tconst { has } = await auth()\n\n\tif (!has({ plan: 'pro' })) {\n\t\tredirect('\u002Fpricing')\n\t}\n\n\treturn \u003CProFeatures \u002F>\n}\n```\n\n### 5. Client-Side Plan Checks\n\nUse `useAuth()` hook for client components:\n\n```tsx\n'use client'\nimport { useAuth } from '@clerk\u002Fnextjs'\n\nexport function UpgradePrompt() {\n\tconst { has } = useAuth()\n\n\tif (has?.({ plan: 'pro' })) {\n\t\treturn null\n\t}\n\n\treturn (\n\t\t\u003Cdiv>\n\t\t\t\u003Cp>Upgrade to Pro to access this feature\u003C\u002Fp>\n\t\t\t\u003Ca href=\"\u002Fpricing\">View plans\u003C\u002Fa>\n\t\t\u003C\u002Fdiv>\n\t)\n}\n```\n\n### 6. B2B Seat-Based Billing with Organizations\n\nOrg plans can carry a **seat limit** (membership cap) that Clerk enforces at invite time. Use the `org:` slug prefix on org-side plan checks (e.g. `has({ plan: 'org:team' })`) to keep gating unambiguous. Render the B2B pricing page with `\u003CPricingTable for=\"organization\" \u002F>`, and use `\u003COrganizationProfile \u002F>` for the org account billing UI.\n\nSee `references\u002Fb2b-patterns.md` for tiered plan naming, seat-limit invariants, admin-only billing, and webhook handlers.\n\n### 7. Display Subscription Status\n\nCheck specific plans with `has({ plan })`, or use `useSubscription()` for full subscription details in client components. Do not read plan information from `sessionClaims` directly, that is not the supported path.\n\nServer component, check for specific plans:\n\n```typescript\nimport { auth } from '@clerk\u002Fnextjs\u002Fserver'\n\nexport default async function AccountPage() {\n\tconst { has } = await auth()\n\n\tconst currentPlan = has({ plan: 'pro' })\n\t\t? 'pro'\n\t\t: has({ plan: 'starter' })\n\t\t\t? 'starter'\n\t\t\t: 'free'\n\n\treturn (\n\t\t\u003Cdiv>\n\t\t\t\u003Ch2>Current Plan\u003C\u002Fh2>\n\t\t\t\u003Cp>You are on the {currentPlan} plan\u003C\u002Fp>\n\t\t\t{currentPlan === 'free' && \u003Ca href=\"\u002Fpricing\">Upgrade\u003C\u002Fa>}\n\t\t\u003C\u002Fdiv>\n\t)\n}\n```\n\nClient component, full subscription details via `useSubscription()`:\n\n```tsx\n'use client'\nimport { useSubscription } from '@clerk\u002Fnextjs\u002Fexperimental'\n\nexport function SubscriptionDetails() {\n\tconst { data: subscription, isLoading } = useSubscription()\n\tif (isLoading) return null\n\tif (!subscription) return \u003Ca href=\"\u002Fpricing\">Choose a plan\u003C\u002Fa>\n\n\treturn (\n\t\t\u003Cdiv>\n\t\t\t\u003Cp>Status: {subscription.status}\u003C\u002Fp>\n\t\t\t{subscription.nextPayment && (\n\t\t\t\t\u003Cp>Next payment: {subscription.nextPayment.date.toLocaleDateString()}\u003C\u002Fp>\n\t\t\t)}\n\t\t\u003C\u002Fdiv>\n\t)\n}\n```\n\n> `useSubscription()` is for display only. For authorization checks (gating content or routes), always use `has({ plan })` or `has({ feature })`.\n\n### 8. Protect API Routes by Plan\n\nGate API routes using `auth()`:\n\n```typescript\nimport { auth } from '@clerk\u002Fnextjs\u002Fserver'\nimport { NextResponse } from 'next\u002Fserver'\n\nexport async function GET() {\n\tconst { has } = await auth()\n\n\tif (!has({ plan: 'pro' })) {\n\t\treturn NextResponse.json({ error: 'Pro plan required' }, { status: 403 })\n\t}\n\n\treturn NextResponse.json({ data: 'premium data' })\n}\n```\n\n### 9. Handle Billing Webhooks\n\n> **Clerk event names differ from Stripe event names.** Clerk billing webhooks use dot-notation and camelCase, not Stripe's underscore format.\n>\n> There is no `subscription.canceled` event. Cancellation fires at the item level as `subscriptionItem.canceled`.\n>\n> | Intent | Stripe event name | Clerk event name |\n> |--------|------------------|-----------------|\n> | Subscription created | `customer.subscription.created` | `subscription.created` |\n> | Subscription updated | `customer.subscription.updated` | `subscription.updated` |\n> | Subscription active | (none) | `subscription.active` |\n> | Subscription past due | (none) | `subscription.pastDue` |\n> | Subscription item canceled | `customer.subscription.deleted` | `subscriptionItem.canceled` |\n> | Subscription item past due | `invoice.payment_failed` | `subscriptionItem.pastDue` |\n> | Subscription item updated | (none) | `subscriptionItem.updated` |\n> | Subscription item active | (none) | `subscriptionItem.active` |\n> | Subscription item upcoming renewal | (none) | `subscriptionItem.upcoming` |\n> | Subscription item ended | (none) | `subscriptionItem.ended` |\n> | Subscription item abandoned | (none) | `subscriptionItem.abandoned` |\n> | Subscription item expired | (none) | `subscriptionItem.expired` |\n> | Subscription item incomplete | (none) | `subscriptionItem.incomplete` |\n> | Free trial ending soon | (none) | `subscriptionItem.freeTrialEnding` |\n> | Payment attempt created | (none) | `paymentAttempt.created` |\n> | Payment attempt updated | (none) | `paymentAttempt.updated` |\n>\n> Always use Clerk's event names, never Stripe's, in `evt.type` checks.\n\n> **Payload shape.** Clerk billing webhook payloads are nested. The subscribing entity lives under `evt.data.payer` (fields: `user_id?`, `organization_id?`). The plan info is on each item under `evt.data.items[i].plan.slug`. The subscription id is simply `evt.data.id`. Subscription items do not carry a `subscription_id` field back-reference, so in `subscriptionItem.*` handlers you identify the record by the item id (`evt.data.id`) or look up by payer plus plan.\n\nMinimal handler to anchor the pattern (import from `@clerk\u002Fnextjs\u002Fwebhooks`, verify, branch on Clerk event name):\n\n```typescript\nimport { verifyWebhook } from '@clerk\u002Fnextjs\u002Fwebhooks'\nimport { NextRequest } from 'next\u002Fserver'\nimport { db } from '@\u002Flib\u002Fdb'\n\nexport async function POST(req: NextRequest) {\n\tlet evt\n\ttry {\n\t\tevt = await verifyWebhook(req)\n\t} catch {\n\t\treturn new Response('Verification failed', { status: 400 })\n\t}\n\n\tif (evt.type === 'subscription.created') {\n\t\tconst { id, payer, items, status } = evt.data\n\t\tconst entityId = payer.organization_id ?? payer.user_id\n\t\tconst plan = items[0]?.plan?.slug\n\t\tawait db.subscriptions.upsert({\n\t\t\twhere: { subscriptionId: id },\n\t\t\tcreate: { subscriptionId: id, entityId, plan, status },\n\t\t\tupdate: { entityId, plan, status },\n\t\t})\n\t}\n\n\t\u002F\u002F Add more branches per the event catalog above (subscription.updated,\n\t\u002F\u002F subscriptionItem.canceled, subscriptionItem.pastDue, etc.)\n\n\treturn new Response('OK', { status: 200 })\n}\n```\n\nFor the full template covering all 15 events, the TS type declarations from `@clerk\u002Fbackend`, the `proxy.ts` public-route setup, and the subscription status value table, see `references\u002Fbilling-webhooks.md`.\n\n### 10. Upgrade \u002F Downgrade Flow\n\nLet users manage their subscription from inside the app:\n\n```tsx\nimport { PricingTable } from '@clerk\u002Fnextjs'\nimport { auth } from '@clerk\u002Fnextjs\u002Fserver'\n\nexport default async function BillingPage() {\n\tconst { has } = await auth()\n\tconst isPro = has({ plan: 'pro' })\n\n\treturn (\n\t\t\u003Cdiv>\n\t\t\t\u003Ch1>Billing\u003C\u002Fh1>\n\t\t\t{isPro ? (\n\t\t\t\t\u003Cdiv>\n\t\t\t\t\t\u003Cp>You are on the Pro plan\u003C\u002Fp>\n\t\t\t\t\t\u003CPricingTable \u002F>\n\t\t\t\t\u003C\u002Fdiv>\n\t\t\t) : (\n\t\t\t\t\u003Cdiv>\n\t\t\t\t\t\u003Cp>Upgrade to access premium features\u003C\u002Fp>\n\t\t\t\t\t\u003CPricingTable \u002F>\n\t\t\t\t\u003C\u002Fdiv>\n\t\t\t)}\n\t\t\u003C\u002Fdiv>\n\t)\n}\n```\n\n`\u003CPricingTable \u002F>` renders differently for subscribed users, it shows the current plan and allows upgrades or cancellations, all through Clerk's in-app checkout drawer.\n\n## Plan and Feature Naming\n\nPlan slugs and feature slugs are defined in Clerk Dashboard → Billing. Common conventions:\n\n| Tier | Plan Slug | Example Features |\n|------|-----------|-----------------|\n| Free | (no plan check needed) | basic features |\n| Starter | `starter` | `analytics`, `api_access` |\n| Pro | `pro` | `analytics`, `export`, `team` |\n| Enterprise | `enterprise` | all features + `sso`, `audit_logs` |\n\nUse lowercase slugs matching what you define in the dashboard.\n\n## B2B vs B2C Billing\n\n| Scenario | Who subscribes | Plan check |\n|----------|---------------|------------|\n| B2C SaaS | Individual user | `has({ plan: 'pro' })` on user session |\n| B2B SaaS | Organization | `has({ plan: 'org:team' })` on org session |\n| Seat-limited B2B | Organization | Plan has a seat cap; pricing is per-plan, not per-member, tier your plans for bigger orgs |\n\nFor B2B, ensure the user has an active org session. The `has()` check evaluates the active entity (user or org).\n\n## Checkout Flows\n\nClerk renders its own checkout drawer automatically through `\u003CPricingTable \u002F>` and `\u003CCheckoutButton \u002F>`. Plans and pricing live in Clerk. To trigger checkout from a server action, redirect to a page that renders `\u003CPricingTable \u002F>`:\n\n```typescript\n'use server'\nimport { redirect } from 'next\u002Fnavigation'\n\nexport async function upgradeAction() {\n\tredirect('\u002Fpricing')\n}\n```\n\n## Error Signatures (diagnose fast)\n\nWhen you see any of these errors or symptoms, the fix is almost always a Dashboard toggle, not a code change. Do not start editing components.\n\n| Error \u002F symptom | Root cause | Fix |\n|---|---|---|\n| `Clerk: 🔒 The \u003CPricingTable\u002F> component cannot be rendered when billing is disabled.` (code: `cannot_render_billing_disabled`, dev only) | Billing is not enabled for this instance | Enable Billing at [dashboard.clerk.com → Billing → Settings](https:\u002F\u002Fdashboard.clerk.com\u002Flast-active?path=billing\u002Fsettings), or run `clerk enable billing`. |\n| `\u003CPricingTable \u002F>` renders empty | No plans, OR plan in the wrong tab (User vs Organization), OR Billing not enabled | Create plan in matching tab; pass `for=\"organization\"` for B2B; check Billing Settings |\n| Users can't subscribe to a personal plan on a B2C + B2B app | Membership required mode (default since 2025-08-22) disables personal accounts, signed-in users are forced into `choose-organization` and never land on a personal-subscription state | If you need personal + org subscriptions coexisting: Dashboard → Organizations settings → *Membership optional* |\n| Can't find a Features page | Features are per-plan, not global | Dashboard → Billing → Plans → click plan → Features |\n| `has({ plan: 'pro' })` always returns `false` after a successful checkout | Session token hasn't been refreshed to include the new plan | `await clerk.session?.reload()` or navigate to force a new session |\n| `has({ plan: 'pro' })` returns `false` before any subscribe attempt | Plan slug mismatch (case-sensitive), OR Billing not enabled, OR payment gateway not connected in production | Verify slug in Dashboard → Billing → Plans; confirm Billing → Settings shows enabled + connected gateway |\n| `has({ permission: 'org:x:y' })` returns `false` for a user who has the role | The Feature tied to that permission is not included in the organization's active Plan | Add the Feature to the Plan in Dashboard → Billing → Plans → Features |\n| Webhook 401 \u002F signature verification failed | `CLERK_WEBHOOK_SIGNING_SECRET` mismatch or route protected by middleware | Copy the Signing Secret from Dashboard → Webhooks; add the webhook route to `createRouteMatcher(['\u002Fapi\u002Fwebhooks(.*)'])` |\n\n## Billing Gates Permissions\n\nWhen Billing is enabled, `has({ permission: 'org:posts:edit' })` returns `false` if the Feature associated with that permission is not included in the organization's active Plan, even if the user has the permission assigned via their role. This is by design: billing gates permissions at the feature level. Always ensure the required Feature is attached to the Plan in Dashboard → Billing → Plans → Features.\n\n## See Also\n\n- `clerk-setup` - Initial Clerk install\n- `clerk-orgs` - B2B organizations (required for B2B billing and seat-limit plans)\n- `clerk-webhooks` - Webhook signature verification and routing\n",{"data":38,"body":43},{"name":4,"description":6,"allowed-tools":39,"license":29,"compatibility":40,"metadata":41},"WebFetch","Requires NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY, CLERK_SECRET_KEY, and CLERK_WEBHOOK_SIGNING_SECRET. Billing must be enabled in Clerk Dashboard → Billing. Development instances can use the shared Clerk development gateway; production instances require a Stripe account for payment processing.",{"author":8,"version":42},"1.0.0",{"type":44,"children":45},"root",[46,55,171,178,372,378,467,473,478,507,514,614,620,664,676,682,694,755,768,774,779,889,895,945,951,1052,1058,1148,1154,1197,1203,1221,1238,1344,1363,1369,1375,1380,1595,1612,1618,1623,2005,2024,2030,2042,2481,2512,2518,2523,2823,2829,2840,3193,3199,3241,3253,3259,3287,3292,3818,3829,4297,4322,4328,4339,4713,4719,5148,5223,5236,6063,6090,6096,6101,6604,6614,6620,6625,6773,6778,6784,6873,6886,6892,6916,7044,7050,7055,7333,7339,7358,7364,7398],{"type":47,"tag":48,"props":49,"children":51},"element","h1",{"id":50},"billing",[52],{"type":53,"value":54},"text","Billing",{"type":47,"tag":56,"props":57,"children":58},"blockquote",{},[59,138],{"type":47,"tag":60,"props":61,"children":62},"p",{},[63,69,71,78,80,86,87,93,95,101,103,112,114,120,122,128,130,136],{"type":47,"tag":64,"props":65,"children":66},"strong",{},[67],{"type":53,"value":68},"STOP, prerequisite.",{"type":53,"value":70}," Billing must be enabled before any ",{"type":47,"tag":72,"props":73,"children":75},"code",{"className":74},[],[76],{"type":53,"value":77},"\u003CPricingTable \u002F>",{"type":53,"value":79},", ",{"type":47,"tag":72,"props":81,"children":83},{"className":82},[],[84],{"type":53,"value":85},"\u003CCheckoutButton \u002F>",{"type":53,"value":79},{"type":47,"tag":72,"props":88,"children":90},{"className":89},[],[91],{"type":53,"value":92},"has({ plan })",{"type":53,"value":94},", or ",{"type":47,"tag":72,"props":96,"children":98},{"className":97},[],[99],{"type":53,"value":100},"has({ feature })",{"type":53,"value":102}," usage works. Two paths: (1) ",{"type":47,"tag":104,"props":105,"children":109},"a",{"href":106,"rel":107},"https:\u002F\u002Fdashboard.clerk.com\u002Flast-active?path=billing\u002Fsettings",[108],"nofollow",[110],{"type":53,"value":111},"Dashboard → Billing → Settings",{"type":53,"value":113},", or (2) ",{"type":47,"tag":72,"props":115,"children":117},{"className":116},[],[118],{"type":53,"value":119},"clerk enable billing",{"type":53,"value":121}," (see \"Agent-first: Programmatic billing config\" below). Enabling auto-creates default ",{"type":47,"tag":72,"props":123,"children":125},{"className":124},[],[126],{"type":53,"value":127},"free_user",{"type":53,"value":129}," \u002F ",{"type":47,"tag":72,"props":131,"children":133},{"className":132},[],[134],{"type":53,"value":135},"free_org",{"type":53,"value":137}," plans. Dev instances can use the shared Clerk development gateway (no Stripe account needed); production requires a Stripe account for payment processing only.",{"type":47,"tag":60,"props":139,"children":140},{},[141,146,148,154,156,162,164,169],{"type":47,"tag":64,"props":142,"children":143},{},[144],{"type":53,"value":145},"Note",{"type":53,"value":147},": Billing APIs are still experimental. Pin your ",{"type":47,"tag":72,"props":149,"children":151},{"className":150},[],[152],{"type":53,"value":153},"@clerk\u002Fnextjs",{"type":53,"value":155}," and ",{"type":47,"tag":72,"props":157,"children":159},{"className":158},[],[160],{"type":53,"value":161},"clerk-js",{"type":53,"value":163}," package versions. See ",{"type":47,"tag":72,"props":165,"children":167},{"className":166},[],[168],{"type":53,"value":8},{"type":53,"value":170}," skill for the supported version table.",{"type":47,"tag":172,"props":173,"children":175},"h2",{"id":174},"quick-start",[176],{"type":53,"value":177},"Quick Start",{"type":47,"tag":179,"props":180,"children":181},"ol",{},[182,215,290,308,331,362],{"type":47,"tag":183,"props":184,"children":185},"li",{},[186,191,193,198,200,205,207,213],{"type":47,"tag":64,"props":187,"children":188},{},[189],{"type":53,"value":190},"Enable Billing",{"type":53,"value":192},", via ",{"type":47,"tag":104,"props":194,"children":196},{"href":106,"rel":195},[108],[197],{"type":53,"value":111},{"type":53,"value":199}," or ",{"type":47,"tag":72,"props":201,"children":203},{"className":202},[],[204],{"type":53,"value":119},{"type":53,"value":206}," (see Agent-first section). Skipping this throws ",{"type":47,"tag":72,"props":208,"children":210},{"className":209},[],[211],{"type":53,"value":212},"cannot_render_billing_disabled",{"type":53,"value":214}," in dev and renders empty in prod.",{"type":47,"tag":183,"props":216,"children":217},{},[218,223,224,231,233,277,281,283,288],{"type":47,"tag":64,"props":219,"children":220},{},[221],{"type":53,"value":222},"Create plans in the matching tab",{"type":53,"value":79},{"type":47,"tag":104,"props":225,"children":228},{"href":226,"rel":227},"https:\u002F\u002Fdashboard.clerk.com\u002Flast-active?path=billing\u002Fplans",[108],[229],{"type":53,"value":230},"Dashboard → Billing → Plans",{"type":53,"value":232},". Two tabs, slugs scoped per tab, not movable after creation:",{"type":47,"tag":234,"props":235,"children":236},"ul",{},[237,262],{"type":47,"tag":183,"props":238,"children":239},{},[240,245,247,252,254,260],{"type":47,"tag":64,"props":241,"children":242},{},[243],{"type":53,"value":244},"User Plans",{"type":53,"value":246}," → ",{"type":47,"tag":72,"props":248,"children":250},{"className":249},[],[251],{"type":53,"value":77},{"type":53,"value":253}," (default ",{"type":47,"tag":72,"props":255,"children":257},{"className":256},[],[258],{"type":53,"value":259},"for=\"user\"",{"type":53,"value":261},")",{"type":47,"tag":183,"props":263,"children":264},{},[265,270,271],{"type":47,"tag":64,"props":266,"children":267},{},[268],{"type":53,"value":269},"Organization Plans",{"type":53,"value":246},{"type":47,"tag":72,"props":272,"children":274},{"className":273},[],[275],{"type":53,"value":276},"\u003CPricingTable for=\"organization\" \u002F>",{"type":47,"tag":278,"props":279,"children":280},"br",{},[],{"type":53,"value":282},"Wrong-tab is the #1 cause of an empty ",{"type":47,"tag":72,"props":284,"children":286},{"className":285},[],[287],{"type":53,"value":77},{"type":53,"value":289},". Plans live in Clerk; not synced to Stripe.",{"type":47,"tag":183,"props":291,"children":292},{},[293,298,300,306],{"type":47,"tag":64,"props":294,"children":295},{},[296],{"type":53,"value":297},"Add features inside a plan",{"type":53,"value":299},", open the plan in Dashboard → Billing → Plans, use its Features section. Features are scoped per plan, not global. The same slug can attach to multiple plans; ",{"type":47,"tag":72,"props":301,"children":303},{"className":302},[],[304],{"type":53,"value":305},"has({ feature: 'export' })",{"type":53,"value":307}," matches if the active plan contains that slug.",{"type":47,"tag":183,"props":309,"children":310},{},[311,321,323,329],{"type":47,"tag":64,"props":312,"children":313},{},[314,316],{"type":53,"value":315},"Render ",{"type":47,"tag":72,"props":317,"children":319},{"className":318},[],[320],{"type":53,"value":77},{"type":53,"value":322}," (pass ",{"type":47,"tag":72,"props":324,"children":326},{"className":325},[],[327],{"type":53,"value":328},"for=\"organization\"",{"type":53,"value":330}," for B2B).",{"type":47,"tag":183,"props":332,"children":333},{},[334,339,341,346,347,352,354,360],{"type":47,"tag":64,"props":335,"children":336},{},[337],{"type":53,"value":338},"Gate access",{"type":53,"value":340}," with ",{"type":47,"tag":72,"props":342,"children":344},{"className":343},[],[345],{"type":53,"value":92},{"type":53,"value":199},{"type":47,"tag":72,"props":348,"children":350},{"className":349},[],[351],{"type":53,"value":100},{"type":53,"value":353}," from ",{"type":47,"tag":72,"props":355,"children":357},{"className":356},[],[358],{"type":53,"value":359},"auth()",{"type":53,"value":361},".",{"type":47,"tag":183,"props":363,"children":364},{},[365,370],{"type":47,"tag":64,"props":366,"children":367},{},[368],{"type":53,"value":369},"Handle billing webhooks",{"type":53,"value":371}," for subscription lifecycle.",{"type":47,"tag":172,"props":373,"children":375},{"id":374},"dashboard-shortcuts",[376],{"type":53,"value":377},"Dashboard shortcuts",{"type":47,"tag":379,"props":380,"children":381},"table",{},[382,401],{"type":47,"tag":383,"props":384,"children":385},"thead",{},[386],{"type":47,"tag":387,"props":388,"children":389},"tr",{},[390,396],{"type":47,"tag":391,"props":392,"children":393},"th",{},[394],{"type":53,"value":395},"Action",{"type":47,"tag":391,"props":397,"children":398},{},[399],{"type":53,"value":400},"URL",{"type":47,"tag":402,"props":403,"children":404},"tbody",{},[405,421,437,454],{"type":47,"tag":387,"props":406,"children":407},{},[408,413],{"type":47,"tag":409,"props":410,"children":411},"td",{},[412],{"type":53,"value":190},{"type":47,"tag":409,"props":414,"children":415},{},[416],{"type":47,"tag":72,"props":417,"children":419},{"className":418},[],[420],{"type":53,"value":106},{"type":47,"tag":387,"props":422,"children":423},{},[424,429],{"type":47,"tag":409,"props":425,"children":426},{},[427],{"type":53,"value":428},"Create \u002F edit plans",{"type":47,"tag":409,"props":430,"children":431},{},[432],{"type":47,"tag":72,"props":433,"children":435},{"className":434},[],[436],{"type":53,"value":226},{"type":47,"tag":387,"props":438,"children":439},{},[440,445],{"type":47,"tag":409,"props":441,"children":442},{},[443],{"type":53,"value":444},"Membership mode (B2C + B2B coexistence)",{"type":47,"tag":409,"props":446,"children":447},{},[448],{"type":47,"tag":72,"props":449,"children":451},{"className":450},[],[452],{"type":53,"value":453},"https:\u002F\u002Fdashboard.clerk.com\u002Flast-active?path=organizations-settings",{"type":47,"tag":387,"props":455,"children":456},{},[457,462],{"type":47,"tag":409,"props":458,"children":459},{},[460],{"type":53,"value":461},"Edit features",{"type":47,"tag":409,"props":463,"children":464},{},[465],{"type":53,"value":466},"Plans → click a plan → Features section (no direct URL)",{"type":47,"tag":172,"props":468,"children":470},{"id":469},"agent-first-programmatic-billing-config",[471],{"type":53,"value":472},"Agent-first: Programmatic billing config",{"type":47,"tag":60,"props":474,"children":475},{},[476],{"type":53,"value":477},"The full billing config (enable toggles, plans, features, plan-feature attachments) is editable via PLAPI without touching the Dashboard. Useful for agents seeding plans, replicating config across instances, or version-controlling billing structure.",{"type":47,"tag":60,"props":479,"children":480},{},[481,483,489,491,497,499,505],{"type":53,"value":482},"Pre-req: project linked to the Clerk app (",{"type":47,"tag":72,"props":484,"children":486},{"className":485},[],[487],{"type":53,"value":488},"clerk auth login",{"type":53,"value":490}," + ",{"type":47,"tag":72,"props":492,"children":494},{"className":493},[],[495],{"type":53,"value":496},"clerk link",{"type":53,"value":498},", see ",{"type":47,"tag":72,"props":500,"children":502},{"className":501},[],[503],{"type":53,"value":504},"clerk-setup",{"type":53,"value":506},").",{"type":47,"tag":508,"props":509,"children":511},"h3",{"id":510},"enable-billing-via-cli",[512],{"type":53,"value":513},"Enable Billing via CLI",{"type":47,"tag":515,"props":516,"children":521},"pre",{"className":517,"code":518,"language":519,"meta":520,"style":520},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","clerk enable billing                # both targets (default, auto-creates free_user + free_org plans)\nclerk enable billing --for org      # org only\nclerk enable billing --for user     # user only\n","bash","",[522],{"type":47,"tag":72,"props":523,"children":524},{"__ignoreMap":520},[525,553,584],{"type":47,"tag":526,"props":527,"children":530},"span",{"class":528,"line":529},"line",1,[531,536,542,547],{"type":47,"tag":526,"props":532,"children":534},{"style":533},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[535],{"type":53,"value":8},{"type":47,"tag":526,"props":537,"children":539},{"style":538},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[540],{"type":53,"value":541}," enable",{"type":47,"tag":526,"props":543,"children":544},{"style":538},[545],{"type":53,"value":546}," billing",{"type":47,"tag":526,"props":548,"children":550},{"style":549},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[551],{"type":53,"value":552},"                # both targets (default, auto-creates free_user + free_org plans)\n",{"type":47,"tag":526,"props":554,"children":556},{"class":528,"line":555},2,[557,561,565,569,574,579],{"type":47,"tag":526,"props":558,"children":559},{"style":533},[560],{"type":53,"value":8},{"type":47,"tag":526,"props":562,"children":563},{"style":538},[564],{"type":53,"value":541},{"type":47,"tag":526,"props":566,"children":567},{"style":538},[568],{"type":53,"value":546},{"type":47,"tag":526,"props":570,"children":571},{"style":538},[572],{"type":53,"value":573}," --for",{"type":47,"tag":526,"props":575,"children":576},{"style":538},[577],{"type":53,"value":578}," org",{"type":47,"tag":526,"props":580,"children":581},{"style":549},[582],{"type":53,"value":583},"      # org only\n",{"type":47,"tag":526,"props":585,"children":587},{"class":528,"line":586},3,[588,592,596,600,604,609],{"type":47,"tag":526,"props":589,"children":590},{"style":533},[591],{"type":53,"value":8},{"type":47,"tag":526,"props":593,"children":594},{"style":538},[595],{"type":53,"value":541},{"type":47,"tag":526,"props":597,"children":598},{"style":538},[599],{"type":53,"value":546},{"type":47,"tag":526,"props":601,"children":602},{"style":538},[603],{"type":53,"value":573},{"type":47,"tag":526,"props":605,"children":606},{"style":538},[607],{"type":53,"value":608}," user",{"type":47,"tag":526,"props":610,"children":611},{"style":549},[612],{"type":53,"value":613},"     # user only\n",{"type":47,"tag":508,"props":615,"children":617},{"id":616},"pull-current-billing-config",[618],{"type":53,"value":619},"Pull current billing config",{"type":47,"tag":515,"props":621,"children":623},{"className":517,"code":622,"language":519,"meta":520,"style":520},"clerk config pull --keys billing > billing.json\n",[624],{"type":47,"tag":72,"props":625,"children":626},{"__ignoreMap":520},[627],{"type":47,"tag":526,"props":628,"children":629},{"class":528,"line":529},[630,634,639,644,649,653,659],{"type":47,"tag":526,"props":631,"children":632},{"style":533},[633],{"type":53,"value":8},{"type":47,"tag":526,"props":635,"children":636},{"style":538},[637],{"type":53,"value":638}," config",{"type":47,"tag":526,"props":640,"children":641},{"style":538},[642],{"type":53,"value":643}," pull",{"type":47,"tag":526,"props":645,"children":646},{"style":538},[647],{"type":53,"value":648}," --keys",{"type":47,"tag":526,"props":650,"children":651},{"style":538},[652],{"type":53,"value":546},{"type":47,"tag":526,"props":654,"children":656},{"style":655},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[657],{"type":53,"value":658}," >",{"type":47,"tag":526,"props":660,"children":661},{"style":538},[662],{"type":53,"value":663}," billing.json\n",{"type":47,"tag":60,"props":665,"children":666},{},[667,669,675],{"type":53,"value":668},"This writes the current billing config (toggles + plans + features) for the linked instance to ",{"type":47,"tag":72,"props":670,"children":672},{"className":671},[],[673],{"type":53,"value":674},"billing.json",{"type":53,"value":361},{"type":47,"tag":508,"props":677,"children":679},{"id":678},"edit-and-apply",[680],{"type":53,"value":681},"Edit and apply",{"type":47,"tag":60,"props":683,"children":684},{},[685,687,692],{"type":53,"value":686},"Edit ",{"type":47,"tag":72,"props":688,"children":690},{"className":689},[],[691],{"type":53,"value":674},{"type":53,"value":693}," to add\u002Fremove plans or features, then preview the diff and apply:",{"type":47,"tag":515,"props":695,"children":697},{"className":517,"code":696,"language":519,"meta":520,"style":520},"clerk config patch --file billing.json --dry-run\nclerk config patch --file billing.json\n",[698],{"type":47,"tag":72,"props":699,"children":700},{"__ignoreMap":520},[701,732],{"type":47,"tag":526,"props":702,"children":703},{"class":528,"line":529},[704,708,712,717,722,727],{"type":47,"tag":526,"props":705,"children":706},{"style":533},[707],{"type":53,"value":8},{"type":47,"tag":526,"props":709,"children":710},{"style":538},[711],{"type":53,"value":638},{"type":47,"tag":526,"props":713,"children":714},{"style":538},[715],{"type":53,"value":716}," patch",{"type":47,"tag":526,"props":718,"children":719},{"style":538},[720],{"type":53,"value":721}," --file",{"type":47,"tag":526,"props":723,"children":724},{"style":538},[725],{"type":53,"value":726}," billing.json",{"type":47,"tag":526,"props":728,"children":729},{"style":538},[730],{"type":53,"value":731}," --dry-run\n",{"type":47,"tag":526,"props":733,"children":734},{"class":528,"line":555},[735,739,743,747,751],{"type":47,"tag":526,"props":736,"children":737},{"style":533},[738],{"type":53,"value":8},{"type":47,"tag":526,"props":740,"children":741},{"style":538},[742],{"type":53,"value":638},{"type":47,"tag":526,"props":744,"children":745},{"style":538},[746],{"type":53,"value":716},{"type":47,"tag":526,"props":748,"children":749},{"style":538},[750],{"type":53,"value":721},{"type":47,"tag":526,"props":752,"children":753},{"style":538},[754],{"type":53,"value":663},{"type":47,"tag":60,"props":756,"children":757},{},[758,760,766],{"type":53,"value":759},"Pass ",{"type":47,"tag":72,"props":761,"children":763},{"className":762},[],[764],{"type":53,"value":765},"--instance prod",{"type":53,"value":767}," to target the production instance instead of dev.",{"type":47,"tag":508,"props":769,"children":771},{"id":770},"raw-patch-full-control",[772],{"type":53,"value":773},"Raw PATCH (full control)",{"type":47,"tag":60,"props":775,"children":776},{},[777],{"type":53,"value":778},"For one-shot plan\u002Ffeature updates without a config file:",{"type":47,"tag":515,"props":780,"children":782},{"className":517,"code":781,"language":519,"meta":520,"style":520},"clerk api --platform PATCH \u002Fv1\u002Fplatform\u002Fapplications\u002F\u003Capp_id>\u002Finstances\u002F\u003Cins_id>\u002Fconfig \\\n  -d '{\"billing\":{\"plans\":[{\"slug\":\"pro\",\"name\":\"Pro\",\"amount\":2000,\"currency\":\"usd\",\"payer_type\":\"user\",\"is_recurring\":true}],\"features\":[{\"slug\":\"export\",\"name\":\"Export\"}]}}'\n",[783],{"type":47,"tag":72,"props":784,"children":785},{"__ignoreMap":520},[786,866],{"type":47,"tag":526,"props":787,"children":788},{"class":528,"line":529},[789,793,798,803,808,813,818,823,829,834,839,843,848,852,856,861],{"type":47,"tag":526,"props":790,"children":791},{"style":533},[792],{"type":53,"value":8},{"type":47,"tag":526,"props":794,"children":795},{"style":538},[796],{"type":53,"value":797}," api",{"type":47,"tag":526,"props":799,"children":800},{"style":538},[801],{"type":53,"value":802}," --platform",{"type":47,"tag":526,"props":804,"children":805},{"style":538},[806],{"type":53,"value":807}," PATCH",{"type":47,"tag":526,"props":809,"children":810},{"style":538},[811],{"type":53,"value":812}," \u002Fv1\u002Fplatform\u002Fapplications\u002F",{"type":47,"tag":526,"props":814,"children":815},{"style":655},[816],{"type":53,"value":817},"\u003C",{"type":47,"tag":526,"props":819,"children":820},{"style":538},[821],{"type":53,"value":822},"app_i",{"type":47,"tag":526,"props":824,"children":826},{"style":825},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[827],{"type":53,"value":828},"d",{"type":47,"tag":526,"props":830,"children":831},{"style":655},[832],{"type":53,"value":833},">",{"type":47,"tag":526,"props":835,"children":836},{"style":538},[837],{"type":53,"value":838},"\u002Finstances\u002F",{"type":47,"tag":526,"props":840,"children":841},{"style":655},[842],{"type":53,"value":817},{"type":47,"tag":526,"props":844,"children":845},{"style":538},[846],{"type":53,"value":847},"ins_i",{"type":47,"tag":526,"props":849,"children":850},{"style":825},[851],{"type":53,"value":828},{"type":47,"tag":526,"props":853,"children":854},{"style":655},[855],{"type":53,"value":833},{"type":47,"tag":526,"props":857,"children":858},{"style":538},[859],{"type":53,"value":860},"\u002Fconfig",{"type":47,"tag":526,"props":862,"children":863},{"style":825},[864],{"type":53,"value":865}," \\\n",{"type":47,"tag":526,"props":867,"children":868},{"class":528,"line":555},[869,874,879,884],{"type":47,"tag":526,"props":870,"children":871},{"style":538},[872],{"type":53,"value":873},"  -d",{"type":47,"tag":526,"props":875,"children":876},{"style":655},[877],{"type":53,"value":878}," '",{"type":47,"tag":526,"props":880,"children":881},{"style":538},[882],{"type":53,"value":883},"{\"billing\":{\"plans\":[{\"slug\":\"pro\",\"name\":\"Pro\",\"amount\":2000,\"currency\":\"usd\",\"payer_type\":\"user\",\"is_recurring\":true}],\"features\":[{\"slug\":\"export\",\"name\":\"Export\"}]}}",{"type":47,"tag":526,"props":885,"children":886},{"style":655},[887],{"type":53,"value":888},"'\n",{"type":47,"tag":508,"props":890,"children":892},{"id":891},"notes",[893],{"type":53,"value":894},"Notes",{"type":47,"tag":234,"props":896,"children":897},{},[898,932],{"type":47,"tag":183,"props":899,"children":900},{},[901,903,908,910,915,917,922,924,930],{"type":53,"value":902},"This handles ",{"type":47,"tag":64,"props":904,"children":905},{},[906],{"type":53,"value":907},"billing config",{"type":53,"value":909}," (toggles + plans + features catalog). ",{"type":47,"tag":64,"props":911,"children":912},{},[913],{"type":53,"value":914},"Subscription lifecycle",{"type":53,"value":916}," (users picking a plan, checkout, renewal, cancellation) still flows through ",{"type":47,"tag":72,"props":918,"children":920},{"className":919},[],[921],{"type":53,"value":77},{"type":53,"value":923}," + billing webhooks, see ",{"type":47,"tag":72,"props":925,"children":927},{"className":926},[],[928],{"type":53,"value":929},"clerk-webhooks",{"type":53,"value":931}," skill for the lifecycle events.",{"type":47,"tag":183,"props":933,"children":934},{},[935,937,943],{"type":53,"value":936},"Top-level ",{"type":47,"tag":72,"props":938,"children":940},{"className":939},[],[941],{"type":53,"value":942},"features",{"type":53,"value":944}," map manipulation and plan-feature attachments (sync) are fully supported via the PLAPI billing config handler.",{"type":47,"tag":172,"props":946,"children":948},{"id":947},"what-do-you-need",[949],{"type":53,"value":950},"What Do You Need?",{"type":47,"tag":379,"props":952,"children":953},{},[954,970],{"type":47,"tag":383,"props":955,"children":956},{},[957],{"type":47,"tag":387,"props":958,"children":959},{},[960,965],{"type":47,"tag":391,"props":961,"children":962},{},[963],{"type":53,"value":964},"Task",{"type":47,"tag":391,"props":966,"children":967},{},[968],{"type":53,"value":969},"Reference",{"type":47,"tag":402,"props":971,"children":972},{},[973,1005,1026,1039],{"type":47,"tag":387,"props":974,"children":975},{},[976,1000],{"type":47,"tag":409,"props":977,"children":978},{},[979,984,986,991,992,998],{"type":47,"tag":72,"props":980,"children":982},{"className":981},[],[983],{"type":53,"value":77},{"type":53,"value":985}," props, ",{"type":47,"tag":72,"props":987,"children":989},{"className":988},[],[990],{"type":53,"value":85},{"type":53,"value":79},{"type":47,"tag":72,"props":993,"children":995},{"className":994},[],[996],{"type":53,"value":997},"\u003CShow>",{"type":53,"value":999}," billing patterns",{"type":47,"tag":409,"props":1001,"children":1002},{},[1003],{"type":53,"value":1004},"references\u002Fbilling-components.md",{"type":47,"tag":387,"props":1006,"children":1007},{},[1008,1021],{"type":47,"tag":409,"props":1009,"children":1010},{},[1011,1013,1019],{"type":53,"value":1012},"B2C patterns (individual user subscriptions, ",{"type":47,"tag":72,"props":1014,"children":1016},{"className":1015},[],[1017],{"type":53,"value":1018},"Membership optional",{"type":53,"value":1020}," prerequisite)",{"type":47,"tag":409,"props":1022,"children":1023},{},[1024],{"type":53,"value":1025},"references\u002Fb2c-patterns.md",{"type":47,"tag":387,"props":1027,"children":1028},{},[1029,1034],{"type":47,"tag":409,"props":1030,"children":1031},{},[1032],{"type":53,"value":1033},"B2B patterns (org subscriptions, seat-limit plans, admin-gated billing UI)",{"type":47,"tag":409,"props":1035,"children":1036},{},[1037],{"type":53,"value":1038},"references\u002Fb2b-patterns.md",{"type":47,"tag":387,"props":1040,"children":1041},{},[1042,1047],{"type":47,"tag":409,"props":1043,"children":1044},{},[1045],{"type":53,"value":1046},"Webhook event catalog, payload shapes, handler templates",{"type":47,"tag":409,"props":1048,"children":1049},{},[1050],{"type":53,"value":1051},"references\u002Fbilling-webhooks.md",{"type":47,"tag":172,"props":1053,"children":1055},{"id":1054},"references",[1056],{"type":53,"value":1057},"References",{"type":47,"tag":379,"props":1059,"children":1060},{},[1061,1076],{"type":47,"tag":383,"props":1062,"children":1063},{},[1064],{"type":47,"tag":387,"props":1065,"children":1066},{},[1067,1071],{"type":47,"tag":391,"props":1068,"children":1069},{},[1070],{"type":53,"value":969},{"type":47,"tag":391,"props":1072,"children":1073},{},[1074],{"type":53,"value":1075},"Description",{"type":47,"tag":402,"props":1077,"children":1078},{},[1079,1100,1116,1132],{"type":47,"tag":387,"props":1080,"children":1081},{},[1082,1090],{"type":47,"tag":409,"props":1083,"children":1084},{},[1085],{"type":47,"tag":72,"props":1086,"children":1088},{"className":1087},[],[1089],{"type":53,"value":1004},{"type":47,"tag":409,"props":1091,"children":1092},{},[1093,1098],{"type":47,"tag":72,"props":1094,"children":1096},{"className":1095},[],[1097],{"type":53,"value":77},{"type":53,"value":1099}," and subscription UI",{"type":47,"tag":387,"props":1101,"children":1102},{},[1103,1111],{"type":47,"tag":409,"props":1104,"children":1105},{},[1106],{"type":47,"tag":72,"props":1107,"children":1109},{"className":1108},[],[1110],{"type":53,"value":1025},{"type":47,"tag":409,"props":1112,"children":1113},{},[1114],{"type":53,"value":1115},"B2C subscription billing patterns",{"type":47,"tag":387,"props":1117,"children":1118},{},[1119,1127],{"type":47,"tag":409,"props":1120,"children":1121},{},[1122],{"type":47,"tag":72,"props":1123,"children":1125},{"className":1124},[],[1126],{"type":53,"value":1038},{"type":47,"tag":409,"props":1128,"children":1129},{},[1130],{"type":53,"value":1131},"B2B billing with organization subscriptions and seat-limit plans",{"type":47,"tag":387,"props":1133,"children":1134},{},[1135,1143],{"type":47,"tag":409,"props":1136,"children":1137},{},[1138],{"type":47,"tag":72,"props":1139,"children":1141},{"className":1140},[],[1142],{"type":53,"value":1051},{"type":47,"tag":409,"props":1144,"children":1145},{},[1146],{"type":53,"value":1147},"Subscription lifecycle event handling",{"type":47,"tag":172,"props":1149,"children":1151},{"id":1150},"documentation",[1152],{"type":53,"value":1153},"Documentation",{"type":47,"tag":234,"props":1155,"children":1156},{},[1157,1167,1177,1187],{"type":47,"tag":183,"props":1158,"children":1159},{},[1160],{"type":47,"tag":104,"props":1161,"children":1164},{"href":1162,"rel":1163},"https:\u002F\u002Fclerk.com\u002Fdocs\u002Fguides\u002Fbilling\u002Foverview",[108],[1165],{"type":53,"value":1166},"Billing overview",{"type":47,"tag":183,"props":1168,"children":1169},{},[1170],{"type":47,"tag":104,"props":1171,"children":1174},{"href":1172,"rel":1173},"https:\u002F\u002Fclerk.com\u002Fdocs\u002Fguides\u002Fbilling\u002Ffor-b2b",[108],[1175],{"type":53,"value":1176},"B2B SaaS billing",{"type":47,"tag":183,"props":1178,"children":1179},{},[1180],{"type":47,"tag":104,"props":1181,"children":1184},{"href":1182,"rel":1183},"https:\u002F\u002Fclerk.com\u002Fdocs\u002Fguides\u002Fbilling\u002Ffor-b2c",[108],[1185],{"type":53,"value":1186},"B2C SaaS billing",{"type":47,"tag":183,"props":1188,"children":1189},{},[1190],{"type":47,"tag":104,"props":1191,"children":1194},{"href":1192,"rel":1193},"https:\u002F\u002Fclerk.com\u002Fdocs\u002Fguides\u002Fdevelopment\u002Fwebhooks\u002Fbilling",[108],[1195],{"type":53,"value":1196},"Billing webhooks",{"type":47,"tag":172,"props":1198,"children":1200},{"id":1199},"features-vs-plans-when-to-use-which",[1201],{"type":53,"value":1202},"Features vs Plans: When to Use Which",{"type":47,"tag":60,"props":1204,"children":1205},{},[1206,1219],{"type":47,"tag":64,"props":1207,"children":1208},{},[1209,1211,1217],{"type":53,"value":1210},"Use ",{"type":47,"tag":72,"props":1212,"children":1214},{"className":1213},[],[1215],{"type":53,"value":1216},"has({ feature: 'slug' })",{"type":53,"value":1218}," when gating a specific capability",{"type":53,"value":1220},", export, analytics, API access, audit logs.",{"type":47,"tag":60,"props":1222,"children":1223},{},[1224,1236],{"type":47,"tag":64,"props":1225,"children":1226},{},[1227,1228,1234],{"type":53,"value":1210},{"type":47,"tag":72,"props":1229,"children":1231},{"className":1230},[],[1232],{"type":53,"value":1233},"has({ plan: 'slug' })",{"type":53,"value":1235}," when gating a tier",{"type":53,"value":1237},", showing the pro dashboard, checking org subscription level, redirecting free users.",{"type":47,"tag":379,"props":1239,"children":1240},{},[1241,1257],{"type":47,"tag":383,"props":1242,"children":1243},{},[1244],{"type":47,"tag":387,"props":1245,"children":1246},{},[1247,1252],{"type":47,"tag":391,"props":1248,"children":1249},{},[1250],{"type":53,"value":1251},"Scenario",{"type":47,"tag":391,"props":1253,"children":1254},{},[1255],{"type":53,"value":1256},"Correct check",{"type":47,"tag":402,"props":1258,"children":1259},{},[1260,1276,1293,1310,1327],{"type":47,"tag":387,"props":1261,"children":1262},{},[1263,1268],{"type":47,"tag":409,"props":1264,"children":1265},{},[1266],{"type":53,"value":1267},"Gate the \"Export CSV\" button",{"type":47,"tag":409,"props":1269,"children":1270},{},[1271],{"type":47,"tag":72,"props":1272,"children":1274},{"className":1273},[],[1275],{"type":53,"value":305},{"type":47,"tag":387,"props":1277,"children":1278},{},[1279,1284],{"type":47,"tag":409,"props":1280,"children":1281},{},[1282],{"type":53,"value":1283},"Gate the \"Analytics\" section",{"type":47,"tag":409,"props":1285,"children":1286},{},[1287],{"type":47,"tag":72,"props":1288,"children":1290},{"className":1289},[],[1291],{"type":53,"value":1292},"has({ feature: 'analytics' })",{"type":47,"tag":387,"props":1294,"children":1295},{},[1296,1301],{"type":47,"tag":409,"props":1297,"children":1298},{},[1299],{"type":53,"value":1300},"Gate all of \u002Fdashboard\u002Fpro",{"type":47,"tag":409,"props":1302,"children":1303},{},[1304],{"type":47,"tag":72,"props":1305,"children":1307},{"className":1306},[],[1308],{"type":53,"value":1309},"has({ plan: 'pro' })",{"type":47,"tag":387,"props":1311,"children":1312},{},[1313,1318],{"type":47,"tag":409,"props":1314,"children":1315},{},[1316],{"type":53,"value":1317},"Check if org has team subscription",{"type":47,"tag":409,"props":1319,"children":1320},{},[1321],{"type":47,"tag":72,"props":1322,"children":1324},{"className":1323},[],[1325],{"type":53,"value":1326},"has({ plan: 'org:team' })",{"type":47,"tag":387,"props":1328,"children":1329},{},[1330,1335],{"type":47,"tag":409,"props":1331,"children":1332},{},[1333],{"type":53,"value":1334},"Gate SSO configuration",{"type":47,"tag":409,"props":1336,"children":1337},{},[1338],{"type":47,"tag":72,"props":1339,"children":1341},{"className":1340},[],[1342],{"type":53,"value":1343},"has({ feature: 'sso' })",{"type":47,"tag":60,"props":1345,"children":1346},{},[1347,1349,1354,1356,1361],{"type":53,"value":1348},"When a user says \"gate the export feature\" or \"gate analytics\", always use ",{"type":47,"tag":72,"props":1350,"children":1352},{"className":1351},[],[1353],{"type":53,"value":100},{"type":53,"value":1355},". Only use ",{"type":47,"tag":72,"props":1357,"children":1359},{"className":1358},[],[1360],{"type":53,"value":92},{"type":53,"value":1362}," when the gate is the plan tier itself, not a specific capability within it.",{"type":47,"tag":172,"props":1364,"children":1366},{"id":1365},"key-patterns",[1367],{"type":53,"value":1368},"Key Patterns",{"type":47,"tag":508,"props":1370,"children":1372},{"id":1371},"_1-render-the-pricing-table",[1373],{"type":53,"value":1374},"1. Render the Pricing Table",{"type":47,"tag":60,"props":1376,"children":1377},{},[1378],{"type":53,"value":1379},"Show available plans to users with a single component:",{"type":47,"tag":515,"props":1381,"children":1385},{"className":1382,"code":1383,"language":1384,"meta":520,"style":520},"language-tsx shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { PricingTable } from '@clerk\u002Fnextjs'\n\nexport default function PricingPage() {\n    return (\n        \u003Cmain>\n            \u003Ch1>Choose a plan\u003C\u002Fh1>\n            \u003CPricingTable \u002F>\n        \u003C\u002Fmain>\n    )\n}\n","tsx",[1386],{"type":47,"tag":72,"props":1387,"children":1388},{"__ignoreMap":520},[1389,1430,1439,1474,1488,1507,1542,1560,1577,1586],{"type":47,"tag":526,"props":1390,"children":1391},{"class":528,"line":529},[1392,1398,1403,1408,1413,1418,1422,1426],{"type":47,"tag":526,"props":1393,"children":1395},{"style":1394},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[1396],{"type":53,"value":1397},"import",{"type":47,"tag":526,"props":1399,"children":1400},{"style":655},[1401],{"type":53,"value":1402}," {",{"type":47,"tag":526,"props":1404,"children":1405},{"style":825},[1406],{"type":53,"value":1407}," PricingTable",{"type":47,"tag":526,"props":1409,"children":1410},{"style":655},[1411],{"type":53,"value":1412}," }",{"type":47,"tag":526,"props":1414,"children":1415},{"style":1394},[1416],{"type":53,"value":1417}," from",{"type":47,"tag":526,"props":1419,"children":1420},{"style":655},[1421],{"type":53,"value":878},{"type":47,"tag":526,"props":1423,"children":1424},{"style":538},[1425],{"type":53,"value":153},{"type":47,"tag":526,"props":1427,"children":1428},{"style":655},[1429],{"type":53,"value":888},{"type":47,"tag":526,"props":1431,"children":1432},{"class":528,"line":555},[1433],{"type":47,"tag":526,"props":1434,"children":1436},{"emptyLinePlaceholder":1435},true,[1437],{"type":53,"value":1438},"\n",{"type":47,"tag":526,"props":1440,"children":1441},{"class":528,"line":586},[1442,1447,1452,1458,1464,1469],{"type":47,"tag":526,"props":1443,"children":1444},{"style":1394},[1445],{"type":53,"value":1446},"export",{"type":47,"tag":526,"props":1448,"children":1449},{"style":1394},[1450],{"type":53,"value":1451}," default",{"type":47,"tag":526,"props":1453,"children":1455},{"style":1454},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[1456],{"type":53,"value":1457}," function",{"type":47,"tag":526,"props":1459,"children":1461},{"style":1460},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[1462],{"type":53,"value":1463}," PricingPage",{"type":47,"tag":526,"props":1465,"children":1466},{"style":655},[1467],{"type":53,"value":1468},"()",{"type":47,"tag":526,"props":1470,"children":1471},{"style":655},[1472],{"type":53,"value":1473}," {\n",{"type":47,"tag":526,"props":1475,"children":1476},{"class":528,"line":30},[1477,1482],{"type":47,"tag":526,"props":1478,"children":1479},{"style":1394},[1480],{"type":53,"value":1481},"    return",{"type":47,"tag":526,"props":1483,"children":1485},{"style":1484},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[1486],{"type":53,"value":1487}," (\n",{"type":47,"tag":526,"props":1489,"children":1491},{"class":528,"line":1490},5,[1492,1497,1502],{"type":47,"tag":526,"props":1493,"children":1494},{"style":655},[1495],{"type":53,"value":1496},"        \u003C",{"type":47,"tag":526,"props":1498,"children":1499},{"style":1484},[1500],{"type":53,"value":1501},"main",{"type":47,"tag":526,"props":1503,"children":1504},{"style":655},[1505],{"type":53,"value":1506},">\n",{"type":47,"tag":526,"props":1508,"children":1510},{"class":528,"line":1509},6,[1511,1516,1520,1524,1529,1534,1538],{"type":47,"tag":526,"props":1512,"children":1513},{"style":655},[1514],{"type":53,"value":1515},"            \u003C",{"type":47,"tag":526,"props":1517,"children":1518},{"style":1484},[1519],{"type":53,"value":48},{"type":47,"tag":526,"props":1521,"children":1522},{"style":655},[1523],{"type":53,"value":833},{"type":47,"tag":526,"props":1525,"children":1526},{"style":825},[1527],{"type":53,"value":1528},"Choose a plan",{"type":47,"tag":526,"props":1530,"children":1531},{"style":655},[1532],{"type":53,"value":1533},"\u003C\u002F",{"type":47,"tag":526,"props":1535,"children":1536},{"style":1484},[1537],{"type":53,"value":48},{"type":47,"tag":526,"props":1539,"children":1540},{"style":655},[1541],{"type":53,"value":1506},{"type":47,"tag":526,"props":1543,"children":1545},{"class":528,"line":1544},7,[1546,1550,1555],{"type":47,"tag":526,"props":1547,"children":1548},{"style":655},[1549],{"type":53,"value":1515},{"type":47,"tag":526,"props":1551,"children":1552},{"style":533},[1553],{"type":53,"value":1554},"PricingTable",{"type":47,"tag":526,"props":1556,"children":1557},{"style":655},[1558],{"type":53,"value":1559}," \u002F>\n",{"type":47,"tag":526,"props":1561,"children":1563},{"class":528,"line":1562},8,[1564,1569,1573],{"type":47,"tag":526,"props":1565,"children":1566},{"style":655},[1567],{"type":53,"value":1568},"        \u003C\u002F",{"type":47,"tag":526,"props":1570,"children":1571},{"style":1484},[1572],{"type":53,"value":1501},{"type":47,"tag":526,"props":1574,"children":1575},{"style":655},[1576],{"type":53,"value":1506},{"type":47,"tag":526,"props":1578,"children":1580},{"class":528,"line":1579},9,[1581],{"type":47,"tag":526,"props":1582,"children":1583},{"style":1484},[1584],{"type":53,"value":1585},"    )\n",{"type":47,"tag":526,"props":1587,"children":1589},{"class":528,"line":1588},10,[1590],{"type":47,"tag":526,"props":1591,"children":1592},{"style":655},[1593],{"type":53,"value":1594},"}\n",{"type":47,"tag":60,"props":1596,"children":1597},{},[1598,1603,1605,1610],{"type":47,"tag":72,"props":1599,"children":1601},{"className":1600},[],[1602],{"type":53,"value":77},{"type":53,"value":1604}," automatically renders all plans configured in the Clerk Dashboard. Selecting a plan opens Clerk's in-app checkout drawer. No props needed for basic usage. For B2B, pass ",{"type":47,"tag":72,"props":1606,"children":1608},{"className":1607},[],[1609],{"type":53,"value":328},{"type":53,"value":1611}," to render org-level plans instead of user plans.",{"type":47,"tag":508,"props":1613,"children":1615},{"id":1614},"_2-check-feature-entitlements-server-side",[1616],{"type":53,"value":1617},"2. Check Feature Entitlements (Server-Side)",{"type":47,"tag":60,"props":1619,"children":1620},{},[1621],{"type":53,"value":1622},"Gate by individual features, this is the preferred approach for specific capabilities:",{"type":47,"tag":515,"props":1624,"children":1628},{"className":1625,"code":1626,"language":1627,"meta":520,"style":520},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { auth } from '@clerk\u002Fnextjs\u002Fserver'\n\nexport default async function AnalyticsPage() {\n    const { has } = await auth()\n\n    const canViewAnalytics = has({ feature: 'analytics' })\n    const canExport = has({ feature: 'export' })\n\n    return (\n        \u003Cdiv>\n            {canViewAnalytics && \u003CAnalyticsChart \u002F>}\n            {canExport && \u003CExportButton \u002F>}\n        \u003C\u002Fdiv>\n    )\n}\n","typescript",[1629],{"type":47,"tag":72,"props":1630,"children":1631},{"__ignoreMap":520},[1632,1669,1676,1709,1749,1756,1819,1875,1882,1893,1909,1943,1973,1989,1997],{"type":47,"tag":526,"props":1633,"children":1634},{"class":528,"line":529},[1635,1639,1643,1648,1652,1656,1660,1665],{"type":47,"tag":526,"props":1636,"children":1637},{"style":1394},[1638],{"type":53,"value":1397},{"type":47,"tag":526,"props":1640,"children":1641},{"style":655},[1642],{"type":53,"value":1402},{"type":47,"tag":526,"props":1644,"children":1645},{"style":825},[1646],{"type":53,"value":1647}," auth",{"type":47,"tag":526,"props":1649,"children":1650},{"style":655},[1651],{"type":53,"value":1412},{"type":47,"tag":526,"props":1653,"children":1654},{"style":1394},[1655],{"type":53,"value":1417},{"type":47,"tag":526,"props":1657,"children":1658},{"style":655},[1659],{"type":53,"value":878},{"type":47,"tag":526,"props":1661,"children":1662},{"style":538},[1663],{"type":53,"value":1664},"@clerk\u002Fnextjs\u002Fserver",{"type":47,"tag":526,"props":1666,"children":1667},{"style":655},[1668],{"type":53,"value":888},{"type":47,"tag":526,"props":1670,"children":1671},{"class":528,"line":555},[1672],{"type":47,"tag":526,"props":1673,"children":1674},{"emptyLinePlaceholder":1435},[1675],{"type":53,"value":1438},{"type":47,"tag":526,"props":1677,"children":1678},{"class":528,"line":586},[1679,1683,1687,1692,1696,1701,1705],{"type":47,"tag":526,"props":1680,"children":1681},{"style":1394},[1682],{"type":53,"value":1446},{"type":47,"tag":526,"props":1684,"children":1685},{"style":1394},[1686],{"type":53,"value":1451},{"type":47,"tag":526,"props":1688,"children":1689},{"style":1454},[1690],{"type":53,"value":1691}," async",{"type":47,"tag":526,"props":1693,"children":1694},{"style":1454},[1695],{"type":53,"value":1457},{"type":47,"tag":526,"props":1697,"children":1698},{"style":1460},[1699],{"type":53,"value":1700}," AnalyticsPage",{"type":47,"tag":526,"props":1702,"children":1703},{"style":655},[1704],{"type":53,"value":1468},{"type":47,"tag":526,"props":1706,"children":1707},{"style":655},[1708],{"type":53,"value":1473},{"type":47,"tag":526,"props":1710,"children":1711},{"class":528,"line":30},[1712,1717,1721,1726,1730,1735,1740,1744],{"type":47,"tag":526,"props":1713,"children":1714},{"style":1454},[1715],{"type":53,"value":1716},"    const",{"type":47,"tag":526,"props":1718,"children":1719},{"style":655},[1720],{"type":53,"value":1402},{"type":47,"tag":526,"props":1722,"children":1723},{"style":825},[1724],{"type":53,"value":1725}," has",{"type":47,"tag":526,"props":1727,"children":1728},{"style":655},[1729],{"type":53,"value":1412},{"type":47,"tag":526,"props":1731,"children":1732},{"style":655},[1733],{"type":53,"value":1734}," =",{"type":47,"tag":526,"props":1736,"children":1737},{"style":1394},[1738],{"type":53,"value":1739}," await",{"type":47,"tag":526,"props":1741,"children":1742},{"style":1460},[1743],{"type":53,"value":1647},{"type":47,"tag":526,"props":1745,"children":1746},{"style":1484},[1747],{"type":53,"value":1748},"()\n",{"type":47,"tag":526,"props":1750,"children":1751},{"class":528,"line":1490},[1752],{"type":47,"tag":526,"props":1753,"children":1754},{"emptyLinePlaceholder":1435},[1755],{"type":53,"value":1438},{"type":47,"tag":526,"props":1757,"children":1758},{"class":528,"line":1509},[1759,1763,1768,1772,1776,1781,1786,1791,1796,1800,1805,1810,1814],{"type":47,"tag":526,"props":1760,"children":1761},{"style":1454},[1762],{"type":53,"value":1716},{"type":47,"tag":526,"props":1764,"children":1765},{"style":825},[1766],{"type":53,"value":1767}," canViewAnalytics",{"type":47,"tag":526,"props":1769,"children":1770},{"style":655},[1771],{"type":53,"value":1734},{"type":47,"tag":526,"props":1773,"children":1774},{"style":1460},[1775],{"type":53,"value":1725},{"type":47,"tag":526,"props":1777,"children":1778},{"style":1484},[1779],{"type":53,"value":1780},"(",{"type":47,"tag":526,"props":1782,"children":1783},{"style":655},[1784],{"type":53,"value":1785},"{",{"type":47,"tag":526,"props":1787,"children":1788},{"style":1484},[1789],{"type":53,"value":1790}," feature",{"type":47,"tag":526,"props":1792,"children":1793},{"style":655},[1794],{"type":53,"value":1795},":",{"type":47,"tag":526,"props":1797,"children":1798},{"style":655},[1799],{"type":53,"value":878},{"type":47,"tag":526,"props":1801,"children":1802},{"style":538},[1803],{"type":53,"value":1804},"analytics",{"type":47,"tag":526,"props":1806,"children":1807},{"style":655},[1808],{"type":53,"value":1809},"'",{"type":47,"tag":526,"props":1811,"children":1812},{"style":655},[1813],{"type":53,"value":1412},{"type":47,"tag":526,"props":1815,"children":1816},{"style":1484},[1817],{"type":53,"value":1818},")\n",{"type":47,"tag":526,"props":1820,"children":1821},{"class":528,"line":1544},[1822,1826,1831,1835,1839,1843,1847,1851,1855,1859,1863,1867,1871],{"type":47,"tag":526,"props":1823,"children":1824},{"style":1454},[1825],{"type":53,"value":1716},{"type":47,"tag":526,"props":1827,"children":1828},{"style":825},[1829],{"type":53,"value":1830}," canExport",{"type":47,"tag":526,"props":1832,"children":1833},{"style":655},[1834],{"type":53,"value":1734},{"type":47,"tag":526,"props":1836,"children":1837},{"style":1460},[1838],{"type":53,"value":1725},{"type":47,"tag":526,"props":1840,"children":1841},{"style":1484},[1842],{"type":53,"value":1780},{"type":47,"tag":526,"props":1844,"children":1845},{"style":655},[1846],{"type":53,"value":1785},{"type":47,"tag":526,"props":1848,"children":1849},{"style":1484},[1850],{"type":53,"value":1790},{"type":47,"tag":526,"props":1852,"children":1853},{"style":655},[1854],{"type":53,"value":1795},{"type":47,"tag":526,"props":1856,"children":1857},{"style":655},[1858],{"type":53,"value":878},{"type":47,"tag":526,"props":1860,"children":1861},{"style":538},[1862],{"type":53,"value":1446},{"type":47,"tag":526,"props":1864,"children":1865},{"style":655},[1866],{"type":53,"value":1809},{"type":47,"tag":526,"props":1868,"children":1869},{"style":655},[1870],{"type":53,"value":1412},{"type":47,"tag":526,"props":1872,"children":1873},{"style":1484},[1874],{"type":53,"value":1818},{"type":47,"tag":526,"props":1876,"children":1877},{"class":528,"line":1562},[1878],{"type":47,"tag":526,"props":1879,"children":1880},{"emptyLinePlaceholder":1435},[1881],{"type":53,"value":1438},{"type":47,"tag":526,"props":1883,"children":1884},{"class":528,"line":1579},[1885,1889],{"type":47,"tag":526,"props":1886,"children":1887},{"style":1394},[1888],{"type":53,"value":1481},{"type":47,"tag":526,"props":1890,"children":1891},{"style":1484},[1892],{"type":53,"value":1487},{"type":47,"tag":526,"props":1894,"children":1895},{"class":528,"line":1588},[1896,1900,1905],{"type":47,"tag":526,"props":1897,"children":1898},{"style":1484},[1899],{"type":53,"value":1496},{"type":47,"tag":526,"props":1901,"children":1902},{"style":533},[1903],{"type":53,"value":1904},"div",{"type":47,"tag":526,"props":1906,"children":1907},{"style":1484},[1908],{"type":53,"value":1506},{"type":47,"tag":526,"props":1910,"children":1912},{"class":528,"line":1911},11,[1913,1918,1924,1929,1934,1939],{"type":47,"tag":526,"props":1914,"children":1915},{"style":655},[1916],{"type":53,"value":1917},"            {",{"type":47,"tag":526,"props":1919,"children":1921},{"style":1920},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[1922],{"type":53,"value":1923},"canViewAnalytics",{"type":47,"tag":526,"props":1925,"children":1926},{"style":1484},[1927],{"type":53,"value":1928}," && \u003C",{"type":47,"tag":526,"props":1930,"children":1931},{"style":1920},[1932],{"type":53,"value":1933},"AnalyticsChart",{"type":47,"tag":526,"props":1935,"children":1936},{"style":1484},[1937],{"type":53,"value":1938}," \u002F>",{"type":47,"tag":526,"props":1940,"children":1941},{"style":655},[1942],{"type":53,"value":1594},{"type":47,"tag":526,"props":1944,"children":1946},{"class":528,"line":1945},12,[1947,1951,1956,1960,1965,1969],{"type":47,"tag":526,"props":1948,"children":1949},{"style":655},[1950],{"type":53,"value":1917},{"type":47,"tag":526,"props":1952,"children":1953},{"style":1920},[1954],{"type":53,"value":1955},"canExport",{"type":47,"tag":526,"props":1957,"children":1958},{"style":1484},[1959],{"type":53,"value":1928},{"type":47,"tag":526,"props":1961,"children":1962},{"style":1920},[1963],{"type":53,"value":1964},"ExportButton",{"type":47,"tag":526,"props":1966,"children":1967},{"style":1484},[1968],{"type":53,"value":1938},{"type":47,"tag":526,"props":1970,"children":1971},{"style":655},[1972],{"type":53,"value":1594},{"type":47,"tag":526,"props":1974,"children":1976},{"class":528,"line":1975},13,[1977,1981,1985],{"type":47,"tag":526,"props":1978,"children":1979},{"style":655},[1980],{"type":53,"value":1568},{"type":47,"tag":526,"props":1982,"children":1983},{"style":825},[1984],{"type":53,"value":1904},{"type":47,"tag":526,"props":1986,"children":1987},{"style":655},[1988],{"type":53,"value":1506},{"type":47,"tag":526,"props":1990,"children":1992},{"class":528,"line":1991},14,[1993],{"type":47,"tag":526,"props":1994,"children":1995},{"style":1484},[1996],{"type":53,"value":1585},{"type":47,"tag":526,"props":1998,"children":2000},{"class":528,"line":1999},15,[2001],{"type":47,"tag":526,"props":2002,"children":2003},{"style":655},[2004],{"type":53,"value":1594},{"type":47,"tag":60,"props":2006,"children":2007},{},[2008,2010,2015,2017,2022],{"type":53,"value":2009},"Features are configured in Clerk Dashboard → Billing → Features and assigned to plans. Use ",{"type":47,"tag":72,"props":2011,"children":2013},{"className":2012},[],[2014],{"type":53,"value":100},{"type":53,"value":2016}," instead of ",{"type":47,"tag":72,"props":2018,"children":2020},{"className":2019},[],[2021],{"type":53,"value":92},{"type":53,"value":2023}," when gating granular capabilities, check the feature, not the plan.",{"type":47,"tag":508,"props":2025,"children":2027},{"id":2026},"_3-check-feature-entitlements-client-side",[2028],{"type":53,"value":2029},"3. Check Feature Entitlements (Client-Side)",{"type":47,"tag":60,"props":2031,"children":2032},{},[2033,2034,2040],{"type":53,"value":1210},{"type":47,"tag":72,"props":2035,"children":2037},{"className":2036},[],[2038],{"type":53,"value":2039},"useAuth()",{"type":53,"value":2041}," for client-side feature gating. Combine with server-side checks for full coverage:",{"type":47,"tag":515,"props":2043,"children":2045},{"className":1382,"code":2044,"language":1384,"meta":520,"style":520},"'use client'\nimport { useAuth } from '@clerk\u002Fnextjs'\n\nexport function FeatureGatedUI() {\n    const { has, isLoaded } = useAuth()\n    if (!isLoaded) return null\n\n    const canExport = has?.({ feature: 'export' })\n    const canAnalytics = has?.({ feature: 'analytics' })\n\n    return (\n        \u003Cdiv>\n            {canAnalytics && \u003CAnalyticsSection \u002F>}\n            {canExport ? \u003CExportButton \u002F> : \u003CUpgradeToExport \u002F>}\n        \u003C\u002Fdiv>\n    )\n}\n",[2046],{"type":47,"tag":72,"props":2047,"children":2048},{"__ignoreMap":520},[2049,2065,2101,2108,2132,2173,2211,2218,2278,2338,2345,2356,2371,2403,2450,2465,2473],{"type":47,"tag":526,"props":2050,"children":2051},{"class":528,"line":529},[2052,2056,2061],{"type":47,"tag":526,"props":2053,"children":2054},{"style":655},[2055],{"type":53,"value":1809},{"type":47,"tag":526,"props":2057,"children":2058},{"style":538},[2059],{"type":53,"value":2060},"use client",{"type":47,"tag":526,"props":2062,"children":2063},{"style":655},[2064],{"type":53,"value":888},{"type":47,"tag":526,"props":2066,"children":2067},{"class":528,"line":555},[2068,2072,2076,2081,2085,2089,2093,2097],{"type":47,"tag":526,"props":2069,"children":2070},{"style":1394},[2071],{"type":53,"value":1397},{"type":47,"tag":526,"props":2073,"children":2074},{"style":655},[2075],{"type":53,"value":1402},{"type":47,"tag":526,"props":2077,"children":2078},{"style":825},[2079],{"type":53,"value":2080}," useAuth",{"type":47,"tag":526,"props":2082,"children":2083},{"style":655},[2084],{"type":53,"value":1412},{"type":47,"tag":526,"props":2086,"children":2087},{"style":1394},[2088],{"type":53,"value":1417},{"type":47,"tag":526,"props":2090,"children":2091},{"style":655},[2092],{"type":53,"value":878},{"type":47,"tag":526,"props":2094,"children":2095},{"style":538},[2096],{"type":53,"value":153},{"type":47,"tag":526,"props":2098,"children":2099},{"style":655},[2100],{"type":53,"value":888},{"type":47,"tag":526,"props":2102,"children":2103},{"class":528,"line":586},[2104],{"type":47,"tag":526,"props":2105,"children":2106},{"emptyLinePlaceholder":1435},[2107],{"type":53,"value":1438},{"type":47,"tag":526,"props":2109,"children":2110},{"class":528,"line":30},[2111,2115,2119,2124,2128],{"type":47,"tag":526,"props":2112,"children":2113},{"style":1394},[2114],{"type":53,"value":1446},{"type":47,"tag":526,"props":2116,"children":2117},{"style":1454},[2118],{"type":53,"value":1457},{"type":47,"tag":526,"props":2120,"children":2121},{"style":1460},[2122],{"type":53,"value":2123}," FeatureGatedUI",{"type":47,"tag":526,"props":2125,"children":2126},{"style":655},[2127],{"type":53,"value":1468},{"type":47,"tag":526,"props":2129,"children":2130},{"style":655},[2131],{"type":53,"value":1473},{"type":47,"tag":526,"props":2133,"children":2134},{"class":528,"line":1490},[2135,2139,2143,2147,2152,2157,2161,2165,2169],{"type":47,"tag":526,"props":2136,"children":2137},{"style":1454},[2138],{"type":53,"value":1716},{"type":47,"tag":526,"props":2140,"children":2141},{"style":655},[2142],{"type":53,"value":1402},{"type":47,"tag":526,"props":2144,"children":2145},{"style":825},[2146],{"type":53,"value":1725},{"type":47,"tag":526,"props":2148,"children":2149},{"style":655},[2150],{"type":53,"value":2151},",",{"type":47,"tag":526,"props":2153,"children":2154},{"style":825},[2155],{"type":53,"value":2156}," isLoaded",{"type":47,"tag":526,"props":2158,"children":2159},{"style":655},[2160],{"type":53,"value":1412},{"type":47,"tag":526,"props":2162,"children":2163},{"style":655},[2164],{"type":53,"value":1734},{"type":47,"tag":526,"props":2166,"children":2167},{"style":1460},[2168],{"type":53,"value":2080},{"type":47,"tag":526,"props":2170,"children":2171},{"style":1484},[2172],{"type":53,"value":1748},{"type":47,"tag":526,"props":2174,"children":2175},{"class":528,"line":1509},[2176,2181,2186,2191,2196,2201,2206],{"type":47,"tag":526,"props":2177,"children":2178},{"style":1394},[2179],{"type":53,"value":2180},"    if",{"type":47,"tag":526,"props":2182,"children":2183},{"style":1484},[2184],{"type":53,"value":2185}," (",{"type":47,"tag":526,"props":2187,"children":2188},{"style":655},[2189],{"type":53,"value":2190},"!",{"type":47,"tag":526,"props":2192,"children":2193},{"style":825},[2194],{"type":53,"value":2195},"isLoaded",{"type":47,"tag":526,"props":2197,"children":2198},{"style":1484},[2199],{"type":53,"value":2200},") ",{"type":47,"tag":526,"props":2202,"children":2203},{"style":1394},[2204],{"type":53,"value":2205},"return",{"type":47,"tag":526,"props":2207,"children":2208},{"style":655},[2209],{"type":53,"value":2210}," null\n",{"type":47,"tag":526,"props":2212,"children":2213},{"class":528,"line":1544},[2214],{"type":47,"tag":526,"props":2215,"children":2216},{"emptyLinePlaceholder":1435},[2217],{"type":53,"value":1438},{"type":47,"tag":526,"props":2219,"children":2220},{"class":528,"line":1562},[2221,2225,2229,2233,2237,2242,2246,2250,2254,2258,2262,2266,2270,2274],{"type":47,"tag":526,"props":2222,"children":2223},{"style":1454},[2224],{"type":53,"value":1716},{"type":47,"tag":526,"props":2226,"children":2227},{"style":825},[2228],{"type":53,"value":1830},{"type":47,"tag":526,"props":2230,"children":2231},{"style":655},[2232],{"type":53,"value":1734},{"type":47,"tag":526,"props":2234,"children":2235},{"style":1460},[2236],{"type":53,"value":1725},{"type":47,"tag":526,"props":2238,"children":2239},{"style":655},[2240],{"type":53,"value":2241},"?.",{"type":47,"tag":526,"props":2243,"children":2244},{"style":1484},[2245],{"type":53,"value":1780},{"type":47,"tag":526,"props":2247,"children":2248},{"style":655},[2249],{"type":53,"value":1785},{"type":47,"tag":526,"props":2251,"children":2252},{"style":1484},[2253],{"type":53,"value":1790},{"type":47,"tag":526,"props":2255,"children":2256},{"style":655},[2257],{"type":53,"value":1795},{"type":47,"tag":526,"props":2259,"children":2260},{"style":655},[2261],{"type":53,"value":878},{"type":47,"tag":526,"props":2263,"children":2264},{"style":538},[2265],{"type":53,"value":1446},{"type":47,"tag":526,"props":2267,"children":2268},{"style":655},[2269],{"type":53,"value":1809},{"type":47,"tag":526,"props":2271,"children":2272},{"style":655},[2273],{"type":53,"value":1412},{"type":47,"tag":526,"props":2275,"children":2276},{"style":1484},[2277],{"type":53,"value":1818},{"type":47,"tag":526,"props":2279,"children":2280},{"class":528,"line":1579},[2281,2285,2290,2294,2298,2302,2306,2310,2314,2318,2322,2326,2330,2334],{"type":47,"tag":526,"props":2282,"children":2283},{"style":1454},[2284],{"type":53,"value":1716},{"type":47,"tag":526,"props":2286,"children":2287},{"style":825},[2288],{"type":53,"value":2289}," canAnalytics",{"type":47,"tag":526,"props":2291,"children":2292},{"style":655},[2293],{"type":53,"value":1734},{"type":47,"tag":526,"props":2295,"children":2296},{"style":1460},[2297],{"type":53,"value":1725},{"type":47,"tag":526,"props":2299,"children":2300},{"style":655},[2301],{"type":53,"value":2241},{"type":47,"tag":526,"props":2303,"children":2304},{"style":1484},[2305],{"type":53,"value":1780},{"type":47,"tag":526,"props":2307,"children":2308},{"style":655},[2309],{"type":53,"value":1785},{"type":47,"tag":526,"props":2311,"children":2312},{"style":1484},[2313],{"type":53,"value":1790},{"type":47,"tag":526,"props":2315,"children":2316},{"style":655},[2317],{"type":53,"value":1795},{"type":47,"tag":526,"props":2319,"children":2320},{"style":655},[2321],{"type":53,"value":878},{"type":47,"tag":526,"props":2323,"children":2324},{"style":538},[2325],{"type":53,"value":1804},{"type":47,"tag":526,"props":2327,"children":2328},{"style":655},[2329],{"type":53,"value":1809},{"type":47,"tag":526,"props":2331,"children":2332},{"style":655},[2333],{"type":53,"value":1412},{"type":47,"tag":526,"props":2335,"children":2336},{"style":1484},[2337],{"type":53,"value":1818},{"type":47,"tag":526,"props":2339,"children":2340},{"class":528,"line":1588},[2341],{"type":47,"tag":526,"props":2342,"children":2343},{"emptyLinePlaceholder":1435},[2344],{"type":53,"value":1438},{"type":47,"tag":526,"props":2346,"children":2347},{"class":528,"line":1911},[2348,2352],{"type":47,"tag":526,"props":2349,"children":2350},{"style":1394},[2351],{"type":53,"value":1481},{"type":47,"tag":526,"props":2353,"children":2354},{"style":1484},[2355],{"type":53,"value":1487},{"type":47,"tag":526,"props":2357,"children":2358},{"class":528,"line":1945},[2359,2363,2367],{"type":47,"tag":526,"props":2360,"children":2361},{"style":655},[2362],{"type":53,"value":1496},{"type":47,"tag":526,"props":2364,"children":2365},{"style":1484},[2366],{"type":53,"value":1904},{"type":47,"tag":526,"props":2368,"children":2369},{"style":655},[2370],{"type":53,"value":1506},{"type":47,"tag":526,"props":2372,"children":2373},{"class":528,"line":1975},[2374,2378,2383,2388,2393,2398],{"type":47,"tag":526,"props":2375,"children":2376},{"style":655},[2377],{"type":53,"value":1917},{"type":47,"tag":526,"props":2379,"children":2380},{"style":825},[2381],{"type":53,"value":2382},"canAnalytics ",{"type":47,"tag":526,"props":2384,"children":2385},{"style":655},[2386],{"type":53,"value":2387},"&&",{"type":47,"tag":526,"props":2389,"children":2390},{"style":655},[2391],{"type":53,"value":2392}," \u003C",{"type":47,"tag":526,"props":2394,"children":2395},{"style":533},[2396],{"type":53,"value":2397},"AnalyticsSection",{"type":47,"tag":526,"props":2399,"children":2400},{"style":655},[2401],{"type":53,"value":2402}," \u002F>}\n",{"type":47,"tag":526,"props":2404,"children":2405},{"class":528,"line":1991},[2406,2410,2415,2420,2424,2428,2432,2437,2441,2446],{"type":47,"tag":526,"props":2407,"children":2408},{"style":655},[2409],{"type":53,"value":1917},{"type":47,"tag":526,"props":2411,"children":2412},{"style":825},[2413],{"type":53,"value":2414},"canExport ",{"type":47,"tag":526,"props":2416,"children":2417},{"style":655},[2418],{"type":53,"value":2419},"?",{"type":47,"tag":526,"props":2421,"children":2422},{"style":655},[2423],{"type":53,"value":2392},{"type":47,"tag":526,"props":2425,"children":2426},{"style":533},[2427],{"type":53,"value":1964},{"type":47,"tag":526,"props":2429,"children":2430},{"style":655},[2431],{"type":53,"value":1938},{"type":47,"tag":526,"props":2433,"children":2434},{"style":655},[2435],{"type":53,"value":2436}," :",{"type":47,"tag":526,"props":2438,"children":2439},{"style":655},[2440],{"type":53,"value":2392},{"type":47,"tag":526,"props":2442,"children":2443},{"style":533},[2444],{"type":53,"value":2445},"UpgradeToExport",{"type":47,"tag":526,"props":2447,"children":2448},{"style":655},[2449],{"type":53,"value":2402},{"type":47,"tag":526,"props":2451,"children":2452},{"class":528,"line":1999},[2453,2457,2461],{"type":47,"tag":526,"props":2454,"children":2455},{"style":655},[2456],{"type":53,"value":1568},{"type":47,"tag":526,"props":2458,"children":2459},{"style":1484},[2460],{"type":53,"value":1904},{"type":47,"tag":526,"props":2462,"children":2463},{"style":655},[2464],{"type":53,"value":1506},{"type":47,"tag":526,"props":2466,"children":2468},{"class":528,"line":2467},16,[2469],{"type":47,"tag":526,"props":2470,"children":2471},{"style":1484},[2472],{"type":53,"value":1585},{"type":47,"tag":526,"props":2474,"children":2476},{"class":528,"line":2475},17,[2477],{"type":47,"tag":526,"props":2478,"children":2479},{"style":655},[2480],{"type":53,"value":1594},{"type":47,"tag":60,"props":2482,"children":2483},{},[2484,2486,2491,2493,2498,2500,2505,2506,2511],{"type":53,"value":2485},"Server Components use ",{"type":47,"tag":72,"props":2487,"children":2489},{"className":2488},[],[2490],{"type":53,"value":359},{"type":53,"value":2492},", Client Components use ",{"type":47,"tag":72,"props":2494,"children":2496},{"className":2495},[],[2497],{"type":53,"value":2039},{"type":53,"value":2499},". Both support ",{"type":47,"tag":72,"props":2501,"children":2503},{"className":2502},[],[2504],{"type":53,"value":100},{"type":53,"value":155},{"type":47,"tag":72,"props":2507,"children":2509},{"className":2508},[],[2510],{"type":53,"value":92},{"type":53,"value":361},{"type":47,"tag":508,"props":2513,"children":2515},{"id":2514},"_4-check-subscription-plan-server-side",[2516],{"type":53,"value":2517},"4. Check Subscription Plan Server-Side",{"type":47,"tag":60,"props":2519,"children":2520},{},[2521],{"type":53,"value":2522},"Gate access by subscription plan (use this for tier-level gates, not individual features):",{"type":47,"tag":515,"props":2524,"children":2526},{"className":1625,"code":2525,"language":1627,"meta":520,"style":520},"import { auth } from '@clerk\u002Fnextjs\u002Fserver'\nimport { redirect } from 'next\u002Fnavigation'\n\nexport default async function ProDashboard() {\n    const { has } = await auth()\n\n    if (!has({ plan: 'pro' })) {\n        redirect('\u002Fpricing')\n    }\n\n    return \u003CProFeatures \u002F>\n}\n",[2527],{"type":47,"tag":72,"props":2528,"children":2529},{"__ignoreMap":520},[2530,2565,2602,2609,2641,2676,2683,2747,2776,2784,2791,2816],{"type":47,"tag":526,"props":2531,"children":2532},{"class":528,"line":529},[2533,2537,2541,2545,2549,2553,2557,2561],{"type":47,"tag":526,"props":2534,"children":2535},{"style":1394},[2536],{"type":53,"value":1397},{"type":47,"tag":526,"props":2538,"children":2539},{"style":655},[2540],{"type":53,"value":1402},{"type":47,"tag":526,"props":2542,"children":2543},{"style":825},[2544],{"type":53,"value":1647},{"type":47,"tag":526,"props":2546,"children":2547},{"style":655},[2548],{"type":53,"value":1412},{"type":47,"tag":526,"props":2550,"children":2551},{"style":1394},[2552],{"type":53,"value":1417},{"type":47,"tag":526,"props":2554,"children":2555},{"style":655},[2556],{"type":53,"value":878},{"type":47,"tag":526,"props":2558,"children":2559},{"style":538},[2560],{"type":53,"value":1664},{"type":47,"tag":526,"props":2562,"children":2563},{"style":655},[2564],{"type":53,"value":888},{"type":47,"tag":526,"props":2566,"children":2567},{"class":528,"line":555},[2568,2572,2576,2581,2585,2589,2593,2598],{"type":47,"tag":526,"props":2569,"children":2570},{"style":1394},[2571],{"type":53,"value":1397},{"type":47,"tag":526,"props":2573,"children":2574},{"style":655},[2575],{"type":53,"value":1402},{"type":47,"tag":526,"props":2577,"children":2578},{"style":825},[2579],{"type":53,"value":2580}," redirect",{"type":47,"tag":526,"props":2582,"children":2583},{"style":655},[2584],{"type":53,"value":1412},{"type":47,"tag":526,"props":2586,"children":2587},{"style":1394},[2588],{"type":53,"value":1417},{"type":47,"tag":526,"props":2590,"children":2591},{"style":655},[2592],{"type":53,"value":878},{"type":47,"tag":526,"props":2594,"children":2595},{"style":538},[2596],{"type":53,"value":2597},"next\u002Fnavigation",{"type":47,"tag":526,"props":2599,"children":2600},{"style":655},[2601],{"type":53,"value":888},{"type":47,"tag":526,"props":2603,"children":2604},{"class":528,"line":586},[2605],{"type":47,"tag":526,"props":2606,"children":2607},{"emptyLinePlaceholder":1435},[2608],{"type":53,"value":1438},{"type":47,"tag":526,"props":2610,"children":2611},{"class":528,"line":30},[2612,2616,2620,2624,2628,2633,2637],{"type":47,"tag":526,"props":2613,"children":2614},{"style":1394},[2615],{"type":53,"value":1446},{"type":47,"tag":526,"props":2617,"children":2618},{"style":1394},[2619],{"type":53,"value":1451},{"type":47,"tag":526,"props":2621,"children":2622},{"style":1454},[2623],{"type":53,"value":1691},{"type":47,"tag":526,"props":2625,"children":2626},{"style":1454},[2627],{"type":53,"value":1457},{"type":47,"tag":526,"props":2629,"children":2630},{"style":1460},[2631],{"type":53,"value":2632}," ProDashboard",{"type":47,"tag":526,"props":2634,"children":2635},{"style":655},[2636],{"type":53,"value":1468},{"type":47,"tag":526,"props":2638,"children":2639},{"style":655},[2640],{"type":53,"value":1473},{"type":47,"tag":526,"props":2642,"children":2643},{"class":528,"line":1490},[2644,2648,2652,2656,2660,2664,2668,2672],{"type":47,"tag":526,"props":2645,"children":2646},{"style":1454},[2647],{"type":53,"value":1716},{"type":47,"tag":526,"props":2649,"children":2650},{"style":655},[2651],{"type":53,"value":1402},{"type":47,"tag":526,"props":2653,"children":2654},{"style":825},[2655],{"type":53,"value":1725},{"type":47,"tag":526,"props":2657,"children":2658},{"style":655},[2659],{"type":53,"value":1412},{"type":47,"tag":526,"props":2661,"children":2662},{"style":655},[2663],{"type":53,"value":1734},{"type":47,"tag":526,"props":2665,"children":2666},{"style":1394},[2667],{"type":53,"value":1739},{"type":47,"tag":526,"props":2669,"children":2670},{"style":1460},[2671],{"type":53,"value":1647},{"type":47,"tag":526,"props":2673,"children":2674},{"style":1484},[2675],{"type":53,"value":1748},{"type":47,"tag":526,"props":2677,"children":2678},{"class":528,"line":1509},[2679],{"type":47,"tag":526,"props":2680,"children":2681},{"emptyLinePlaceholder":1435},[2682],{"type":53,"value":1438},{"type":47,"tag":526,"props":2684,"children":2685},{"class":528,"line":1544},[2686,2690,2694,2698,2703,2707,2711,2716,2720,2724,2729,2733,2737,2742],{"type":47,"tag":526,"props":2687,"children":2688},{"style":1394},[2689],{"type":53,"value":2180},{"type":47,"tag":526,"props":2691,"children":2692},{"style":1484},[2693],{"type":53,"value":2185},{"type":47,"tag":526,"props":2695,"children":2696},{"style":655},[2697],{"type":53,"value":2190},{"type":47,"tag":526,"props":2699,"children":2700},{"style":1460},[2701],{"type":53,"value":2702},"has",{"type":47,"tag":526,"props":2704,"children":2705},{"style":1484},[2706],{"type":53,"value":1780},{"type":47,"tag":526,"props":2708,"children":2709},{"style":655},[2710],{"type":53,"value":1785},{"type":47,"tag":526,"props":2712,"children":2713},{"style":1484},[2714],{"type":53,"value":2715}," plan",{"type":47,"tag":526,"props":2717,"children":2718},{"style":655},[2719],{"type":53,"value":1795},{"type":47,"tag":526,"props":2721,"children":2722},{"style":655},[2723],{"type":53,"value":878},{"type":47,"tag":526,"props":2725,"children":2726},{"style":538},[2727],{"type":53,"value":2728},"pro",{"type":47,"tag":526,"props":2730,"children":2731},{"style":655},[2732],{"type":53,"value":1809},{"type":47,"tag":526,"props":2734,"children":2735},{"style":655},[2736],{"type":53,"value":1412},{"type":47,"tag":526,"props":2738,"children":2739},{"style":1484},[2740],{"type":53,"value":2741},")) ",{"type":47,"tag":526,"props":2743,"children":2744},{"style":655},[2745],{"type":53,"value":2746},"{\n",{"type":47,"tag":526,"props":2748,"children":2749},{"class":528,"line":1562},[2750,2755,2759,2763,2768,2772],{"type":47,"tag":526,"props":2751,"children":2752},{"style":1460},[2753],{"type":53,"value":2754},"        redirect",{"type":47,"tag":526,"props":2756,"children":2757},{"style":1484},[2758],{"type":53,"value":1780},{"type":47,"tag":526,"props":2760,"children":2761},{"style":655},[2762],{"type":53,"value":1809},{"type":47,"tag":526,"props":2764,"children":2765},{"style":538},[2766],{"type":53,"value":2767},"\u002Fpricing",{"type":47,"tag":526,"props":2769,"children":2770},{"style":655},[2771],{"type":53,"value":1809},{"type":47,"tag":526,"props":2773,"children":2774},{"style":1484},[2775],{"type":53,"value":1818},{"type":47,"tag":526,"props":2777,"children":2778},{"class":528,"line":1579},[2779],{"type":47,"tag":526,"props":2780,"children":2781},{"style":655},[2782],{"type":53,"value":2783},"    }\n",{"type":47,"tag":526,"props":2785,"children":2786},{"class":528,"line":1588},[2787],{"type":47,"tag":526,"props":2788,"children":2789},{"emptyLinePlaceholder":1435},[2790],{"type":53,"value":1438},{"type":47,"tag":526,"props":2792,"children":2793},{"class":528,"line":1911},[2794,2798,2802,2807,2812],{"type":47,"tag":526,"props":2795,"children":2796},{"style":1394},[2797],{"type":53,"value":1481},{"type":47,"tag":526,"props":2799,"children":2800},{"style":655},[2801],{"type":53,"value":2392},{"type":47,"tag":526,"props":2803,"children":2804},{"style":533},[2805],{"type":53,"value":2806},"ProFeatures",{"type":47,"tag":526,"props":2808,"children":2809},{"style":1484},[2810],{"type":53,"value":2811}," \u002F",{"type":47,"tag":526,"props":2813,"children":2814},{"style":655},[2815],{"type":53,"value":1506},{"type":47,"tag":526,"props":2817,"children":2818},{"class":528,"line":1945},[2819],{"type":47,"tag":526,"props":2820,"children":2821},{"style":1484},[2822],{"type":53,"value":1594},{"type":47,"tag":508,"props":2824,"children":2826},{"id":2825},"_5-client-side-plan-checks",[2827],{"type":53,"value":2828},"5. Client-Side Plan Checks",{"type":47,"tag":60,"props":2830,"children":2831},{},[2832,2833,2838],{"type":53,"value":1210},{"type":47,"tag":72,"props":2834,"children":2836},{"className":2835},[],[2837],{"type":53,"value":2039},{"type":53,"value":2839}," hook for client components:",{"type":47,"tag":515,"props":2841,"children":2843},{"className":1382,"code":2842,"language":1384,"meta":520,"style":520},"'use client'\nimport { useAuth } from '@clerk\u002Fnextjs'\n\nexport function UpgradePrompt() {\n    const { has } = useAuth()\n\n    if (has?.({ plan: 'pro' })) {\n        return null\n    }\n\n    return (\n        \u003Cdiv>\n            \u003Cp>Upgrade to Pro to access this feature\u003C\u002Fp>\n            \u003Ca href=\"\u002Fpricing\">View plans\u003C\u002Fa>\n        \u003C\u002Fdiv>\n    )\n}\n",[2844],{"type":47,"tag":72,"props":2845,"children":2846},{"__ignoreMap":520},[2847,2862,2897,2904,2928,2959,2966,3025,3037,3044,3051,3062,3077,3109,3164,3179,3186],{"type":47,"tag":526,"props":2848,"children":2849},{"class":528,"line":529},[2850,2854,2858],{"type":47,"tag":526,"props":2851,"children":2852},{"style":655},[2853],{"type":53,"value":1809},{"type":47,"tag":526,"props":2855,"children":2856},{"style":538},[2857],{"type":53,"value":2060},{"type":47,"tag":526,"props":2859,"children":2860},{"style":655},[2861],{"type":53,"value":888},{"type":47,"tag":526,"props":2863,"children":2864},{"class":528,"line":555},[2865,2869,2873,2877,2881,2885,2889,2893],{"type":47,"tag":526,"props":2866,"children":2867},{"style":1394},[2868],{"type":53,"value":1397},{"type":47,"tag":526,"props":2870,"children":2871},{"style":655},[2872],{"type":53,"value":1402},{"type":47,"tag":526,"props":2874,"children":2875},{"style":825},[2876],{"type":53,"value":2080},{"type":47,"tag":526,"props":2878,"children":2879},{"style":655},[2880],{"type":53,"value":1412},{"type":47,"tag":526,"props":2882,"children":2883},{"style":1394},[2884],{"type":53,"value":1417},{"type":47,"tag":526,"props":2886,"children":2887},{"style":655},[2888],{"type":53,"value":878},{"type":47,"tag":526,"props":2890,"children":2891},{"style":538},[2892],{"type":53,"value":153},{"type":47,"tag":526,"props":2894,"children":2895},{"style":655},[2896],{"type":53,"value":888},{"type":47,"tag":526,"props":2898,"children":2899},{"class":528,"line":586},[2900],{"type":47,"tag":526,"props":2901,"children":2902},{"emptyLinePlaceholder":1435},[2903],{"type":53,"value":1438},{"type":47,"tag":526,"props":2905,"children":2906},{"class":528,"line":30},[2907,2911,2915,2920,2924],{"type":47,"tag":526,"props":2908,"children":2909},{"style":1394},[2910],{"type":53,"value":1446},{"type":47,"tag":526,"props":2912,"children":2913},{"style":1454},[2914],{"type":53,"value":1457},{"type":47,"tag":526,"props":2916,"children":2917},{"style":1460},[2918],{"type":53,"value":2919}," UpgradePrompt",{"type":47,"tag":526,"props":2921,"children":2922},{"style":655},[2923],{"type":53,"value":1468},{"type":47,"tag":526,"props":2925,"children":2926},{"style":655},[2927],{"type":53,"value":1473},{"type":47,"tag":526,"props":2929,"children":2930},{"class":528,"line":1490},[2931,2935,2939,2943,2947,2951,2955],{"type":47,"tag":526,"props":2932,"children":2933},{"style":1454},[2934],{"type":53,"value":1716},{"type":47,"tag":526,"props":2936,"children":2937},{"style":655},[2938],{"type":53,"value":1402},{"type":47,"tag":526,"props":2940,"children":2941},{"style":825},[2942],{"type":53,"value":1725},{"type":47,"tag":526,"props":2944,"children":2945},{"style":655},[2946],{"type":53,"value":1412},{"type":47,"tag":526,"props":2948,"children":2949},{"style":655},[2950],{"type":53,"value":1734},{"type":47,"tag":526,"props":2952,"children":2953},{"style":1460},[2954],{"type":53,"value":2080},{"type":47,"tag":526,"props":2956,"children":2957},{"style":1484},[2958],{"type":53,"value":1748},{"type":47,"tag":526,"props":2960,"children":2961},{"class":528,"line":1509},[2962],{"type":47,"tag":526,"props":2963,"children":2964},{"emptyLinePlaceholder":1435},[2965],{"type":53,"value":1438},{"type":47,"tag":526,"props":2967,"children":2968},{"class":528,"line":1544},[2969,2973,2977,2981,2985,2989,2993,2997,3001,3005,3009,3013,3017,3021],{"type":47,"tag":526,"props":2970,"children":2971},{"style":1394},[2972],{"type":53,"value":2180},{"type":47,"tag":526,"props":2974,"children":2975},{"style":1484},[2976],{"type":53,"value":2185},{"type":47,"tag":526,"props":2978,"children":2979},{"style":1460},[2980],{"type":53,"value":2702},{"type":47,"tag":526,"props":2982,"children":2983},{"style":655},[2984],{"type":53,"value":2241},{"type":47,"tag":526,"props":2986,"children":2987},{"style":1484},[2988],{"type":53,"value":1780},{"type":47,"tag":526,"props":2990,"children":2991},{"style":655},[2992],{"type":53,"value":1785},{"type":47,"tag":526,"props":2994,"children":2995},{"style":1484},[2996],{"type":53,"value":2715},{"type":47,"tag":526,"props":2998,"children":2999},{"style":655},[3000],{"type":53,"value":1795},{"type":47,"tag":526,"props":3002,"children":3003},{"style":655},[3004],{"type":53,"value":878},{"type":47,"tag":526,"props":3006,"children":3007},{"style":538},[3008],{"type":53,"value":2728},{"type":47,"tag":526,"props":3010,"children":3011},{"style":655},[3012],{"type":53,"value":1809},{"type":47,"tag":526,"props":3014,"children":3015},{"style":655},[3016],{"type":53,"value":1412},{"type":47,"tag":526,"props":3018,"children":3019},{"style":1484},[3020],{"type":53,"value":2741},{"type":47,"tag":526,"props":3022,"children":3023},{"style":655},[3024],{"type":53,"value":2746},{"type":47,"tag":526,"props":3026,"children":3027},{"class":528,"line":1562},[3028,3033],{"type":47,"tag":526,"props":3029,"children":3030},{"style":1394},[3031],{"type":53,"value":3032},"        return",{"type":47,"tag":526,"props":3034,"children":3035},{"style":655},[3036],{"type":53,"value":2210},{"type":47,"tag":526,"props":3038,"children":3039},{"class":528,"line":1579},[3040],{"type":47,"tag":526,"props":3041,"children":3042},{"style":655},[3043],{"type":53,"value":2783},{"type":47,"tag":526,"props":3045,"children":3046},{"class":528,"line":1588},[3047],{"type":47,"tag":526,"props":3048,"children":3049},{"emptyLinePlaceholder":1435},[3050],{"type":53,"value":1438},{"type":47,"tag":526,"props":3052,"children":3053},{"class":528,"line":1911},[3054,3058],{"type":47,"tag":526,"props":3055,"children":3056},{"style":1394},[3057],{"type":53,"value":1481},{"type":47,"tag":526,"props":3059,"children":3060},{"style":1484},[3061],{"type":53,"value":1487},{"type":47,"tag":526,"props":3063,"children":3064},{"class":528,"line":1945},[3065,3069,3073],{"type":47,"tag":526,"props":3066,"children":3067},{"style":655},[3068],{"type":53,"value":1496},{"type":47,"tag":526,"props":3070,"children":3071},{"style":1484},[3072],{"type":53,"value":1904},{"type":47,"tag":526,"props":3074,"children":3075},{"style":655},[3076],{"type":53,"value":1506},{"type":47,"tag":526,"props":3078,"children":3079},{"class":528,"line":1975},[3080,3084,3088,3092,3097,3101,3105],{"type":47,"tag":526,"props":3081,"children":3082},{"style":655},[3083],{"type":53,"value":1515},{"type":47,"tag":526,"props":3085,"children":3086},{"style":1484},[3087],{"type":53,"value":60},{"type":47,"tag":526,"props":3089,"children":3090},{"style":655},[3091],{"type":53,"value":833},{"type":47,"tag":526,"props":3093,"children":3094},{"style":825},[3095],{"type":53,"value":3096},"Upgrade to Pro to access this feature",{"type":47,"tag":526,"props":3098,"children":3099},{"style":655},[3100],{"type":53,"value":1533},{"type":47,"tag":526,"props":3102,"children":3103},{"style":1484},[3104],{"type":53,"value":60},{"type":47,"tag":526,"props":3106,"children":3107},{"style":655},[3108],{"type":53,"value":1506},{"type":47,"tag":526,"props":3110,"children":3111},{"class":528,"line":1991},[3112,3116,3120,3125,3130,3135,3139,3143,3147,3152,3156,3160],{"type":47,"tag":526,"props":3113,"children":3114},{"style":655},[3115],{"type":53,"value":1515},{"type":47,"tag":526,"props":3117,"children":3118},{"style":1484},[3119],{"type":53,"value":104},{"type":47,"tag":526,"props":3121,"children":3122},{"style":1454},[3123],{"type":53,"value":3124}," href",{"type":47,"tag":526,"props":3126,"children":3127},{"style":655},[3128],{"type":53,"value":3129},"=",{"type":47,"tag":526,"props":3131,"children":3132},{"style":655},[3133],{"type":53,"value":3134},"\"",{"type":47,"tag":526,"props":3136,"children":3137},{"style":538},[3138],{"type":53,"value":2767},{"type":47,"tag":526,"props":3140,"children":3141},{"style":655},[3142],{"type":53,"value":3134},{"type":47,"tag":526,"props":3144,"children":3145},{"style":655},[3146],{"type":53,"value":833},{"type":47,"tag":526,"props":3148,"children":3149},{"style":825},[3150],{"type":53,"value":3151},"View plans",{"type":47,"tag":526,"props":3153,"children":3154},{"style":655},[3155],{"type":53,"value":1533},{"type":47,"tag":526,"props":3157,"children":3158},{"style":1484},[3159],{"type":53,"value":104},{"type":47,"tag":526,"props":3161,"children":3162},{"style":655},[3163],{"type":53,"value":1506},{"type":47,"tag":526,"props":3165,"children":3166},{"class":528,"line":1999},[3167,3171,3175],{"type":47,"tag":526,"props":3168,"children":3169},{"style":655},[3170],{"type":53,"value":1568},{"type":47,"tag":526,"props":3172,"children":3173},{"style":1484},[3174],{"type":53,"value":1904},{"type":47,"tag":526,"props":3176,"children":3177},{"style":655},[3178],{"type":53,"value":1506},{"type":47,"tag":526,"props":3180,"children":3181},{"class":528,"line":2467},[3182],{"type":47,"tag":526,"props":3183,"children":3184},{"style":1484},[3185],{"type":53,"value":1585},{"type":47,"tag":526,"props":3187,"children":3188},{"class":528,"line":2475},[3189],{"type":47,"tag":526,"props":3190,"children":3191},{"style":655},[3192],{"type":53,"value":1594},{"type":47,"tag":508,"props":3194,"children":3196},{"id":3195},"_6-b2b-seat-based-billing-with-organizations",[3197],{"type":53,"value":3198},"6. B2B Seat-Based Billing with Organizations",{"type":47,"tag":60,"props":3200,"children":3201},{},[3202,3204,3209,3211,3217,3219,3224,3226,3231,3233,3239],{"type":53,"value":3203},"Org plans can carry a ",{"type":47,"tag":64,"props":3205,"children":3206},{},[3207],{"type":53,"value":3208},"seat limit",{"type":53,"value":3210}," (membership cap) that Clerk enforces at invite time. Use the ",{"type":47,"tag":72,"props":3212,"children":3214},{"className":3213},[],[3215],{"type":53,"value":3216},"org:",{"type":53,"value":3218}," slug prefix on org-side plan checks (e.g. ",{"type":47,"tag":72,"props":3220,"children":3222},{"className":3221},[],[3223],{"type":53,"value":1326},{"type":53,"value":3225},") to keep gating unambiguous. Render the B2B pricing page with ",{"type":47,"tag":72,"props":3227,"children":3229},{"className":3228},[],[3230],{"type":53,"value":276},{"type":53,"value":3232},", and use ",{"type":47,"tag":72,"props":3234,"children":3236},{"className":3235},[],[3237],{"type":53,"value":3238},"\u003COrganizationProfile \u002F>",{"type":53,"value":3240}," for the org account billing UI.",{"type":47,"tag":60,"props":3242,"children":3243},{},[3244,3246,3251],{"type":53,"value":3245},"See ",{"type":47,"tag":72,"props":3247,"children":3249},{"className":3248},[],[3250],{"type":53,"value":1038},{"type":53,"value":3252}," for tiered plan naming, seat-limit invariants, admin-only billing, and webhook handlers.",{"type":47,"tag":508,"props":3254,"children":3256},{"id":3255},"_7-display-subscription-status",[3257],{"type":53,"value":3258},"7. Display Subscription Status",{"type":47,"tag":60,"props":3260,"children":3261},{},[3262,3264,3269,3271,3277,3279,3285],{"type":53,"value":3263},"Check specific plans with ",{"type":47,"tag":72,"props":3265,"children":3267},{"className":3266},[],[3268],{"type":53,"value":92},{"type":53,"value":3270},", or use ",{"type":47,"tag":72,"props":3272,"children":3274},{"className":3273},[],[3275],{"type":53,"value":3276},"useSubscription()",{"type":53,"value":3278}," for full subscription details in client components. Do not read plan information from ",{"type":47,"tag":72,"props":3280,"children":3282},{"className":3281},[],[3283],{"type":53,"value":3284},"sessionClaims",{"type":53,"value":3286}," directly, that is not the supported path.",{"type":47,"tag":60,"props":3288,"children":3289},{},[3290],{"type":53,"value":3291},"Server component, check for specific plans:",{"type":47,"tag":515,"props":3293,"children":3295},{"className":1625,"code":3294,"language":1627,"meta":520,"style":520},"import { auth } from '@clerk\u002Fnextjs\u002Fserver'\n\nexport default async function AccountPage() {\n    const { has } = await auth()\n\n    const currentPlan = has({ plan: 'pro' })\n        ? 'pro'\n        : has({ plan: 'starter' })\n            ? 'starter'\n            : 'free'\n\n    return (\n        \u003Cdiv>\n            \u003Ch2>Current Plan\u003C\u002Fh2>\n            \u003Cp>You are on the {currentPlan} plan\u003C\u002Fp>\n            {currentPlan === 'free' && \u003Ca href=\"\u002Fpricing\">Upgrade\u003C\u002Fa>}\n        \u003C\u002Fdiv>\n    )\n}\n",[3296],{"type":47,"tag":72,"props":3297,"children":3298},{"__ignoreMap":520},[3299,3334,3341,3373,3408,3415,3471,3491,3540,3560,3581,3588,3599,3614,3651,3716,3787,3802,3810],{"type":47,"tag":526,"props":3300,"children":3301},{"class":528,"line":529},[3302,3306,3310,3314,3318,3322,3326,3330],{"type":47,"tag":526,"props":3303,"children":3304},{"style":1394},[3305],{"type":53,"value":1397},{"type":47,"tag":526,"props":3307,"children":3308},{"style":655},[3309],{"type":53,"value":1402},{"type":47,"tag":526,"props":3311,"children":3312},{"style":825},[3313],{"type":53,"value":1647},{"type":47,"tag":526,"props":3315,"children":3316},{"style":655},[3317],{"type":53,"value":1412},{"type":47,"tag":526,"props":3319,"children":3320},{"style":1394},[3321],{"type":53,"value":1417},{"type":47,"tag":526,"props":3323,"children":3324},{"style":655},[3325],{"type":53,"value":878},{"type":47,"tag":526,"props":3327,"children":3328},{"style":538},[3329],{"type":53,"value":1664},{"type":47,"tag":526,"props":3331,"children":3332},{"style":655},[3333],{"type":53,"value":888},{"type":47,"tag":526,"props":3335,"children":3336},{"class":528,"line":555},[3337],{"type":47,"tag":526,"props":3338,"children":3339},{"emptyLinePlaceholder":1435},[3340],{"type":53,"value":1438},{"type":47,"tag":526,"props":3342,"children":3343},{"class":528,"line":586},[3344,3348,3352,3356,3360,3365,3369],{"type":47,"tag":526,"props":3345,"children":3346},{"style":1394},[3347],{"type":53,"value":1446},{"type":47,"tag":526,"props":3349,"children":3350},{"style":1394},[3351],{"type":53,"value":1451},{"type":47,"tag":526,"props":3353,"children":3354},{"style":1454},[3355],{"type":53,"value":1691},{"type":47,"tag":526,"props":3357,"children":3358},{"style":1454},[3359],{"type":53,"value":1457},{"type":47,"tag":526,"props":3361,"children":3362},{"style":1460},[3363],{"type":53,"value":3364}," AccountPage",{"type":47,"tag":526,"props":3366,"children":3367},{"style":655},[3368],{"type":53,"value":1468},{"type":47,"tag":526,"props":3370,"children":3371},{"style":655},[3372],{"type":53,"value":1473},{"type":47,"tag":526,"props":3374,"children":3375},{"class":528,"line":30},[3376,3380,3384,3388,3392,3396,3400,3404],{"type":47,"tag":526,"props":3377,"children":3378},{"style":1454},[3379],{"type":53,"value":1716},{"type":47,"tag":526,"props":3381,"children":3382},{"style":655},[3383],{"type":53,"value":1402},{"type":47,"tag":526,"props":3385,"children":3386},{"style":825},[3387],{"type":53,"value":1725},{"type":47,"tag":526,"props":3389,"children":3390},{"style":655},[3391],{"type":53,"value":1412},{"type":47,"tag":526,"props":3393,"children":3394},{"style":655},[3395],{"type":53,"value":1734},{"type":47,"tag":526,"props":3397,"children":3398},{"style":1394},[3399],{"type":53,"value":1739},{"type":47,"tag":526,"props":3401,"children":3402},{"style":1460},[3403],{"type":53,"value":1647},{"type":47,"tag":526,"props":3405,"children":3406},{"style":1484},[3407],{"type":53,"value":1748},{"type":47,"tag":526,"props":3409,"children":3410},{"class":528,"line":1490},[3411],{"type":47,"tag":526,"props":3412,"children":3413},{"emptyLinePlaceholder":1435},[3414],{"type":53,"value":1438},{"type":47,"tag":526,"props":3416,"children":3417},{"class":528,"line":1509},[3418,3422,3427,3431,3435,3439,3443,3447,3451,3455,3459,3463,3467],{"type":47,"tag":526,"props":3419,"children":3420},{"style":1454},[3421],{"type":53,"value":1716},{"type":47,"tag":526,"props":3423,"children":3424},{"style":825},[3425],{"type":53,"value":3426}," currentPlan",{"type":47,"tag":526,"props":3428,"children":3429},{"style":655},[3430],{"type":53,"value":1734},{"type":47,"tag":526,"props":3432,"children":3433},{"style":1460},[3434],{"type":53,"value":1725},{"type":47,"tag":526,"props":3436,"children":3437},{"style":1484},[3438],{"type":53,"value":1780},{"type":47,"tag":526,"props":3440,"children":3441},{"style":655},[3442],{"type":53,"value":1785},{"type":47,"tag":526,"props":3444,"children":3445},{"style":1484},[3446],{"type":53,"value":2715},{"type":47,"tag":526,"props":3448,"children":3449},{"style":655},[3450],{"type":53,"value":1795},{"type":47,"tag":526,"props":3452,"children":3453},{"style":655},[3454],{"type":53,"value":878},{"type":47,"tag":526,"props":3456,"children":3457},{"style":538},[3458],{"type":53,"value":2728},{"type":47,"tag":526,"props":3460,"children":3461},{"style":655},[3462],{"type":53,"value":1809},{"type":47,"tag":526,"props":3464,"children":3465},{"style":655},[3466],{"type":53,"value":1412},{"type":47,"tag":526,"props":3468,"children":3469},{"style":1484},[3470],{"type":53,"value":1818},{"type":47,"tag":526,"props":3472,"children":3473},{"class":528,"line":1544},[3474,3479,3483,3487],{"type":47,"tag":526,"props":3475,"children":3476},{"style":655},[3477],{"type":53,"value":3478},"        ?",{"type":47,"tag":526,"props":3480,"children":3481},{"style":655},[3482],{"type":53,"value":878},{"type":47,"tag":526,"props":3484,"children":3485},{"style":538},[3486],{"type":53,"value":2728},{"type":47,"tag":526,"props":3488,"children":3489},{"style":655},[3490],{"type":53,"value":888},{"type":47,"tag":526,"props":3492,"children":3493},{"class":528,"line":1562},[3494,3499,3503,3507,3511,3515,3519,3523,3528,3532,3536],{"type":47,"tag":526,"props":3495,"children":3496},{"style":655},[3497],{"type":53,"value":3498},"        :",{"type":47,"tag":526,"props":3500,"children":3501},{"style":1460},[3502],{"type":53,"value":1725},{"type":47,"tag":526,"props":3504,"children":3505},{"style":1484},[3506],{"type":53,"value":1780},{"type":47,"tag":526,"props":3508,"children":3509},{"style":655},[3510],{"type":53,"value":1785},{"type":47,"tag":526,"props":3512,"children":3513},{"style":1484},[3514],{"type":53,"value":2715},{"type":47,"tag":526,"props":3516,"children":3517},{"style":655},[3518],{"type":53,"value":1795},{"type":47,"tag":526,"props":3520,"children":3521},{"style":655},[3522],{"type":53,"value":878},{"type":47,"tag":526,"props":3524,"children":3525},{"style":538},[3526],{"type":53,"value":3527},"starter",{"type":47,"tag":526,"props":3529,"children":3530},{"style":655},[3531],{"type":53,"value":1809},{"type":47,"tag":526,"props":3533,"children":3534},{"style":655},[3535],{"type":53,"value":1412},{"type":47,"tag":526,"props":3537,"children":3538},{"style":1484},[3539],{"type":53,"value":1818},{"type":47,"tag":526,"props":3541,"children":3542},{"class":528,"line":1579},[3543,3548,3552,3556],{"type":47,"tag":526,"props":3544,"children":3545},{"style":655},[3546],{"type":53,"value":3547},"            ?",{"type":47,"tag":526,"props":3549,"children":3550},{"style":655},[3551],{"type":53,"value":878},{"type":47,"tag":526,"props":3553,"children":3554},{"style":538},[3555],{"type":53,"value":3527},{"type":47,"tag":526,"props":3557,"children":3558},{"style":655},[3559],{"type":53,"value":888},{"type":47,"tag":526,"props":3561,"children":3562},{"class":528,"line":1588},[3563,3568,3572,3577],{"type":47,"tag":526,"props":3564,"children":3565},{"style":655},[3566],{"type":53,"value":3567},"            :",{"type":47,"tag":526,"props":3569,"children":3570},{"style":655},[3571],{"type":53,"value":878},{"type":47,"tag":526,"props":3573,"children":3574},{"style":538},[3575],{"type":53,"value":3576},"free",{"type":47,"tag":526,"props":3578,"children":3579},{"style":655},[3580],{"type":53,"value":888},{"type":47,"tag":526,"props":3582,"children":3583},{"class":528,"line":1911},[3584],{"type":47,"tag":526,"props":3585,"children":3586},{"emptyLinePlaceholder":1435},[3587],{"type":53,"value":1438},{"type":47,"tag":526,"props":3589,"children":3590},{"class":528,"line":1945},[3591,3595],{"type":47,"tag":526,"props":3592,"children":3593},{"style":1394},[3594],{"type":53,"value":1481},{"type":47,"tag":526,"props":3596,"children":3597},{"style":1484},[3598],{"type":53,"value":1487},{"type":47,"tag":526,"props":3600,"children":3601},{"class":528,"line":1975},[3602,3606,3610],{"type":47,"tag":526,"props":3603,"children":3604},{"style":1484},[3605],{"type":53,"value":1496},{"type":47,"tag":526,"props":3607,"children":3608},{"style":533},[3609],{"type":53,"value":1904},{"type":47,"tag":526,"props":3611,"children":3612},{"style":1484},[3613],{"type":53,"value":1506},{"type":47,"tag":526,"props":3615,"children":3616},{"class":528,"line":1991},[3617,3621,3625,3629,3634,3639,3643,3647],{"type":47,"tag":526,"props":3618,"children":3619},{"style":1484},[3620],{"type":53,"value":1515},{"type":47,"tag":526,"props":3622,"children":3623},{"style":533},[3624],{"type":53,"value":172},{"type":47,"tag":526,"props":3626,"children":3627},{"style":1484},[3628],{"type":53,"value":833},{"type":47,"tag":526,"props":3630,"children":3631},{"style":825},[3632],{"type":53,"value":3633},"Current",{"type":47,"tag":526,"props":3635,"children":3636},{"style":825},[3637],{"type":53,"value":3638}," Plan",{"type":47,"tag":526,"props":3640,"children":3641},{"style":655},[3642],{"type":53,"value":1533},{"type":47,"tag":526,"props":3644,"children":3645},{"style":825},[3646],{"type":53,"value":172},{"type":47,"tag":526,"props":3648,"children":3649},{"style":655},[3650],{"type":53,"value":1506},{"type":47,"tag":526,"props":3652,"children":3653},{"class":528,"line":1999},[3654,3658,3662,3666,3671,3676,3681,3686,3690,3695,3700,3704,3708,3712],{"type":47,"tag":526,"props":3655,"children":3656},{"style":1484},[3657],{"type":53,"value":1515},{"type":47,"tag":526,"props":3659,"children":3660},{"style":533},[3661],{"type":53,"value":60},{"type":47,"tag":526,"props":3663,"children":3664},{"style":1484},[3665],{"type":53,"value":833},{"type":47,"tag":526,"props":3667,"children":3668},{"style":825},[3669],{"type":53,"value":3670},"You",{"type":47,"tag":526,"props":3672,"children":3673},{"style":825},[3674],{"type":53,"value":3675}," are",{"type":47,"tag":526,"props":3677,"children":3678},{"style":825},[3679],{"type":53,"value":3680}," on",{"type":47,"tag":526,"props":3682,"children":3683},{"style":825},[3684],{"type":53,"value":3685}," the",{"type":47,"tag":526,"props":3687,"children":3688},{"style":655},[3689],{"type":53,"value":1402},{"type":47,"tag":526,"props":3691,"children":3692},{"style":1920},[3693],{"type":53,"value":3694},"currentPlan",{"type":47,"tag":526,"props":3696,"children":3697},{"style":655},[3698],{"type":53,"value":3699},"}",{"type":47,"tag":526,"props":3701,"children":3702},{"style":825},[3703],{"type":53,"value":2715},{"type":47,"tag":526,"props":3705,"children":3706},{"style":655},[3707],{"type":53,"value":1533},{"type":47,"tag":526,"props":3709,"children":3710},{"style":825},[3711],{"type":53,"value":60},{"type":47,"tag":526,"props":3713,"children":3714},{"style":655},[3715],{"type":53,"value":1506},{"type":47,"tag":526,"props":3717,"children":3718},{"class":528,"line":2467},[3719,3723,3727,3732,3736,3741,3745,3749,3753,3757,3761,3765,3769,3774,3778,3782],{"type":47,"tag":526,"props":3720,"children":3721},{"style":655},[3722],{"type":53,"value":1917},{"type":47,"tag":526,"props":3724,"children":3725},{"style":1920},[3726],{"type":53,"value":3694},{"type":47,"tag":526,"props":3728,"children":3729},{"style":1484},[3730],{"type":53,"value":3731}," === '",{"type":47,"tag":526,"props":3733,"children":3734},{"style":1920},[3735],{"type":53,"value":3576},{"type":47,"tag":526,"props":3737,"children":3738},{"style":1484},[3739],{"type":53,"value":3740},"' && \u003C",{"type":47,"tag":526,"props":3742,"children":3743},{"style":1920},[3744],{"type":53,"value":104},{"type":47,"tag":526,"props":3746,"children":3747},{"style":1920},[3748],{"type":53,"value":3124},{"type":47,"tag":526,"props":3750,"children":3751},{"style":655},[3752],{"type":53,"value":3129},{"type":47,"tag":526,"props":3754,"children":3755},{"style":655},[3756],{"type":53,"value":3134},{"type":47,"tag":526,"props":3758,"children":3759},{"style":538},[3760],{"type":53,"value":2767},{"type":47,"tag":526,"props":3762,"children":3763},{"style":655},[3764],{"type":53,"value":3134},{"type":47,"tag":526,"props":3766,"children":3767},{"style":655},[3768],{"type":53,"value":833},{"type":47,"tag":526,"props":3770,"children":3771},{"style":825},[3772],{"type":53,"value":3773},"Upgrade",{"type":47,"tag":526,"props":3775,"children":3776},{"style":655},[3777],{"type":53,"value":1533},{"type":47,"tag":526,"props":3779,"children":3780},{"style":825},[3781],{"type":53,"value":104},{"type":47,"tag":526,"props":3783,"children":3784},{"style":655},[3785],{"type":53,"value":3786},">}\n",{"type":47,"tag":526,"props":3788,"children":3789},{"class":528,"line":2475},[3790,3794,3798],{"type":47,"tag":526,"props":3791,"children":3792},{"style":655},[3793],{"type":53,"value":1568},{"type":47,"tag":526,"props":3795,"children":3796},{"style":825},[3797],{"type":53,"value":1904},{"type":47,"tag":526,"props":3799,"children":3800},{"style":655},[3801],{"type":53,"value":1506},{"type":47,"tag":526,"props":3803,"children":3805},{"class":528,"line":3804},18,[3806],{"type":47,"tag":526,"props":3807,"children":3808},{"style":1484},[3809],{"type":53,"value":1585},{"type":47,"tag":526,"props":3811,"children":3813},{"class":528,"line":3812},19,[3814],{"type":47,"tag":526,"props":3815,"children":3816},{"style":655},[3817],{"type":53,"value":1594},{"type":47,"tag":60,"props":3819,"children":3820},{},[3821,3823,3828],{"type":53,"value":3822},"Client component, full subscription details via ",{"type":47,"tag":72,"props":3824,"children":3826},{"className":3825},[],[3827],{"type":53,"value":3276},{"type":53,"value":1795},{"type":47,"tag":515,"props":3830,"children":3832},{"className":1382,"code":3831,"language":1384,"meta":520,"style":520},"'use client'\nimport { useSubscription } from '@clerk\u002Fnextjs\u002Fexperimental'\n\nexport function SubscriptionDetails() {\n    const { data: subscription, isLoading } = useSubscription()\n    if (isLoading) return null\n    if (!subscription) return \u003Ca href=\"\u002Fpricing\">Choose a plan\u003C\u002Fa>\n\n    return (\n        \u003Cdiv>\n            \u003Cp>Status: {subscription.status}\u003C\u002Fp>\n            {subscription.nextPayment && (\n                \u003Cp>Next payment: {subscription.nextPayment.date.toLocaleDateString()}\u003C\u002Fp>\n            )}\n        \u003C\u002Fdiv>\n    )\n}\n",[3833],{"type":47,"tag":72,"props":3834,"children":3835},{"__ignoreMap":520},[3836,3851,3888,3895,3919,3969,3997,4073,4080,4091,4106,4156,4184,4256,4268,4283,4290],{"type":47,"tag":526,"props":3837,"children":3838},{"class":528,"line":529},[3839,3843,3847],{"type":47,"tag":526,"props":3840,"children":3841},{"style":655},[3842],{"type":53,"value":1809},{"type":47,"tag":526,"props":3844,"children":3845},{"style":538},[3846],{"type":53,"value":2060},{"type":47,"tag":526,"props":3848,"children":3849},{"style":655},[3850],{"type":53,"value":888},{"type":47,"tag":526,"props":3852,"children":3853},{"class":528,"line":555},[3854,3858,3862,3867,3871,3875,3879,3884],{"type":47,"tag":526,"props":3855,"children":3856},{"style":1394},[3857],{"type":53,"value":1397},{"type":47,"tag":526,"props":3859,"children":3860},{"style":655},[3861],{"type":53,"value":1402},{"type":47,"tag":526,"props":3863,"children":3864},{"style":825},[3865],{"type":53,"value":3866}," useSubscription",{"type":47,"tag":526,"props":3868,"children":3869},{"style":655},[3870],{"type":53,"value":1412},{"type":47,"tag":526,"props":3872,"children":3873},{"style":1394},[3874],{"type":53,"value":1417},{"type":47,"tag":526,"props":3876,"children":3877},{"style":655},[3878],{"type":53,"value":878},{"type":47,"tag":526,"props":3880,"children":3881},{"style":538},[3882],{"type":53,"value":3883},"@clerk\u002Fnextjs\u002Fexperimental",{"type":47,"tag":526,"props":3885,"children":3886},{"style":655},[3887],{"type":53,"value":888},{"type":47,"tag":526,"props":3889,"children":3890},{"class":528,"line":586},[3891],{"type":47,"tag":526,"props":3892,"children":3893},{"emptyLinePlaceholder":1435},[3894],{"type":53,"value":1438},{"type":47,"tag":526,"props":3896,"children":3897},{"class":528,"line":30},[3898,3902,3906,3911,3915],{"type":47,"tag":526,"props":3899,"children":3900},{"style":1394},[3901],{"type":53,"value":1446},{"type":47,"tag":526,"props":3903,"children":3904},{"style":1454},[3905],{"type":53,"value":1457},{"type":47,"tag":526,"props":3907,"children":3908},{"style":1460},[3909],{"type":53,"value":3910}," SubscriptionDetails",{"type":47,"tag":526,"props":3912,"children":3913},{"style":655},[3914],{"type":53,"value":1468},{"type":47,"tag":526,"props":3916,"children":3917},{"style":655},[3918],{"type":53,"value":1473},{"type":47,"tag":526,"props":3920,"children":3921},{"class":528,"line":1490},[3922,3926,3930,3935,3939,3944,3948,3953,3957,3961,3965],{"type":47,"tag":526,"props":3923,"children":3924},{"style":1454},[3925],{"type":53,"value":1716},{"type":47,"tag":526,"props":3927,"children":3928},{"style":655},[3929],{"type":53,"value":1402},{"type":47,"tag":526,"props":3931,"children":3932},{"style":1484},[3933],{"type":53,"value":3934}," data",{"type":47,"tag":526,"props":3936,"children":3937},{"style":655},[3938],{"type":53,"value":1795},{"type":47,"tag":526,"props":3940,"children":3941},{"style":825},[3942],{"type":53,"value":3943}," subscription",{"type":47,"tag":526,"props":3945,"children":3946},{"style":655},[3947],{"type":53,"value":2151},{"type":47,"tag":526,"props":3949,"children":3950},{"style":825},[3951],{"type":53,"value":3952}," isLoading",{"type":47,"tag":526,"props":3954,"children":3955},{"style":655},[3956],{"type":53,"value":1412},{"type":47,"tag":526,"props":3958,"children":3959},{"style":655},[3960],{"type":53,"value":1734},{"type":47,"tag":526,"props":3962,"children":3963},{"style":1460},[3964],{"type":53,"value":3866},{"type":47,"tag":526,"props":3966,"children":3967},{"style":1484},[3968],{"type":53,"value":1748},{"type":47,"tag":526,"props":3970,"children":3971},{"class":528,"line":1509},[3972,3976,3980,3985,3989,3993],{"type":47,"tag":526,"props":3973,"children":3974},{"style":1394},[3975],{"type":53,"value":2180},{"type":47,"tag":526,"props":3977,"children":3978},{"style":1484},[3979],{"type":53,"value":2185},{"type":47,"tag":526,"props":3981,"children":3982},{"style":825},[3983],{"type":53,"value":3984},"isLoading",{"type":47,"tag":526,"props":3986,"children":3987},{"style":1484},[3988],{"type":53,"value":2200},{"type":47,"tag":526,"props":3990,"children":3991},{"style":1394},[3992],{"type":53,"value":2205},{"type":47,"tag":526,"props":3994,"children":3995},{"style":655},[3996],{"type":53,"value":2210},{"type":47,"tag":526,"props":3998,"children":3999},{"class":528,"line":1544},[4000,4004,4008,4012,4017,4021,4025,4029,4033,4037,4041,4045,4049,4053,4057,4061,4065,4069],{"type":47,"tag":526,"props":4001,"children":4002},{"style":1394},[4003],{"type":53,"value":2180},{"type":47,"tag":526,"props":4005,"children":4006},{"style":1484},[4007],{"type":53,"value":2185},{"type":47,"tag":526,"props":4009,"children":4010},{"style":655},[4011],{"type":53,"value":2190},{"type":47,"tag":526,"props":4013,"children":4014},{"style":825},[4015],{"type":53,"value":4016},"subscription",{"type":47,"tag":526,"props":4018,"children":4019},{"style":1484},[4020],{"type":53,"value":2200},{"type":47,"tag":526,"props":4022,"children":4023},{"style":1394},[4024],{"type":53,"value":2205},{"type":47,"tag":526,"props":4026,"children":4027},{"style":655},[4028],{"type":53,"value":2392},{"type":47,"tag":526,"props":4030,"children":4031},{"style":1484},[4032],{"type":53,"value":104},{"type":47,"tag":526,"props":4034,"children":4035},{"style":1454},[4036],{"type":53,"value":3124},{"type":47,"tag":526,"props":4038,"children":4039},{"style":655},[4040],{"type":53,"value":3129},{"type":47,"tag":526,"props":4042,"children":4043},{"style":655},[4044],{"type":53,"value":3134},{"type":47,"tag":526,"props":4046,"children":4047},{"style":538},[4048],{"type":53,"value":2767},{"type":47,"tag":526,"props":4050,"children":4051},{"style":655},[4052],{"type":53,"value":3134},{"type":47,"tag":526,"props":4054,"children":4055},{"style":655},[4056],{"type":53,"value":833},{"type":47,"tag":526,"props":4058,"children":4059},{"style":825},[4060],{"type":53,"value":1528},{"type":47,"tag":526,"props":4062,"children":4063},{"style":655},[4064],{"type":53,"value":1533},{"type":47,"tag":526,"props":4066,"children":4067},{"style":1484},[4068],{"type":53,"value":104},{"type":47,"tag":526,"props":4070,"children":4071},{"style":655},[4072],{"type":53,"value":1506},{"type":47,"tag":526,"props":4074,"children":4075},{"class":528,"line":1562},[4076],{"type":47,"tag":526,"props":4077,"children":4078},{"emptyLinePlaceholder":1435},[4079],{"type":53,"value":1438},{"type":47,"tag":526,"props":4081,"children":4082},{"class":528,"line":1579},[4083,4087],{"type":47,"tag":526,"props":4084,"children":4085},{"style":1394},[4086],{"type":53,"value":1481},{"type":47,"tag":526,"props":4088,"children":4089},{"style":1484},[4090],{"type":53,"value":1487},{"type":47,"tag":526,"props":4092,"children":4093},{"class":528,"line":1588},[4094,4098,4102],{"type":47,"tag":526,"props":4095,"children":4096},{"style":655},[4097],{"type":53,"value":1496},{"type":47,"tag":526,"props":4099,"children":4100},{"style":1484},[4101],{"type":53,"value":1904},{"type":47,"tag":526,"props":4103,"children":4104},{"style":655},[4105],{"type":53,"value":1506},{"type":47,"tag":526,"props":4107,"children":4108},{"class":528,"line":1911},[4109,4113,4117,4121,4126,4130,4134,4138,4143,4148,4152],{"type":47,"tag":526,"props":4110,"children":4111},{"style":655},[4112],{"type":53,"value":1515},{"type":47,"tag":526,"props":4114,"children":4115},{"style":1484},[4116],{"type":53,"value":60},{"type":47,"tag":526,"props":4118,"children":4119},{"style":655},[4120],{"type":53,"value":833},{"type":47,"tag":526,"props":4122,"children":4123},{"style":825},[4124],{"type":53,"value":4125},"Status: ",{"type":47,"tag":526,"props":4127,"children":4128},{"style":655},[4129],{"type":53,"value":1785},{"type":47,"tag":526,"props":4131,"children":4132},{"style":825},[4133],{"type":53,"value":4016},{"type":47,"tag":526,"props":4135,"children":4136},{"style":655},[4137],{"type":53,"value":361},{"type":47,"tag":526,"props":4139,"children":4140},{"style":825},[4141],{"type":53,"value":4142},"status",{"type":47,"tag":526,"props":4144,"children":4145},{"style":655},[4146],{"type":53,"value":4147},"}\u003C\u002F",{"type":47,"tag":526,"props":4149,"children":4150},{"style":1484},[4151],{"type":53,"value":60},{"type":47,"tag":526,"props":4153,"children":4154},{"style":655},[4155],{"type":53,"value":1506},{"type":47,"tag":526,"props":4157,"children":4158},{"class":528,"line":1945},[4159,4163,4167,4171,4176,4180],{"type":47,"tag":526,"props":4160,"children":4161},{"style":655},[4162],{"type":53,"value":1917},{"type":47,"tag":526,"props":4164,"children":4165},{"style":825},[4166],{"type":53,"value":4016},{"type":47,"tag":526,"props":4168,"children":4169},{"style":655},[4170],{"type":53,"value":361},{"type":47,"tag":526,"props":4172,"children":4173},{"style":825},[4174],{"type":53,"value":4175},"nextPayment ",{"type":47,"tag":526,"props":4177,"children":4178},{"style":655},[4179],{"type":53,"value":2387},{"type":47,"tag":526,"props":4181,"children":4182},{"style":825},[4183],{"type":53,"value":1487},{"type":47,"tag":526,"props":4185,"children":4186},{"class":528,"line":1975},[4187,4192,4196,4200,4205,4209,4213,4217,4222,4226,4231,4235,4240,4244,4248,4252],{"type":47,"tag":526,"props":4188,"children":4189},{"style":655},[4190],{"type":53,"value":4191},"                \u003C",{"type":47,"tag":526,"props":4193,"children":4194},{"style":1484},[4195],{"type":53,"value":60},{"type":47,"tag":526,"props":4197,"children":4198},{"style":655},[4199],{"type":53,"value":833},{"type":47,"tag":526,"props":4201,"children":4202},{"style":825},[4203],{"type":53,"value":4204},"Next payment: ",{"type":47,"tag":526,"props":4206,"children":4207},{"style":655},[4208],{"type":53,"value":1785},{"type":47,"tag":526,"props":4210,"children":4211},{"style":825},[4212],{"type":53,"value":4016},{"type":47,"tag":526,"props":4214,"children":4215},{"style":655},[4216],{"type":53,"value":361},{"type":47,"tag":526,"props":4218,"children":4219},{"style":825},[4220],{"type":53,"value":4221},"nextPayment",{"type":47,"tag":526,"props":4223,"children":4224},{"style":655},[4225],{"type":53,"value":361},{"type":47,"tag":526,"props":4227,"children":4228},{"style":825},[4229],{"type":53,"value":4230},"date",{"type":47,"tag":526,"props":4232,"children":4233},{"style":655},[4234],{"type":53,"value":361},{"type":47,"tag":526,"props":4236,"children":4237},{"style":1460},[4238],{"type":53,"value":4239},"toLocaleDateString",{"type":47,"tag":526,"props":4241,"children":4242},{"style":825},[4243],{"type":53,"value":1468},{"type":47,"tag":526,"props":4245,"children":4246},{"style":655},[4247],{"type":53,"value":4147},{"type":47,"tag":526,"props":4249,"children":4250},{"style":1484},[4251],{"type":53,"value":60},{"type":47,"tag":526,"props":4253,"children":4254},{"style":655},[4255],{"type":53,"value":1506},{"type":47,"tag":526,"props":4257,"children":4258},{"class":528,"line":1991},[4259,4264],{"type":47,"tag":526,"props":4260,"children":4261},{"style":825},[4262],{"type":53,"value":4263},"            )",{"type":47,"tag":526,"props":4265,"children":4266},{"style":655},[4267],{"type":53,"value":1594},{"type":47,"tag":526,"props":4269,"children":4270},{"class":528,"line":1999},[4271,4275,4279],{"type":47,"tag":526,"props":4272,"children":4273},{"style":655},[4274],{"type":53,"value":1568},{"type":47,"tag":526,"props":4276,"children":4277},{"style":1484},[4278],{"type":53,"value":1904},{"type":47,"tag":526,"props":4280,"children":4281},{"style":655},[4282],{"type":53,"value":1506},{"type":47,"tag":526,"props":4284,"children":4285},{"class":528,"line":2467},[4286],{"type":47,"tag":526,"props":4287,"children":4288},{"style":1484},[4289],{"type":53,"value":1585},{"type":47,"tag":526,"props":4291,"children":4292},{"class":528,"line":2475},[4293],{"type":47,"tag":526,"props":4294,"children":4295},{"style":655},[4296],{"type":53,"value":1594},{"type":47,"tag":56,"props":4298,"children":4299},{},[4300],{"type":47,"tag":60,"props":4301,"children":4302},{},[4303,4308,4310,4315,4316,4321],{"type":47,"tag":72,"props":4304,"children":4306},{"className":4305},[],[4307],{"type":53,"value":3276},{"type":53,"value":4309}," is for display only. For authorization checks (gating content or routes), always use ",{"type":47,"tag":72,"props":4311,"children":4313},{"className":4312},[],[4314],{"type":53,"value":92},{"type":53,"value":199},{"type":47,"tag":72,"props":4317,"children":4319},{"className":4318},[],[4320],{"type":53,"value":100},{"type":53,"value":361},{"type":47,"tag":508,"props":4323,"children":4325},{"id":4324},"_8-protect-api-routes-by-plan",[4326],{"type":53,"value":4327},"8. Protect API Routes by Plan",{"type":47,"tag":60,"props":4329,"children":4330},{},[4331,4333,4338],{"type":53,"value":4332},"Gate API routes using ",{"type":47,"tag":72,"props":4334,"children":4336},{"className":4335},[],[4337],{"type":53,"value":359},{"type":53,"value":1795},{"type":47,"tag":515,"props":4340,"children":4342},{"className":1625,"code":4341,"language":1627,"meta":520,"style":520},"import { auth } from '@clerk\u002Fnextjs\u002Fserver'\nimport { NextResponse } from 'next\u002Fserver'\n\nexport async function GET() {\n    const { has } = await auth()\n\n    if (!has({ plan: 'pro' })) {\n        return NextResponse.json({ error: 'Pro plan required' }, { status: 403 })\n    }\n\n    return NextResponse.json({ data: 'premium data' })\n}\n",[4343],{"type":47,"tag":72,"props":4344,"children":4345},{"__ignoreMap":520},[4346,4381,4418,4425,4453,4488,4495,4554,4636,4643,4650,4706],{"type":47,"tag":526,"props":4347,"children":4348},{"class":528,"line":529},[4349,4353,4357,4361,4365,4369,4373,4377],{"type":47,"tag":526,"props":4350,"children":4351},{"style":1394},[4352],{"type":53,"value":1397},{"type":47,"tag":526,"props":4354,"children":4355},{"style":655},[4356],{"type":53,"value":1402},{"type":47,"tag":526,"props":4358,"children":4359},{"style":825},[4360],{"type":53,"value":1647},{"type":47,"tag":526,"props":4362,"children":4363},{"style":655},[4364],{"type":53,"value":1412},{"type":47,"tag":526,"props":4366,"children":4367},{"style":1394},[4368],{"type":53,"value":1417},{"type":47,"tag":526,"props":4370,"children":4371},{"style":655},[4372],{"type":53,"value":878},{"type":47,"tag":526,"props":4374,"children":4375},{"style":538},[4376],{"type":53,"value":1664},{"type":47,"tag":526,"props":4378,"children":4379},{"style":655},[4380],{"type":53,"value":888},{"type":47,"tag":526,"props":4382,"children":4383},{"class":528,"line":555},[4384,4388,4392,4397,4401,4405,4409,4414],{"type":47,"tag":526,"props":4385,"children":4386},{"style":1394},[4387],{"type":53,"value":1397},{"type":47,"tag":526,"props":4389,"children":4390},{"style":655},[4391],{"type":53,"value":1402},{"type":47,"tag":526,"props":4393,"children":4394},{"style":825},[4395],{"type":53,"value":4396}," NextResponse",{"type":47,"tag":526,"props":4398,"children":4399},{"style":655},[4400],{"type":53,"value":1412},{"type":47,"tag":526,"props":4402,"children":4403},{"style":1394},[4404],{"type":53,"value":1417},{"type":47,"tag":526,"props":4406,"children":4407},{"style":655},[4408],{"type":53,"value":878},{"type":47,"tag":526,"props":4410,"children":4411},{"style":538},[4412],{"type":53,"value":4413},"next\u002Fserver",{"type":47,"tag":526,"props":4415,"children":4416},{"style":655},[4417],{"type":53,"value":888},{"type":47,"tag":526,"props":4419,"children":4420},{"class":528,"line":586},[4421],{"type":47,"tag":526,"props":4422,"children":4423},{"emptyLinePlaceholder":1435},[4424],{"type":53,"value":1438},{"type":47,"tag":526,"props":4426,"children":4427},{"class":528,"line":30},[4428,4432,4436,4440,4445,4449],{"type":47,"tag":526,"props":4429,"children":4430},{"style":1394},[4431],{"type":53,"value":1446},{"type":47,"tag":526,"props":4433,"children":4434},{"style":1454},[4435],{"type":53,"value":1691},{"type":47,"tag":526,"props":4437,"children":4438},{"style":1454},[4439],{"type":53,"value":1457},{"type":47,"tag":526,"props":4441,"children":4442},{"style":1460},[4443],{"type":53,"value":4444}," GET",{"type":47,"tag":526,"props":4446,"children":4447},{"style":655},[4448],{"type":53,"value":1468},{"type":47,"tag":526,"props":4450,"children":4451},{"style":655},[4452],{"type":53,"value":1473},{"type":47,"tag":526,"props":4454,"children":4455},{"class":528,"line":1490},[4456,4460,4464,4468,4472,4476,4480,4484],{"type":47,"tag":526,"props":4457,"children":4458},{"style":1454},[4459],{"type":53,"value":1716},{"type":47,"tag":526,"props":4461,"children":4462},{"style":655},[4463],{"type":53,"value":1402},{"type":47,"tag":526,"props":4465,"children":4466},{"style":825},[4467],{"type":53,"value":1725},{"type":47,"tag":526,"props":4469,"children":4470},{"style":655},[4471],{"type":53,"value":1412},{"type":47,"tag":526,"props":4473,"children":4474},{"style":655},[4475],{"type":53,"value":1734},{"type":47,"tag":526,"props":4477,"children":4478},{"style":1394},[4479],{"type":53,"value":1739},{"type":47,"tag":526,"props":4481,"children":4482},{"style":1460},[4483],{"type":53,"value":1647},{"type":47,"tag":526,"props":4485,"children":4486},{"style":1484},[4487],{"type":53,"value":1748},{"type":47,"tag":526,"props":4489,"children":4490},{"class":528,"line":1509},[4491],{"type":47,"tag":526,"props":4492,"children":4493},{"emptyLinePlaceholder":1435},[4494],{"type":53,"value":1438},{"type":47,"tag":526,"props":4496,"children":4497},{"class":528,"line":1544},[4498,4502,4506,4510,4514,4518,4522,4526,4530,4534,4538,4542,4546,4550],{"type":47,"tag":526,"props":4499,"children":4500},{"style":1394},[4501],{"type":53,"value":2180},{"type":47,"tag":526,"props":4503,"children":4504},{"style":1484},[4505],{"type":53,"value":2185},{"type":47,"tag":526,"props":4507,"children":4508},{"style":655},[4509],{"type":53,"value":2190},{"type":47,"tag":526,"props":4511,"children":4512},{"style":1460},[4513],{"type":53,"value":2702},{"type":47,"tag":526,"props":4515,"children":4516},{"style":1484},[4517],{"type":53,"value":1780},{"type":47,"tag":526,"props":4519,"children":4520},{"style":655},[4521],{"type":53,"value":1785},{"type":47,"tag":526,"props":4523,"children":4524},{"style":1484},[4525],{"type":53,"value":2715},{"type":47,"tag":526,"props":4527,"children":4528},{"style":655},[4529],{"type":53,"value":1795},{"type":47,"tag":526,"props":4531,"children":4532},{"style":655},[4533],{"type":53,"value":878},{"type":47,"tag":526,"props":4535,"children":4536},{"style":538},[4537],{"type":53,"value":2728},{"type":47,"tag":526,"props":4539,"children":4540},{"style":655},[4541],{"type":53,"value":1809},{"type":47,"tag":526,"props":4543,"children":4544},{"style":655},[4545],{"type":53,"value":1412},{"type":47,"tag":526,"props":4547,"children":4548},{"style":1484},[4549],{"type":53,"value":2741},{"type":47,"tag":526,"props":4551,"children":4552},{"style":655},[4553],{"type":53,"value":2746},{"type":47,"tag":526,"props":4555,"children":4556},{"class":528,"line":1562},[4557,4561,4565,4569,4574,4578,4582,4587,4591,4595,4600,4604,4609,4613,4618,4622,4628,4632],{"type":47,"tag":526,"props":4558,"children":4559},{"style":1394},[4560],{"type":53,"value":3032},{"type":47,"tag":526,"props":4562,"children":4563},{"style":825},[4564],{"type":53,"value":4396},{"type":47,"tag":526,"props":4566,"children":4567},{"style":655},[4568],{"type":53,"value":361},{"type":47,"tag":526,"props":4570,"children":4571},{"style":1460},[4572],{"type":53,"value":4573},"json",{"type":47,"tag":526,"props":4575,"children":4576},{"style":1484},[4577],{"type":53,"value":1780},{"type":47,"tag":526,"props":4579,"children":4580},{"style":655},[4581],{"type":53,"value":1785},{"type":47,"tag":526,"props":4583,"children":4584},{"style":1484},[4585],{"type":53,"value":4586}," error",{"type":47,"tag":526,"props":4588,"children":4589},{"style":655},[4590],{"type":53,"value":1795},{"type":47,"tag":526,"props":4592,"children":4593},{"style":655},[4594],{"type":53,"value":878},{"type":47,"tag":526,"props":4596,"children":4597},{"style":538},[4598],{"type":53,"value":4599},"Pro plan required",{"type":47,"tag":526,"props":4601,"children":4602},{"style":655},[4603],{"type":53,"value":1809},{"type":47,"tag":526,"props":4605,"children":4606},{"style":655},[4607],{"type":53,"value":4608}," },",{"type":47,"tag":526,"props":4610,"children":4611},{"style":655},[4612],{"type":53,"value":1402},{"type":47,"tag":526,"props":4614,"children":4615},{"style":1484},[4616],{"type":53,"value":4617}," status",{"type":47,"tag":526,"props":4619,"children":4620},{"style":655},[4621],{"type":53,"value":1795},{"type":47,"tag":526,"props":4623,"children":4625},{"style":4624},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[4626],{"type":53,"value":4627}," 403",{"type":47,"tag":526,"props":4629,"children":4630},{"style":655},[4631],{"type":53,"value":1412},{"type":47,"tag":526,"props":4633,"children":4634},{"style":1484},[4635],{"type":53,"value":1818},{"type":47,"tag":526,"props":4637,"children":4638},{"class":528,"line":1579},[4639],{"type":47,"tag":526,"props":4640,"children":4641},{"style":655},[4642],{"type":53,"value":2783},{"type":47,"tag":526,"props":4644,"children":4645},{"class":528,"line":1588},[4646],{"type":47,"tag":526,"props":4647,"children":4648},{"emptyLinePlaceholder":1435},[4649],{"type":53,"value":1438},{"type":47,"tag":526,"props":4651,"children":4652},{"class":528,"line":1911},[4653,4657,4661,4665,4669,4673,4677,4681,4685,4689,4694,4698,4702],{"type":47,"tag":526,"props":4654,"children":4655},{"style":1394},[4656],{"type":53,"value":1481},{"type":47,"tag":526,"props":4658,"children":4659},{"style":825},[4660],{"type":53,"value":4396},{"type":47,"tag":526,"props":4662,"children":4663},{"style":655},[4664],{"type":53,"value":361},{"type":47,"tag":526,"props":4666,"children":4667},{"style":1460},[4668],{"type":53,"value":4573},{"type":47,"tag":526,"props":4670,"children":4671},{"style":1484},[4672],{"type":53,"value":1780},{"type":47,"tag":526,"props":4674,"children":4675},{"style":655},[4676],{"type":53,"value":1785},{"type":47,"tag":526,"props":4678,"children":4679},{"style":1484},[4680],{"type":53,"value":3934},{"type":47,"tag":526,"props":4682,"children":4683},{"style":655},[4684],{"type":53,"value":1795},{"type":47,"tag":526,"props":4686,"children":4687},{"style":655},[4688],{"type":53,"value":878},{"type":47,"tag":526,"props":4690,"children":4691},{"style":538},[4692],{"type":53,"value":4693},"premium data",{"type":47,"tag":526,"props":4695,"children":4696},{"style":655},[4697],{"type":53,"value":1809},{"type":47,"tag":526,"props":4699,"children":4700},{"style":655},[4701],{"type":53,"value":1412},{"type":47,"tag":526,"props":4703,"children":4704},{"style":1484},[4705],{"type":53,"value":1818},{"type":47,"tag":526,"props":4707,"children":4708},{"class":528,"line":1945},[4709],{"type":47,"tag":526,"props":4710,"children":4711},{"style":655},[4712],{"type":53,"value":1594},{"type":47,"tag":508,"props":4714,"children":4716},{"id":4715},"_9-handle-billing-webhooks",[4717],{"type":53,"value":4718},"9. Handle Billing Webhooks",{"type":47,"tag":56,"props":4720,"children":4721},{},[4722,4732,4752,5135],{"type":47,"tag":60,"props":4723,"children":4724},{},[4725,4730],{"type":47,"tag":64,"props":4726,"children":4727},{},[4728],{"type":53,"value":4729},"Clerk event names differ from Stripe event names.",{"type":53,"value":4731}," Clerk billing webhooks use dot-notation and camelCase, not Stripe's underscore format.",{"type":47,"tag":60,"props":4733,"children":4734},{},[4735,4737,4743,4745,4751],{"type":53,"value":4736},"There is no ",{"type":47,"tag":72,"props":4738,"children":4740},{"className":4739},[],[4741],{"type":53,"value":4742},"subscription.canceled",{"type":53,"value":4744}," event. Cancellation fires at the item level as ",{"type":47,"tag":72,"props":4746,"children":4748},{"className":4747},[],[4749],{"type":53,"value":4750},"subscriptionItem.canceled",{"type":53,"value":361},{"type":47,"tag":379,"props":4753,"children":4754},{},[4755,4776],{"type":47,"tag":383,"props":4756,"children":4757},{},[4758],{"type":47,"tag":387,"props":4759,"children":4760},{},[4761,4766,4771],{"type":47,"tag":391,"props":4762,"children":4763},{},[4764],{"type":53,"value":4765},"Intent",{"type":47,"tag":391,"props":4767,"children":4768},{},[4769],{"type":53,"value":4770},"Stripe event name",{"type":47,"tag":391,"props":4772,"children":4773},{},[4774],{"type":53,"value":4775},"Clerk event name",{"type":47,"tag":402,"props":4777,"children":4778},{},[4779,4805,4831,4853,4874,4899,4925,4946,4967,4988,5009,5030,5051,5072,5093,5114],{"type":47,"tag":387,"props":4780,"children":4781},{},[4782,4787,4796],{"type":47,"tag":409,"props":4783,"children":4784},{},[4785],{"type":53,"value":4786},"Subscription created",{"type":47,"tag":409,"props":4788,"children":4789},{},[4790],{"type":47,"tag":72,"props":4791,"children":4793},{"className":4792},[],[4794],{"type":53,"value":4795},"customer.subscription.created",{"type":47,"tag":409,"props":4797,"children":4798},{},[4799],{"type":47,"tag":72,"props":4800,"children":4802},{"className":4801},[],[4803],{"type":53,"value":4804},"subscription.created",{"type":47,"tag":387,"props":4806,"children":4807},{},[4808,4813,4822],{"type":47,"tag":409,"props":4809,"children":4810},{},[4811],{"type":53,"value":4812},"Subscription updated",{"type":47,"tag":409,"props":4814,"children":4815},{},[4816],{"type":47,"tag":72,"props":4817,"children":4819},{"className":4818},[],[4820],{"type":53,"value":4821},"customer.subscription.updated",{"type":47,"tag":409,"props":4823,"children":4824},{},[4825],{"type":47,"tag":72,"props":4826,"children":4828},{"className":4827},[],[4829],{"type":53,"value":4830},"subscription.updated",{"type":47,"tag":387,"props":4832,"children":4833},{},[4834,4839,4844],{"type":47,"tag":409,"props":4835,"children":4836},{},[4837],{"type":53,"value":4838},"Subscription active",{"type":47,"tag":409,"props":4840,"children":4841},{},[4842],{"type":53,"value":4843},"(none)",{"type":47,"tag":409,"props":4845,"children":4846},{},[4847],{"type":47,"tag":72,"props":4848,"children":4850},{"className":4849},[],[4851],{"type":53,"value":4852},"subscription.active",{"type":47,"tag":387,"props":4854,"children":4855},{},[4856,4861,4865],{"type":47,"tag":409,"props":4857,"children":4858},{},[4859],{"type":53,"value":4860},"Subscription past due",{"type":47,"tag":409,"props":4862,"children":4863},{},[4864],{"type":53,"value":4843},{"type":47,"tag":409,"props":4866,"children":4867},{},[4868],{"type":47,"tag":72,"props":4869,"children":4871},{"className":4870},[],[4872],{"type":53,"value":4873},"subscription.pastDue",{"type":47,"tag":387,"props":4875,"children":4876},{},[4877,4882,4891],{"type":47,"tag":409,"props":4878,"children":4879},{},[4880],{"type":53,"value":4881},"Subscription item canceled",{"type":47,"tag":409,"props":4883,"children":4884},{},[4885],{"type":47,"tag":72,"props":4886,"children":4888},{"className":4887},[],[4889],{"type":53,"value":4890},"customer.subscription.deleted",{"type":47,"tag":409,"props":4892,"children":4893},{},[4894],{"type":47,"tag":72,"props":4895,"children":4897},{"className":4896},[],[4898],{"type":53,"value":4750},{"type":47,"tag":387,"props":4900,"children":4901},{},[4902,4907,4916],{"type":47,"tag":409,"props":4903,"children":4904},{},[4905],{"type":53,"value":4906},"Subscription item past due",{"type":47,"tag":409,"props":4908,"children":4909},{},[4910],{"type":47,"tag":72,"props":4911,"children":4913},{"className":4912},[],[4914],{"type":53,"value":4915},"invoice.payment_failed",{"type":47,"tag":409,"props":4917,"children":4918},{},[4919],{"type":47,"tag":72,"props":4920,"children":4922},{"className":4921},[],[4923],{"type":53,"value":4924},"subscriptionItem.pastDue",{"type":47,"tag":387,"props":4926,"children":4927},{},[4928,4933,4937],{"type":47,"tag":409,"props":4929,"children":4930},{},[4931],{"type":53,"value":4932},"Subscription item updated",{"type":47,"tag":409,"props":4934,"children":4935},{},[4936],{"type":53,"value":4843},{"type":47,"tag":409,"props":4938,"children":4939},{},[4940],{"type":47,"tag":72,"props":4941,"children":4943},{"className":4942},[],[4944],{"type":53,"value":4945},"subscriptionItem.updated",{"type":47,"tag":387,"props":4947,"children":4948},{},[4949,4954,4958],{"type":47,"tag":409,"props":4950,"children":4951},{},[4952],{"type":53,"value":4953},"Subscription item active",{"type":47,"tag":409,"props":4955,"children":4956},{},[4957],{"type":53,"value":4843},{"type":47,"tag":409,"props":4959,"children":4960},{},[4961],{"type":47,"tag":72,"props":4962,"children":4964},{"className":4963},[],[4965],{"type":53,"value":4966},"subscriptionItem.active",{"type":47,"tag":387,"props":4968,"children":4969},{},[4970,4975,4979],{"type":47,"tag":409,"props":4971,"children":4972},{},[4973],{"type":53,"value":4974},"Subscription item upcoming renewal",{"type":47,"tag":409,"props":4976,"children":4977},{},[4978],{"type":53,"value":4843},{"type":47,"tag":409,"props":4980,"children":4981},{},[4982],{"type":47,"tag":72,"props":4983,"children":4985},{"className":4984},[],[4986],{"type":53,"value":4987},"subscriptionItem.upcoming",{"type":47,"tag":387,"props":4989,"children":4990},{},[4991,4996,5000],{"type":47,"tag":409,"props":4992,"children":4993},{},[4994],{"type":53,"value":4995},"Subscription item ended",{"type":47,"tag":409,"props":4997,"children":4998},{},[4999],{"type":53,"value":4843},{"type":47,"tag":409,"props":5001,"children":5002},{},[5003],{"type":47,"tag":72,"props":5004,"children":5006},{"className":5005},[],[5007],{"type":53,"value":5008},"subscriptionItem.ended",{"type":47,"tag":387,"props":5010,"children":5011},{},[5012,5017,5021],{"type":47,"tag":409,"props":5013,"children":5014},{},[5015],{"type":53,"value":5016},"Subscription item abandoned",{"type":47,"tag":409,"props":5018,"children":5019},{},[5020],{"type":53,"value":4843},{"type":47,"tag":409,"props":5022,"children":5023},{},[5024],{"type":47,"tag":72,"props":5025,"children":5027},{"className":5026},[],[5028],{"type":53,"value":5029},"subscriptionItem.abandoned",{"type":47,"tag":387,"props":5031,"children":5032},{},[5033,5038,5042],{"type":47,"tag":409,"props":5034,"children":5035},{},[5036],{"type":53,"value":5037},"Subscription item expired",{"type":47,"tag":409,"props":5039,"children":5040},{},[5041],{"type":53,"value":4843},{"type":47,"tag":409,"props":5043,"children":5044},{},[5045],{"type":47,"tag":72,"props":5046,"children":5048},{"className":5047},[],[5049],{"type":53,"value":5050},"subscriptionItem.expired",{"type":47,"tag":387,"props":5052,"children":5053},{},[5054,5059,5063],{"type":47,"tag":409,"props":5055,"children":5056},{},[5057],{"type":53,"value":5058},"Subscription item incomplete",{"type":47,"tag":409,"props":5060,"children":5061},{},[5062],{"type":53,"value":4843},{"type":47,"tag":409,"props":5064,"children":5065},{},[5066],{"type":47,"tag":72,"props":5067,"children":5069},{"className":5068},[],[5070],{"type":53,"value":5071},"subscriptionItem.incomplete",{"type":47,"tag":387,"props":5073,"children":5074},{},[5075,5080,5084],{"type":47,"tag":409,"props":5076,"children":5077},{},[5078],{"type":53,"value":5079},"Free trial ending soon",{"type":47,"tag":409,"props":5081,"children":5082},{},[5083],{"type":53,"value":4843},{"type":47,"tag":409,"props":5085,"children":5086},{},[5087],{"type":47,"tag":72,"props":5088,"children":5090},{"className":5089},[],[5091],{"type":53,"value":5092},"subscriptionItem.freeTrialEnding",{"type":47,"tag":387,"props":5094,"children":5095},{},[5096,5101,5105],{"type":47,"tag":409,"props":5097,"children":5098},{},[5099],{"type":53,"value":5100},"Payment attempt created",{"type":47,"tag":409,"props":5102,"children":5103},{},[5104],{"type":53,"value":4843},{"type":47,"tag":409,"props":5106,"children":5107},{},[5108],{"type":47,"tag":72,"props":5109,"children":5111},{"className":5110},[],[5112],{"type":53,"value":5113},"paymentAttempt.created",{"type":47,"tag":387,"props":5115,"children":5116},{},[5117,5122,5126],{"type":47,"tag":409,"props":5118,"children":5119},{},[5120],{"type":53,"value":5121},"Payment attempt updated",{"type":47,"tag":409,"props":5123,"children":5124},{},[5125],{"type":53,"value":4843},{"type":47,"tag":409,"props":5127,"children":5128},{},[5129],{"type":47,"tag":72,"props":5130,"children":5132},{"className":5131},[],[5133],{"type":53,"value":5134},"paymentAttempt.updated",{"type":47,"tag":60,"props":5136,"children":5137},{},[5138,5140,5146],{"type":53,"value":5139},"Always use Clerk's event names, never Stripe's, in ",{"type":47,"tag":72,"props":5141,"children":5143},{"className":5142},[],[5144],{"type":53,"value":5145},"evt.type",{"type":53,"value":5147}," checks.",{"type":47,"tag":56,"props":5149,"children":5150},{},[5151],{"type":47,"tag":60,"props":5152,"children":5153},{},[5154,5159,5161,5167,5169,5175,5176,5182,5184,5190,5192,5198,5200,5206,5208,5214,5216,5221],{"type":47,"tag":64,"props":5155,"children":5156},{},[5157],{"type":53,"value":5158},"Payload shape.",{"type":53,"value":5160}," Clerk billing webhook payloads are nested. The subscribing entity lives under ",{"type":47,"tag":72,"props":5162,"children":5164},{"className":5163},[],[5165],{"type":53,"value":5166},"evt.data.payer",{"type":53,"value":5168}," (fields: ",{"type":47,"tag":72,"props":5170,"children":5172},{"className":5171},[],[5173],{"type":53,"value":5174},"user_id?",{"type":53,"value":79},{"type":47,"tag":72,"props":5177,"children":5179},{"className":5178},[],[5180],{"type":53,"value":5181},"organization_id?",{"type":53,"value":5183},"). The plan info is on each item under ",{"type":47,"tag":72,"props":5185,"children":5187},{"className":5186},[],[5188],{"type":53,"value":5189},"evt.data.items[i].plan.slug",{"type":53,"value":5191},". The subscription id is simply ",{"type":47,"tag":72,"props":5193,"children":5195},{"className":5194},[],[5196],{"type":53,"value":5197},"evt.data.id",{"type":53,"value":5199},". Subscription items do not carry a ",{"type":47,"tag":72,"props":5201,"children":5203},{"className":5202},[],[5204],{"type":53,"value":5205},"subscription_id",{"type":53,"value":5207}," field back-reference, so in ",{"type":47,"tag":72,"props":5209,"children":5211},{"className":5210},[],[5212],{"type":53,"value":5213},"subscriptionItem.*",{"type":53,"value":5215}," handlers you identify the record by the item id (",{"type":47,"tag":72,"props":5217,"children":5219},{"className":5218},[],[5220],{"type":53,"value":5197},{"type":53,"value":5222},") or look up by payer plus plan.",{"type":47,"tag":60,"props":5224,"children":5225},{},[5226,5228,5234],{"type":53,"value":5227},"Minimal handler to anchor the pattern (import from ",{"type":47,"tag":72,"props":5229,"children":5231},{"className":5230},[],[5232],{"type":53,"value":5233},"@clerk\u002Fnextjs\u002Fwebhooks",{"type":53,"value":5235},", verify, branch on Clerk event name):",{"type":47,"tag":515,"props":5237,"children":5239},{"className":1625,"code":5238,"language":1627,"meta":520,"style":520},"import { verifyWebhook } from '@clerk\u002Fnextjs\u002Fwebhooks'\nimport { NextRequest } from 'next\u002Fserver'\nimport { db } from '@\u002Flib\u002Fdb'\n\nexport async function POST(req: NextRequest) {\n    let evt\n    try {\n        evt = await verifyWebhook(req)\n    } catch {\n        return new Response('Verification failed', { status: 400 })\n    }\n\n    if (evt.type === 'subscription.created') {\n        const { id, payer, items, status } = evt.data\n        const entityId = payer.organization_id ?? payer.user_id\n        const plan = items[0]?.plan?.slug\n        await db.subscriptions.upsert({\n            where: { subscriptionId: id },\n            create: { subscriptionId: id, entityId, plan, status },\n            update: { entityId, plan, status },\n        })\n    }\n\n    \u002F\u002F Add more branches per the event catalog above (subscription.updated,\n    \u002F\u002F subscriptionItem.canceled, subscriptionItem.pastDue, etc.)\n\n    return new Response('OK', { status: 200 })\n}\n",[5240],{"type":47,"tag":72,"props":5241,"children":5242},{"__ignoreMap":520},[5243,5279,5315,5352,5359,5404,5417,5429,5461,5478,5541,5548,5555,5605,5670,5717,5769,5807,5841,5897,5938,5951,5959,5967,5976,5985,5993,6055],{"type":47,"tag":526,"props":5244,"children":5245},{"class":528,"line":529},[5246,5250,5254,5259,5263,5267,5271,5275],{"type":47,"tag":526,"props":5247,"children":5248},{"style":1394},[5249],{"type":53,"value":1397},{"type":47,"tag":526,"props":5251,"children":5252},{"style":655},[5253],{"type":53,"value":1402},{"type":47,"tag":526,"props":5255,"children":5256},{"style":825},[5257],{"type":53,"value":5258}," verifyWebhook",{"type":47,"tag":526,"props":5260,"children":5261},{"style":655},[5262],{"type":53,"value":1412},{"type":47,"tag":526,"props":5264,"children":5265},{"style":1394},[5266],{"type":53,"value":1417},{"type":47,"tag":526,"props":5268,"children":5269},{"style":655},[5270],{"type":53,"value":878},{"type":47,"tag":526,"props":5272,"children":5273},{"style":538},[5274],{"type":53,"value":5233},{"type":47,"tag":526,"props":5276,"children":5277},{"style":655},[5278],{"type":53,"value":888},{"type":47,"tag":526,"props":5280,"children":5281},{"class":528,"line":555},[5282,5286,5290,5295,5299,5303,5307,5311],{"type":47,"tag":526,"props":5283,"children":5284},{"style":1394},[5285],{"type":53,"value":1397},{"type":47,"tag":526,"props":5287,"children":5288},{"style":655},[5289],{"type":53,"value":1402},{"type":47,"tag":526,"props":5291,"children":5292},{"style":825},[5293],{"type":53,"value":5294}," NextRequest",{"type":47,"tag":526,"props":5296,"children":5297},{"style":655},[5298],{"type":53,"value":1412},{"type":47,"tag":526,"props":5300,"children":5301},{"style":1394},[5302],{"type":53,"value":1417},{"type":47,"tag":526,"props":5304,"children":5305},{"style":655},[5306],{"type":53,"value":878},{"type":47,"tag":526,"props":5308,"children":5309},{"style":538},[5310],{"type":53,"value":4413},{"type":47,"tag":526,"props":5312,"children":5313},{"style":655},[5314],{"type":53,"value":888},{"type":47,"tag":526,"props":5316,"children":5317},{"class":528,"line":586},[5318,5322,5326,5331,5335,5339,5343,5348],{"type":47,"tag":526,"props":5319,"children":5320},{"style":1394},[5321],{"type":53,"value":1397},{"type":47,"tag":526,"props":5323,"children":5324},{"style":655},[5325],{"type":53,"value":1402},{"type":47,"tag":526,"props":5327,"children":5328},{"style":825},[5329],{"type":53,"value":5330}," db",{"type":47,"tag":526,"props":5332,"children":5333},{"style":655},[5334],{"type":53,"value":1412},{"type":47,"tag":526,"props":5336,"children":5337},{"style":1394},[5338],{"type":53,"value":1417},{"type":47,"tag":526,"props":5340,"children":5341},{"style":655},[5342],{"type":53,"value":878},{"type":47,"tag":526,"props":5344,"children":5345},{"style":538},[5346],{"type":53,"value":5347},"@\u002Flib\u002Fdb",{"type":47,"tag":526,"props":5349,"children":5350},{"style":655},[5351],{"type":53,"value":888},{"type":47,"tag":526,"props":5353,"children":5354},{"class":528,"line":30},[5355],{"type":47,"tag":526,"props":5356,"children":5357},{"emptyLinePlaceholder":1435},[5358],{"type":53,"value":1438},{"type":47,"tag":526,"props":5360,"children":5361},{"class":528,"line":1490},[5362,5366,5370,5374,5379,5383,5388,5392,5396,5400],{"type":47,"tag":526,"props":5363,"children":5364},{"style":1394},[5365],{"type":53,"value":1446},{"type":47,"tag":526,"props":5367,"children":5368},{"style":1454},[5369],{"type":53,"value":1691},{"type":47,"tag":526,"props":5371,"children":5372},{"style":1454},[5373],{"type":53,"value":1457},{"type":47,"tag":526,"props":5375,"children":5376},{"style":1460},[5377],{"type":53,"value":5378}," POST",{"type":47,"tag":526,"props":5380,"children":5381},{"style":655},[5382],{"type":53,"value":1780},{"type":47,"tag":526,"props":5384,"children":5385},{"style":1920},[5386],{"type":53,"value":5387},"req",{"type":47,"tag":526,"props":5389,"children":5390},{"style":655},[5391],{"type":53,"value":1795},{"type":47,"tag":526,"props":5393,"children":5394},{"style":533},[5395],{"type":53,"value":5294},{"type":47,"tag":526,"props":5397,"children":5398},{"style":655},[5399],{"type":53,"value":261},{"type":47,"tag":526,"props":5401,"children":5402},{"style":655},[5403],{"type":53,"value":1473},{"type":47,"tag":526,"props":5405,"children":5406},{"class":528,"line":1509},[5407,5412],{"type":47,"tag":526,"props":5408,"children":5409},{"style":1454},[5410],{"type":53,"value":5411},"    let",{"type":47,"tag":526,"props":5413,"children":5414},{"style":825},[5415],{"type":53,"value":5416}," evt\n",{"type":47,"tag":526,"props":5418,"children":5419},{"class":528,"line":1544},[5420,5425],{"type":47,"tag":526,"props":5421,"children":5422},{"style":1394},[5423],{"type":53,"value":5424},"    try",{"type":47,"tag":526,"props":5426,"children":5427},{"style":655},[5428],{"type":53,"value":1473},{"type":47,"tag":526,"props":5430,"children":5431},{"class":528,"line":1562},[5432,5437,5441,5445,5449,5453,5457],{"type":47,"tag":526,"props":5433,"children":5434},{"style":825},[5435],{"type":53,"value":5436},"        evt",{"type":47,"tag":526,"props":5438,"children":5439},{"style":655},[5440],{"type":53,"value":1734},{"type":47,"tag":526,"props":5442,"children":5443},{"style":1394},[5444],{"type":53,"value":1739},{"type":47,"tag":526,"props":5446,"children":5447},{"style":1460},[5448],{"type":53,"value":5258},{"type":47,"tag":526,"props":5450,"children":5451},{"style":1484},[5452],{"type":53,"value":1780},{"type":47,"tag":526,"props":5454,"children":5455},{"style":825},[5456],{"type":53,"value":5387},{"type":47,"tag":526,"props":5458,"children":5459},{"style":1484},[5460],{"type":53,"value":1818},{"type":47,"tag":526,"props":5462,"children":5463},{"class":528,"line":1579},[5464,5469,5474],{"type":47,"tag":526,"props":5465,"children":5466},{"style":655},[5467],{"type":53,"value":5468},"    }",{"type":47,"tag":526,"props":5470,"children":5471},{"style":1394},[5472],{"type":53,"value":5473}," catch",{"type":47,"tag":526,"props":5475,"children":5476},{"style":655},[5477],{"type":53,"value":1473},{"type":47,"tag":526,"props":5479,"children":5480},{"class":528,"line":1588},[5481,5485,5490,5495,5499,5503,5508,5512,5516,5520,5524,5528,5533,5537],{"type":47,"tag":526,"props":5482,"children":5483},{"style":1394},[5484],{"type":53,"value":3032},{"type":47,"tag":526,"props":5486,"children":5487},{"style":655},[5488],{"type":53,"value":5489}," new",{"type":47,"tag":526,"props":5491,"children":5492},{"style":1460},[5493],{"type":53,"value":5494}," Response",{"type":47,"tag":526,"props":5496,"children":5497},{"style":1484},[5498],{"type":53,"value":1780},{"type":47,"tag":526,"props":5500,"children":5501},{"style":655},[5502],{"type":53,"value":1809},{"type":47,"tag":526,"props":5504,"children":5505},{"style":538},[5506],{"type":53,"value":5507},"Verification failed",{"type":47,"tag":526,"props":5509,"children":5510},{"style":655},[5511],{"type":53,"value":1809},{"type":47,"tag":526,"props":5513,"children":5514},{"style":655},[5515],{"type":53,"value":2151},{"type":47,"tag":526,"props":5517,"children":5518},{"style":655},[5519],{"type":53,"value":1402},{"type":47,"tag":526,"props":5521,"children":5522},{"style":1484},[5523],{"type":53,"value":4617},{"type":47,"tag":526,"props":5525,"children":5526},{"style":655},[5527],{"type":53,"value":1795},{"type":47,"tag":526,"props":5529,"children":5530},{"style":4624},[5531],{"type":53,"value":5532}," 400",{"type":47,"tag":526,"props":5534,"children":5535},{"style":655},[5536],{"type":53,"value":1412},{"type":47,"tag":526,"props":5538,"children":5539},{"style":1484},[5540],{"type":53,"value":1818},{"type":47,"tag":526,"props":5542,"children":5543},{"class":528,"line":1911},[5544],{"type":47,"tag":526,"props":5545,"children":5546},{"style":655},[5547],{"type":53,"value":2783},{"type":47,"tag":526,"props":5549,"children":5550},{"class":528,"line":1945},[5551],{"type":47,"tag":526,"props":5552,"children":5553},{"emptyLinePlaceholder":1435},[5554],{"type":53,"value":1438},{"type":47,"tag":526,"props":5556,"children":5557},{"class":528,"line":1975},[5558,5562,5566,5571,5575,5580,5585,5589,5593,5597,5601],{"type":47,"tag":526,"props":5559,"children":5560},{"style":1394},[5561],{"type":53,"value":2180},{"type":47,"tag":526,"props":5563,"children":5564},{"style":1484},[5565],{"type":53,"value":2185},{"type":47,"tag":526,"props":5567,"children":5568},{"style":825},[5569],{"type":53,"value":5570},"evt",{"type":47,"tag":526,"props":5572,"children":5573},{"style":655},[5574],{"type":53,"value":361},{"type":47,"tag":526,"props":5576,"children":5577},{"style":825},[5578],{"type":53,"value":5579},"type",{"type":47,"tag":526,"props":5581,"children":5582},{"style":655},[5583],{"type":53,"value":5584}," ===",{"type":47,"tag":526,"props":5586,"children":5587},{"style":655},[5588],{"type":53,"value":878},{"type":47,"tag":526,"props":5590,"children":5591},{"style":538},[5592],{"type":53,"value":4804},{"type":47,"tag":526,"props":5594,"children":5595},{"style":655},[5596],{"type":53,"value":1809},{"type":47,"tag":526,"props":5598,"children":5599},{"style":1484},[5600],{"type":53,"value":2200},{"type":47,"tag":526,"props":5602,"children":5603},{"style":655},[5604],{"type":53,"value":2746},{"type":47,"tag":526,"props":5606,"children":5607},{"class":528,"line":1991},[5608,5613,5617,5622,5626,5631,5635,5640,5644,5648,5652,5656,5661,5665],{"type":47,"tag":526,"props":5609,"children":5610},{"style":1454},[5611],{"type":53,"value":5612},"        const",{"type":47,"tag":526,"props":5614,"children":5615},{"style":655},[5616],{"type":53,"value":1402},{"type":47,"tag":526,"props":5618,"children":5619},{"style":825},[5620],{"type":53,"value":5621}," id",{"type":47,"tag":526,"props":5623,"children":5624},{"style":655},[5625],{"type":53,"value":2151},{"type":47,"tag":526,"props":5627,"children":5628},{"style":825},[5629],{"type":53,"value":5630}," payer",{"type":47,"tag":526,"props":5632,"children":5633},{"style":655},[5634],{"type":53,"value":2151},{"type":47,"tag":526,"props":5636,"children":5637},{"style":825},[5638],{"type":53,"value":5639}," items",{"type":47,"tag":526,"props":5641,"children":5642},{"style":655},[5643],{"type":53,"value":2151},{"type":47,"tag":526,"props":5645,"children":5646},{"style":825},[5647],{"type":53,"value":4617},{"type":47,"tag":526,"props":5649,"children":5650},{"style":655},[5651],{"type":53,"value":1412},{"type":47,"tag":526,"props":5653,"children":5654},{"style":655},[5655],{"type":53,"value":1734},{"type":47,"tag":526,"props":5657,"children":5658},{"style":825},[5659],{"type":53,"value":5660}," evt",{"type":47,"tag":526,"props":5662,"children":5663},{"style":655},[5664],{"type":53,"value":361},{"type":47,"tag":526,"props":5666,"children":5667},{"style":825},[5668],{"type":53,"value":5669},"data\n",{"type":47,"tag":526,"props":5671,"children":5672},{"class":528,"line":1999},[5673,5677,5682,5686,5690,5694,5699,5704,5708,5712],{"type":47,"tag":526,"props":5674,"children":5675},{"style":1454},[5676],{"type":53,"value":5612},{"type":47,"tag":526,"props":5678,"children":5679},{"style":825},[5680],{"type":53,"value":5681}," entityId",{"type":47,"tag":526,"props":5683,"children":5684},{"style":655},[5685],{"type":53,"value":1734},{"type":47,"tag":526,"props":5687,"children":5688},{"style":825},[5689],{"type":53,"value":5630},{"type":47,"tag":526,"props":5691,"children":5692},{"style":655},[5693],{"type":53,"value":361},{"type":47,"tag":526,"props":5695,"children":5696},{"style":825},[5697],{"type":53,"value":5698},"organization_id",{"type":47,"tag":526,"props":5700,"children":5701},{"style":655},[5702],{"type":53,"value":5703}," ??",{"type":47,"tag":526,"props":5705,"children":5706},{"style":825},[5707],{"type":53,"value":5630},{"type":47,"tag":526,"props":5709,"children":5710},{"style":655},[5711],{"type":53,"value":361},{"type":47,"tag":526,"props":5713,"children":5714},{"style":825},[5715],{"type":53,"value":5716},"user_id\n",{"type":47,"tag":526,"props":5718,"children":5719},{"class":528,"line":2467},[5720,5724,5728,5732,5736,5741,5746,5751,5755,5760,5764],{"type":47,"tag":526,"props":5721,"children":5722},{"style":1454},[5723],{"type":53,"value":5612},{"type":47,"tag":526,"props":5725,"children":5726},{"style":825},[5727],{"type":53,"value":2715},{"type":47,"tag":526,"props":5729,"children":5730},{"style":655},[5731],{"type":53,"value":1734},{"type":47,"tag":526,"props":5733,"children":5734},{"style":825},[5735],{"type":53,"value":5639},{"type":47,"tag":526,"props":5737,"children":5738},{"style":1484},[5739],{"type":53,"value":5740},"[",{"type":47,"tag":526,"props":5742,"children":5743},{"style":4624},[5744],{"type":53,"value":5745},"0",{"type":47,"tag":526,"props":5747,"children":5748},{"style":1484},[5749],{"type":53,"value":5750},"]",{"type":47,"tag":526,"props":5752,"children":5753},{"style":655},[5754],{"type":53,"value":2241},{"type":47,"tag":526,"props":5756,"children":5757},{"style":825},[5758],{"type":53,"value":5759},"plan",{"type":47,"tag":526,"props":5761,"children":5762},{"style":655},[5763],{"type":53,"value":2241},{"type":47,"tag":526,"props":5765,"children":5766},{"style":825},[5767],{"type":53,"value":5768},"slug\n",{"type":47,"tag":526,"props":5770,"children":5771},{"class":528,"line":2475},[5772,5777,5781,5785,5790,5794,5799,5803],{"type":47,"tag":526,"props":5773,"children":5774},{"style":1394},[5775],{"type":53,"value":5776},"        await",{"type":47,"tag":526,"props":5778,"children":5779},{"style":825},[5780],{"type":53,"value":5330},{"type":47,"tag":526,"props":5782,"children":5783},{"style":655},[5784],{"type":53,"value":361},{"type":47,"tag":526,"props":5786,"children":5787},{"style":825},[5788],{"type":53,"value":5789},"subscriptions",{"type":47,"tag":526,"props":5791,"children":5792},{"style":655},[5793],{"type":53,"value":361},{"type":47,"tag":526,"props":5795,"children":5796},{"style":1460},[5797],{"type":53,"value":5798},"upsert",{"type":47,"tag":526,"props":5800,"children":5801},{"style":1484},[5802],{"type":53,"value":1780},{"type":47,"tag":526,"props":5804,"children":5805},{"style":655},[5806],{"type":53,"value":2746},{"type":47,"tag":526,"props":5808,"children":5809},{"class":528,"line":3804},[5810,5815,5819,5823,5828,5832,5836],{"type":47,"tag":526,"props":5811,"children":5812},{"style":1484},[5813],{"type":53,"value":5814},"            where",{"type":47,"tag":526,"props":5816,"children":5817},{"style":655},[5818],{"type":53,"value":1795},{"type":47,"tag":526,"props":5820,"children":5821},{"style":655},[5822],{"type":53,"value":1402},{"type":47,"tag":526,"props":5824,"children":5825},{"style":1484},[5826],{"type":53,"value":5827}," subscriptionId",{"type":47,"tag":526,"props":5829,"children":5830},{"style":655},[5831],{"type":53,"value":1795},{"type":47,"tag":526,"props":5833,"children":5834},{"style":825},[5835],{"type":53,"value":5621},{"type":47,"tag":526,"props":5837,"children":5838},{"style":655},[5839],{"type":53,"value":5840}," },\n",{"type":47,"tag":526,"props":5842,"children":5843},{"class":528,"line":3812},[5844,5849,5853,5857,5861,5865,5869,5873,5877,5881,5885,5889,5893],{"type":47,"tag":526,"props":5845,"children":5846},{"style":1484},[5847],{"type":53,"value":5848},"            create",{"type":47,"tag":526,"props":5850,"children":5851},{"style":655},[5852],{"type":53,"value":1795},{"type":47,"tag":526,"props":5854,"children":5855},{"style":655},[5856],{"type":53,"value":1402},{"type":47,"tag":526,"props":5858,"children":5859},{"style":1484},[5860],{"type":53,"value":5827},{"type":47,"tag":526,"props":5862,"children":5863},{"style":655},[5864],{"type":53,"value":1795},{"type":47,"tag":526,"props":5866,"children":5867},{"style":825},[5868],{"type":53,"value":5621},{"type":47,"tag":526,"props":5870,"children":5871},{"style":655},[5872],{"type":53,"value":2151},{"type":47,"tag":526,"props":5874,"children":5875},{"style":825},[5876],{"type":53,"value":5681},{"type":47,"tag":526,"props":5878,"children":5879},{"style":655},[5880],{"type":53,"value":2151},{"type":47,"tag":526,"props":5882,"children":5883},{"style":825},[5884],{"type":53,"value":2715},{"type":47,"tag":526,"props":5886,"children":5887},{"style":655},[5888],{"type":53,"value":2151},{"type":47,"tag":526,"props":5890,"children":5891},{"style":825},[5892],{"type":53,"value":4617},{"type":47,"tag":526,"props":5894,"children":5895},{"style":655},[5896],{"type":53,"value":5840},{"type":47,"tag":526,"props":5898,"children":5900},{"class":528,"line":5899},20,[5901,5906,5910,5914,5918,5922,5926,5930,5934],{"type":47,"tag":526,"props":5902,"children":5903},{"style":1484},[5904],{"type":53,"value":5905},"            update",{"type":47,"tag":526,"props":5907,"children":5908},{"style":655},[5909],{"type":53,"value":1795},{"type":47,"tag":526,"props":5911,"children":5912},{"style":655},[5913],{"type":53,"value":1402},{"type":47,"tag":526,"props":5915,"children":5916},{"style":825},[5917],{"type":53,"value":5681},{"type":47,"tag":526,"props":5919,"children":5920},{"style":655},[5921],{"type":53,"value":2151},{"type":47,"tag":526,"props":5923,"children":5924},{"style":825},[5925],{"type":53,"value":2715},{"type":47,"tag":526,"props":5927,"children":5928},{"style":655},[5929],{"type":53,"value":2151},{"type":47,"tag":526,"props":5931,"children":5932},{"style":825},[5933],{"type":53,"value":4617},{"type":47,"tag":526,"props":5935,"children":5936},{"style":655},[5937],{"type":53,"value":5840},{"type":47,"tag":526,"props":5939,"children":5941},{"class":528,"line":5940},21,[5942,5947],{"type":47,"tag":526,"props":5943,"children":5944},{"style":655},[5945],{"type":53,"value":5946},"        }",{"type":47,"tag":526,"props":5948,"children":5949},{"style":1484},[5950],{"type":53,"value":1818},{"type":47,"tag":526,"props":5952,"children":5954},{"class":528,"line":5953},22,[5955],{"type":47,"tag":526,"props":5956,"children":5957},{"style":655},[5958],{"type":53,"value":2783},{"type":47,"tag":526,"props":5960,"children":5962},{"class":528,"line":5961},23,[5963],{"type":47,"tag":526,"props":5964,"children":5965},{"emptyLinePlaceholder":1435},[5966],{"type":53,"value":1438},{"type":47,"tag":526,"props":5968,"children":5970},{"class":528,"line":5969},24,[5971],{"type":47,"tag":526,"props":5972,"children":5973},{"style":549},[5974],{"type":53,"value":5975},"    \u002F\u002F Add more branches per the event catalog above (subscription.updated,\n",{"type":47,"tag":526,"props":5977,"children":5979},{"class":528,"line":5978},25,[5980],{"type":47,"tag":526,"props":5981,"children":5982},{"style":549},[5983],{"type":53,"value":5984},"    \u002F\u002F subscriptionItem.canceled, subscriptionItem.pastDue, etc.)\n",{"type":47,"tag":526,"props":5986,"children":5988},{"class":528,"line":5987},26,[5989],{"type":47,"tag":526,"props":5990,"children":5991},{"emptyLinePlaceholder":1435},[5992],{"type":53,"value":1438},{"type":47,"tag":526,"props":5994,"children":5996},{"class":528,"line":5995},27,[5997,6001,6005,6009,6013,6017,6022,6026,6030,6034,6038,6042,6047,6051],{"type":47,"tag":526,"props":5998,"children":5999},{"style":1394},[6000],{"type":53,"value":1481},{"type":47,"tag":526,"props":6002,"children":6003},{"style":655},[6004],{"type":53,"value":5489},{"type":47,"tag":526,"props":6006,"children":6007},{"style":1460},[6008],{"type":53,"value":5494},{"type":47,"tag":526,"props":6010,"children":6011},{"style":1484},[6012],{"type":53,"value":1780},{"type":47,"tag":526,"props":6014,"children":6015},{"style":655},[6016],{"type":53,"value":1809},{"type":47,"tag":526,"props":6018,"children":6019},{"style":538},[6020],{"type":53,"value":6021},"OK",{"type":47,"tag":526,"props":6023,"children":6024},{"style":655},[6025],{"type":53,"value":1809},{"type":47,"tag":526,"props":6027,"children":6028},{"style":655},[6029],{"type":53,"value":2151},{"type":47,"tag":526,"props":6031,"children":6032},{"style":655},[6033],{"type":53,"value":1402},{"type":47,"tag":526,"props":6035,"children":6036},{"style":1484},[6037],{"type":53,"value":4617},{"type":47,"tag":526,"props":6039,"children":6040},{"style":655},[6041],{"type":53,"value":1795},{"type":47,"tag":526,"props":6043,"children":6044},{"style":4624},[6045],{"type":53,"value":6046}," 200",{"type":47,"tag":526,"props":6048,"children":6049},{"style":655},[6050],{"type":53,"value":1412},{"type":47,"tag":526,"props":6052,"children":6053},{"style":1484},[6054],{"type":53,"value":1818},{"type":47,"tag":526,"props":6056,"children":6058},{"class":528,"line":6057},28,[6059],{"type":47,"tag":526,"props":6060,"children":6061},{"style":655},[6062],{"type":53,"value":1594},{"type":47,"tag":60,"props":6064,"children":6065},{},[6066,6068,6074,6076,6082,6084,6089],{"type":53,"value":6067},"For the full template covering all 15 events, the TS type declarations from ",{"type":47,"tag":72,"props":6069,"children":6071},{"className":6070},[],[6072],{"type":53,"value":6073},"@clerk\u002Fbackend",{"type":53,"value":6075},", the ",{"type":47,"tag":72,"props":6077,"children":6079},{"className":6078},[],[6080],{"type":53,"value":6081},"proxy.ts",{"type":53,"value":6083}," public-route setup, and the subscription status value table, see ",{"type":47,"tag":72,"props":6085,"children":6087},{"className":6086},[],[6088],{"type":53,"value":1051},{"type":53,"value":361},{"type":47,"tag":508,"props":6091,"children":6093},{"id":6092},"_10-upgrade-downgrade-flow",[6094],{"type":53,"value":6095},"10. Upgrade \u002F Downgrade Flow",{"type":47,"tag":60,"props":6097,"children":6098},{},[6099],{"type":53,"value":6100},"Let users manage their subscription from inside the app:",{"type":47,"tag":515,"props":6102,"children":6104},{"className":1382,"code":6103,"language":1384,"meta":520,"style":520},"import { PricingTable } from '@clerk\u002Fnextjs'\nimport { auth } from '@clerk\u002Fnextjs\u002Fserver'\n\nexport default async function BillingPage() {\n    const { has } = await auth()\n    const isPro = has({ plan: 'pro' })\n\n    return (\n        \u003Cdiv>\n            \u003Ch1>Billing\u003C\u002Fh1>\n            {isPro ? (\n                \u003Cdiv>\n                    \u003Cp>You are on the Pro plan\u003C\u002Fp>\n                    \u003CPricingTable \u002F>\n                \u003C\u002Fdiv>\n            ) : (\n                \u003Cdiv>\n                    \u003Cp>Upgrade to access premium features\u003C\u002Fp>\n                    \u003CPricingTable \u002F>\n                \u003C\u002Fdiv>\n            )}\n        \u003C\u002Fdiv>\n    )\n}\n",[6105],{"type":47,"tag":72,"props":6106,"children":6107},{"__ignoreMap":520},[6108,6143,6178,6185,6217,6252,6308,6315,6326,6341,6372,6392,6407,6440,6455,6471,6487,6502,6534,6549,6564,6575,6590,6597],{"type":47,"tag":526,"props":6109,"children":6110},{"class":528,"line":529},[6111,6115,6119,6123,6127,6131,6135,6139],{"type":47,"tag":526,"props":6112,"children":6113},{"style":1394},[6114],{"type":53,"value":1397},{"type":47,"tag":526,"props":6116,"children":6117},{"style":655},[6118],{"type":53,"value":1402},{"type":47,"tag":526,"props":6120,"children":6121},{"style":825},[6122],{"type":53,"value":1407},{"type":47,"tag":526,"props":6124,"children":6125},{"style":655},[6126],{"type":53,"value":1412},{"type":47,"tag":526,"props":6128,"children":6129},{"style":1394},[6130],{"type":53,"value":1417},{"type":47,"tag":526,"props":6132,"children":6133},{"style":655},[6134],{"type":53,"value":878},{"type":47,"tag":526,"props":6136,"children":6137},{"style":538},[6138],{"type":53,"value":153},{"type":47,"tag":526,"props":6140,"children":6141},{"style":655},[6142],{"type":53,"value":888},{"type":47,"tag":526,"props":6144,"children":6145},{"class":528,"line":555},[6146,6150,6154,6158,6162,6166,6170,6174],{"type":47,"tag":526,"props":6147,"children":6148},{"style":1394},[6149],{"type":53,"value":1397},{"type":47,"tag":526,"props":6151,"children":6152},{"style":655},[6153],{"type":53,"value":1402},{"type":47,"tag":526,"props":6155,"children":6156},{"style":825},[6157],{"type":53,"value":1647},{"type":47,"tag":526,"props":6159,"children":6160},{"style":655},[6161],{"type":53,"value":1412},{"type":47,"tag":526,"props":6163,"children":6164},{"style":1394},[6165],{"type":53,"value":1417},{"type":47,"tag":526,"props":6167,"children":6168},{"style":655},[6169],{"type":53,"value":878},{"type":47,"tag":526,"props":6171,"children":6172},{"style":538},[6173],{"type":53,"value":1664},{"type":47,"tag":526,"props":6175,"children":6176},{"style":655},[6177],{"type":53,"value":888},{"type":47,"tag":526,"props":6179,"children":6180},{"class":528,"line":586},[6181],{"type":47,"tag":526,"props":6182,"children":6183},{"emptyLinePlaceholder":1435},[6184],{"type":53,"value":1438},{"type":47,"tag":526,"props":6186,"children":6187},{"class":528,"line":30},[6188,6192,6196,6200,6204,6209,6213],{"type":47,"tag":526,"props":6189,"children":6190},{"style":1394},[6191],{"type":53,"value":1446},{"type":47,"tag":526,"props":6193,"children":6194},{"style":1394},[6195],{"type":53,"value":1451},{"type":47,"tag":526,"props":6197,"children":6198},{"style":1454},[6199],{"type":53,"value":1691},{"type":47,"tag":526,"props":6201,"children":6202},{"style":1454},[6203],{"type":53,"value":1457},{"type":47,"tag":526,"props":6205,"children":6206},{"style":1460},[6207],{"type":53,"value":6208}," BillingPage",{"type":47,"tag":526,"props":6210,"children":6211},{"style":655},[6212],{"type":53,"value":1468},{"type":47,"tag":526,"props":6214,"children":6215},{"style":655},[6216],{"type":53,"value":1473},{"type":47,"tag":526,"props":6218,"children":6219},{"class":528,"line":1490},[6220,6224,6228,6232,6236,6240,6244,6248],{"type":47,"tag":526,"props":6221,"children":6222},{"style":1454},[6223],{"type":53,"value":1716},{"type":47,"tag":526,"props":6225,"children":6226},{"style":655},[6227],{"type":53,"value":1402},{"type":47,"tag":526,"props":6229,"children":6230},{"style":825},[6231],{"type":53,"value":1725},{"type":47,"tag":526,"props":6233,"children":6234},{"style":655},[6235],{"type":53,"value":1412},{"type":47,"tag":526,"props":6237,"children":6238},{"style":655},[6239],{"type":53,"value":1734},{"type":47,"tag":526,"props":6241,"children":6242},{"style":1394},[6243],{"type":53,"value":1739},{"type":47,"tag":526,"props":6245,"children":6246},{"style":1460},[6247],{"type":53,"value":1647},{"type":47,"tag":526,"props":6249,"children":6250},{"style":1484},[6251],{"type":53,"value":1748},{"type":47,"tag":526,"props":6253,"children":6254},{"class":528,"line":1509},[6255,6259,6264,6268,6272,6276,6280,6284,6288,6292,6296,6300,6304],{"type":47,"tag":526,"props":6256,"children":6257},{"style":1454},[6258],{"type":53,"value":1716},{"type":47,"tag":526,"props":6260,"children":6261},{"style":825},[6262],{"type":53,"value":6263}," isPro",{"type":47,"tag":526,"props":6265,"children":6266},{"style":655},[6267],{"type":53,"value":1734},{"type":47,"tag":526,"props":6269,"children":6270},{"style":1460},[6271],{"type":53,"value":1725},{"type":47,"tag":526,"props":6273,"children":6274},{"style":1484},[6275],{"type":53,"value":1780},{"type":47,"tag":526,"props":6277,"children":6278},{"style":655},[6279],{"type":53,"value":1785},{"type":47,"tag":526,"props":6281,"children":6282},{"style":1484},[6283],{"type":53,"value":2715},{"type":47,"tag":526,"props":6285,"children":6286},{"style":655},[6287],{"type":53,"value":1795},{"type":47,"tag":526,"props":6289,"children":6290},{"style":655},[6291],{"type":53,"value":878},{"type":47,"tag":526,"props":6293,"children":6294},{"style":538},[6295],{"type":53,"value":2728},{"type":47,"tag":526,"props":6297,"children":6298},{"style":655},[6299],{"type":53,"value":1809},{"type":47,"tag":526,"props":6301,"children":6302},{"style":655},[6303],{"type":53,"value":1412},{"type":47,"tag":526,"props":6305,"children":6306},{"style":1484},[6307],{"type":53,"value":1818},{"type":47,"tag":526,"props":6309,"children":6310},{"class":528,"line":1544},[6311],{"type":47,"tag":526,"props":6312,"children":6313},{"emptyLinePlaceholder":1435},[6314],{"type":53,"value":1438},{"type":47,"tag":526,"props":6316,"children":6317},{"class":528,"line":1562},[6318,6322],{"type":47,"tag":526,"props":6319,"children":6320},{"style":1394},[6321],{"type":53,"value":1481},{"type":47,"tag":526,"props":6323,"children":6324},{"style":1484},[6325],{"type":53,"value":1487},{"type":47,"tag":526,"props":6327,"children":6328},{"class":528,"line":1579},[6329,6333,6337],{"type":47,"tag":526,"props":6330,"children":6331},{"style":655},[6332],{"type":53,"value":1496},{"type":47,"tag":526,"props":6334,"children":6335},{"style":1484},[6336],{"type":53,"value":1904},{"type":47,"tag":526,"props":6338,"children":6339},{"style":655},[6340],{"type":53,"value":1506},{"type":47,"tag":526,"props":6342,"children":6343},{"class":528,"line":1588},[6344,6348,6352,6356,6360,6364,6368],{"type":47,"tag":526,"props":6345,"children":6346},{"style":655},[6347],{"type":53,"value":1515},{"type":47,"tag":526,"props":6349,"children":6350},{"style":1484},[6351],{"type":53,"value":48},{"type":47,"tag":526,"props":6353,"children":6354},{"style":655},[6355],{"type":53,"value":833},{"type":47,"tag":526,"props":6357,"children":6358},{"style":825},[6359],{"type":53,"value":54},{"type":47,"tag":526,"props":6361,"children":6362},{"style":655},[6363],{"type":53,"value":1533},{"type":47,"tag":526,"props":6365,"children":6366},{"style":1484},[6367],{"type":53,"value":48},{"type":47,"tag":526,"props":6369,"children":6370},{"style":655},[6371],{"type":53,"value":1506},{"type":47,"tag":526,"props":6373,"children":6374},{"class":528,"line":1911},[6375,6379,6384,6388],{"type":47,"tag":526,"props":6376,"children":6377},{"style":655},[6378],{"type":53,"value":1917},{"type":47,"tag":526,"props":6380,"children":6381},{"style":825},[6382],{"type":53,"value":6383},"isPro ",{"type":47,"tag":526,"props":6385,"children":6386},{"style":655},[6387],{"type":53,"value":2419},{"type":47,"tag":526,"props":6389,"children":6390},{"style":825},[6391],{"type":53,"value":1487},{"type":47,"tag":526,"props":6393,"children":6394},{"class":528,"line":1945},[6395,6399,6403],{"type":47,"tag":526,"props":6396,"children":6397},{"style":655},[6398],{"type":53,"value":4191},{"type":47,"tag":526,"props":6400,"children":6401},{"style":1484},[6402],{"type":53,"value":1904},{"type":47,"tag":526,"props":6404,"children":6405},{"style":655},[6406],{"type":53,"value":1506},{"type":47,"tag":526,"props":6408,"children":6409},{"class":528,"line":1975},[6410,6415,6419,6423,6428,6432,6436],{"type":47,"tag":526,"props":6411,"children":6412},{"style":655},[6413],{"type":53,"value":6414},"                    \u003C",{"type":47,"tag":526,"props":6416,"children":6417},{"style":1484},[6418],{"type":53,"value":60},{"type":47,"tag":526,"props":6420,"children":6421},{"style":655},[6422],{"type":53,"value":833},{"type":47,"tag":526,"props":6424,"children":6425},{"style":825},[6426],{"type":53,"value":6427},"You are on the Pro plan",{"type":47,"tag":526,"props":6429,"children":6430},{"style":655},[6431],{"type":53,"value":1533},{"type":47,"tag":526,"props":6433,"children":6434},{"style":1484},[6435],{"type":53,"value":60},{"type":47,"tag":526,"props":6437,"children":6438},{"style":655},[6439],{"type":53,"value":1506},{"type":47,"tag":526,"props":6441,"children":6442},{"class":528,"line":1991},[6443,6447,6451],{"type":47,"tag":526,"props":6444,"children":6445},{"style":655},[6446],{"type":53,"value":6414},{"type":47,"tag":526,"props":6448,"children":6449},{"style":533},[6450],{"type":53,"value":1554},{"type":47,"tag":526,"props":6452,"children":6453},{"style":655},[6454],{"type":53,"value":1559},{"type":47,"tag":526,"props":6456,"children":6457},{"class":528,"line":1999},[6458,6463,6467],{"type":47,"tag":526,"props":6459,"children":6460},{"style":655},[6461],{"type":53,"value":6462},"                \u003C\u002F",{"type":47,"tag":526,"props":6464,"children":6465},{"style":1484},[6466],{"type":53,"value":1904},{"type":47,"tag":526,"props":6468,"children":6469},{"style":655},[6470],{"type":53,"value":1506},{"type":47,"tag":526,"props":6472,"children":6473},{"class":528,"line":2467},[6474,6479,6483],{"type":47,"tag":526,"props":6475,"children":6476},{"style":825},[6477],{"type":53,"value":6478},"            ) ",{"type":47,"tag":526,"props":6480,"children":6481},{"style":655},[6482],{"type":53,"value":1795},{"type":47,"tag":526,"props":6484,"children":6485},{"style":825},[6486],{"type":53,"value":1487},{"type":47,"tag":526,"props":6488,"children":6489},{"class":528,"line":2475},[6490,6494,6498],{"type":47,"tag":526,"props":6491,"children":6492},{"style":655},[6493],{"type":53,"value":4191},{"type":47,"tag":526,"props":6495,"children":6496},{"style":1484},[6497],{"type":53,"value":1904},{"type":47,"tag":526,"props":6499,"children":6500},{"style":655},[6501],{"type":53,"value":1506},{"type":47,"tag":526,"props":6503,"children":6504},{"class":528,"line":3804},[6505,6509,6513,6517,6522,6526,6530],{"type":47,"tag":526,"props":6506,"children":6507},{"style":655},[6508],{"type":53,"value":6414},{"type":47,"tag":526,"props":6510,"children":6511},{"style":1484},[6512],{"type":53,"value":60},{"type":47,"tag":526,"props":6514,"children":6515},{"style":655},[6516],{"type":53,"value":833},{"type":47,"tag":526,"props":6518,"children":6519},{"style":825},[6520],{"type":53,"value":6521},"Upgrade to access premium features",{"type":47,"tag":526,"props":6523,"children":6524},{"style":655},[6525],{"type":53,"value":1533},{"type":47,"tag":526,"props":6527,"children":6528},{"style":1484},[6529],{"type":53,"value":60},{"type":47,"tag":526,"props":6531,"children":6532},{"style":655},[6533],{"type":53,"value":1506},{"type":47,"tag":526,"props":6535,"children":6536},{"class":528,"line":3812},[6537,6541,6545],{"type":47,"tag":526,"props":6538,"children":6539},{"style":655},[6540],{"type":53,"value":6414},{"type":47,"tag":526,"props":6542,"children":6543},{"style":533},[6544],{"type":53,"value":1554},{"type":47,"tag":526,"props":6546,"children":6547},{"style":655},[6548],{"type":53,"value":1559},{"type":47,"tag":526,"props":6550,"children":6551},{"class":528,"line":5899},[6552,6556,6560],{"type":47,"tag":526,"props":6553,"children":6554},{"style":655},[6555],{"type":53,"value":6462},{"type":47,"tag":526,"props":6557,"children":6558},{"style":1484},[6559],{"type":53,"value":1904},{"type":47,"tag":526,"props":6561,"children":6562},{"style":655},[6563],{"type":53,"value":1506},{"type":47,"tag":526,"props":6565,"children":6566},{"class":528,"line":5940},[6567,6571],{"type":47,"tag":526,"props":6568,"children":6569},{"style":825},[6570],{"type":53,"value":4263},{"type":47,"tag":526,"props":6572,"children":6573},{"style":655},[6574],{"type":53,"value":1594},{"type":47,"tag":526,"props":6576,"children":6577},{"class":528,"line":5953},[6578,6582,6586],{"type":47,"tag":526,"props":6579,"children":6580},{"style":655},[6581],{"type":53,"value":1568},{"type":47,"tag":526,"props":6583,"children":6584},{"style":1484},[6585],{"type":53,"value":1904},{"type":47,"tag":526,"props":6587,"children":6588},{"style":655},[6589],{"type":53,"value":1506},{"type":47,"tag":526,"props":6591,"children":6592},{"class":528,"line":5961},[6593],{"type":47,"tag":526,"props":6594,"children":6595},{"style":1484},[6596],{"type":53,"value":1585},{"type":47,"tag":526,"props":6598,"children":6599},{"class":528,"line":5969},[6600],{"type":47,"tag":526,"props":6601,"children":6602},{"style":655},[6603],{"type":53,"value":1594},{"type":47,"tag":60,"props":6605,"children":6606},{},[6607,6612],{"type":47,"tag":72,"props":6608,"children":6610},{"className":6609},[],[6611],{"type":53,"value":77},{"type":53,"value":6613}," renders differently for subscribed users, it shows the current plan and allows upgrades or cancellations, all through Clerk's in-app checkout drawer.",{"type":47,"tag":172,"props":6615,"children":6617},{"id":6616},"plan-and-feature-naming",[6618],{"type":53,"value":6619},"Plan and Feature Naming",{"type":47,"tag":60,"props":6621,"children":6622},{},[6623],{"type":53,"value":6624},"Plan slugs and feature slugs are defined in Clerk Dashboard → Billing. Common conventions:",{"type":47,"tag":379,"props":6626,"children":6627},{},[6628,6649],{"type":47,"tag":383,"props":6629,"children":6630},{},[6631],{"type":47,"tag":387,"props":6632,"children":6633},{},[6634,6639,6644],{"type":47,"tag":391,"props":6635,"children":6636},{},[6637],{"type":53,"value":6638},"Tier",{"type":47,"tag":391,"props":6640,"children":6641},{},[6642],{"type":53,"value":6643},"Plan Slug",{"type":47,"tag":391,"props":6645,"children":6646},{},[6647],{"type":53,"value":6648},"Example Features",{"type":47,"tag":402,"props":6650,"children":6651},{},[6652,6670,6701,6738],{"type":47,"tag":387,"props":6653,"children":6654},{},[6655,6660,6665],{"type":47,"tag":409,"props":6656,"children":6657},{},[6658],{"type":53,"value":6659},"Free",{"type":47,"tag":409,"props":6661,"children":6662},{},[6663],{"type":53,"value":6664},"(no plan check needed)",{"type":47,"tag":409,"props":6666,"children":6667},{},[6668],{"type":53,"value":6669},"basic features",{"type":47,"tag":387,"props":6671,"children":6672},{},[6673,6678,6686],{"type":47,"tag":409,"props":6674,"children":6675},{},[6676],{"type":53,"value":6677},"Starter",{"type":47,"tag":409,"props":6679,"children":6680},{},[6681],{"type":47,"tag":72,"props":6682,"children":6684},{"className":6683},[],[6685],{"type":53,"value":3527},{"type":47,"tag":409,"props":6687,"children":6688},{},[6689,6694,6695],{"type":47,"tag":72,"props":6690,"children":6692},{"className":6691},[],[6693],{"type":53,"value":1804},{"type":53,"value":79},{"type":47,"tag":72,"props":6696,"children":6698},{"className":6697},[],[6699],{"type":53,"value":6700},"api_access",{"type":47,"tag":387,"props":6702,"children":6703},{},[6704,6709,6717],{"type":47,"tag":409,"props":6705,"children":6706},{},[6707],{"type":53,"value":6708},"Pro",{"type":47,"tag":409,"props":6710,"children":6711},{},[6712],{"type":47,"tag":72,"props":6713,"children":6715},{"className":6714},[],[6716],{"type":53,"value":2728},{"type":47,"tag":409,"props":6718,"children":6719},{},[6720,6725,6726,6731,6732],{"type":47,"tag":72,"props":6721,"children":6723},{"className":6722},[],[6724],{"type":53,"value":1804},{"type":53,"value":79},{"type":47,"tag":72,"props":6727,"children":6729},{"className":6728},[],[6730],{"type":53,"value":1446},{"type":53,"value":79},{"type":47,"tag":72,"props":6733,"children":6735},{"className":6734},[],[6736],{"type":53,"value":6737},"team",{"type":47,"tag":387,"props":6739,"children":6740},{},[6741,6746,6755],{"type":47,"tag":409,"props":6742,"children":6743},{},[6744],{"type":53,"value":6745},"Enterprise",{"type":47,"tag":409,"props":6747,"children":6748},{},[6749],{"type":47,"tag":72,"props":6750,"children":6752},{"className":6751},[],[6753],{"type":53,"value":6754},"enterprise",{"type":47,"tag":409,"props":6756,"children":6757},{},[6758,6760,6766,6767],{"type":53,"value":6759},"all features + ",{"type":47,"tag":72,"props":6761,"children":6763},{"className":6762},[],[6764],{"type":53,"value":6765},"sso",{"type":53,"value":79},{"type":47,"tag":72,"props":6768,"children":6770},{"className":6769},[],[6771],{"type":53,"value":6772},"audit_logs",{"type":47,"tag":60,"props":6774,"children":6775},{},[6776],{"type":53,"value":6777},"Use lowercase slugs matching what you define in the dashboard.",{"type":47,"tag":172,"props":6779,"children":6781},{"id":6780},"b2b-vs-b2c-billing",[6782],{"type":53,"value":6783},"B2B vs B2C Billing",{"type":47,"tag":379,"props":6785,"children":6786},{},[6787,6807],{"type":47,"tag":383,"props":6788,"children":6789},{},[6790],{"type":47,"tag":387,"props":6791,"children":6792},{},[6793,6797,6802],{"type":47,"tag":391,"props":6794,"children":6795},{},[6796],{"type":53,"value":1251},{"type":47,"tag":391,"props":6798,"children":6799},{},[6800],{"type":53,"value":6801},"Who subscribes",{"type":47,"tag":391,"props":6803,"children":6804},{},[6805],{"type":53,"value":6806},"Plan check",{"type":47,"tag":402,"props":6808,"children":6809},{},[6810,6833,6856],{"type":47,"tag":387,"props":6811,"children":6812},{},[6813,6818,6823],{"type":47,"tag":409,"props":6814,"children":6815},{},[6816],{"type":53,"value":6817},"B2C SaaS",{"type":47,"tag":409,"props":6819,"children":6820},{},[6821],{"type":53,"value":6822},"Individual user",{"type":47,"tag":409,"props":6824,"children":6825},{},[6826,6831],{"type":47,"tag":72,"props":6827,"children":6829},{"className":6828},[],[6830],{"type":53,"value":1309},{"type":53,"value":6832}," on user session",{"type":47,"tag":387,"props":6834,"children":6835},{},[6836,6841,6846],{"type":47,"tag":409,"props":6837,"children":6838},{},[6839],{"type":53,"value":6840},"B2B SaaS",{"type":47,"tag":409,"props":6842,"children":6843},{},[6844],{"type":53,"value":6845},"Organization",{"type":47,"tag":409,"props":6847,"children":6848},{},[6849,6854],{"type":47,"tag":72,"props":6850,"children":6852},{"className":6851},[],[6853],{"type":53,"value":1326},{"type":53,"value":6855}," on org session",{"type":47,"tag":387,"props":6857,"children":6858},{},[6859,6864,6868],{"type":47,"tag":409,"props":6860,"children":6861},{},[6862],{"type":53,"value":6863},"Seat-limited B2B",{"type":47,"tag":409,"props":6865,"children":6866},{},[6867],{"type":53,"value":6845},{"type":47,"tag":409,"props":6869,"children":6870},{},[6871],{"type":53,"value":6872},"Plan has a seat cap; pricing is per-plan, not per-member, tier your plans for bigger orgs",{"type":47,"tag":60,"props":6874,"children":6875},{},[6876,6878,6884],{"type":53,"value":6877},"For B2B, ensure the user has an active org session. The ",{"type":47,"tag":72,"props":6879,"children":6881},{"className":6880},[],[6882],{"type":53,"value":6883},"has()",{"type":53,"value":6885}," check evaluates the active entity (user or org).",{"type":47,"tag":172,"props":6887,"children":6889},{"id":6888},"checkout-flows",[6890],{"type":53,"value":6891},"Checkout Flows",{"type":47,"tag":60,"props":6893,"children":6894},{},[6895,6897,6902,6903,6908,6910,6915],{"type":53,"value":6896},"Clerk renders its own checkout drawer automatically through ",{"type":47,"tag":72,"props":6898,"children":6900},{"className":6899},[],[6901],{"type":53,"value":77},{"type":53,"value":155},{"type":47,"tag":72,"props":6904,"children":6906},{"className":6905},[],[6907],{"type":53,"value":85},{"type":53,"value":6909},". Plans and pricing live in Clerk. To trigger checkout from a server action, redirect to a page that renders ",{"type":47,"tag":72,"props":6911,"children":6913},{"className":6912},[],[6914],{"type":53,"value":77},{"type":53,"value":1795},{"type":47,"tag":515,"props":6917,"children":6919},{"className":1625,"code":6918,"language":1627,"meta":520,"style":520},"'use server'\nimport { redirect } from 'next\u002Fnavigation'\n\nexport async function upgradeAction() {\n    redirect('\u002Fpricing')\n}\n",[6920],{"type":47,"tag":72,"props":6921,"children":6922},{"__ignoreMap":520},[6923,6939,6974,6981,7009,7037],{"type":47,"tag":526,"props":6924,"children":6925},{"class":528,"line":529},[6926,6930,6935],{"type":47,"tag":526,"props":6927,"children":6928},{"style":655},[6929],{"type":53,"value":1809},{"type":47,"tag":526,"props":6931,"children":6932},{"style":538},[6933],{"type":53,"value":6934},"use server",{"type":47,"tag":526,"props":6936,"children":6937},{"style":655},[6938],{"type":53,"value":888},{"type":47,"tag":526,"props":6940,"children":6941},{"class":528,"line":555},[6942,6946,6950,6954,6958,6962,6966,6970],{"type":47,"tag":526,"props":6943,"children":6944},{"style":1394},[6945],{"type":53,"value":1397},{"type":47,"tag":526,"props":6947,"children":6948},{"style":655},[6949],{"type":53,"value":1402},{"type":47,"tag":526,"props":6951,"children":6952},{"style":825},[6953],{"type":53,"value":2580},{"type":47,"tag":526,"props":6955,"children":6956},{"style":655},[6957],{"type":53,"value":1412},{"type":47,"tag":526,"props":6959,"children":6960},{"style":1394},[6961],{"type":53,"value":1417},{"type":47,"tag":526,"props":6963,"children":6964},{"style":655},[6965],{"type":53,"value":878},{"type":47,"tag":526,"props":6967,"children":6968},{"style":538},[6969],{"type":53,"value":2597},{"type":47,"tag":526,"props":6971,"children":6972},{"style":655},[6973],{"type":53,"value":888},{"type":47,"tag":526,"props":6975,"children":6976},{"class":528,"line":586},[6977],{"type":47,"tag":526,"props":6978,"children":6979},{"emptyLinePlaceholder":1435},[6980],{"type":53,"value":1438},{"type":47,"tag":526,"props":6982,"children":6983},{"class":528,"line":30},[6984,6988,6992,6996,7001,7005],{"type":47,"tag":526,"props":6985,"children":6986},{"style":1394},[6987],{"type":53,"value":1446},{"type":47,"tag":526,"props":6989,"children":6990},{"style":1454},[6991],{"type":53,"value":1691},{"type":47,"tag":526,"props":6993,"children":6994},{"style":1454},[6995],{"type":53,"value":1457},{"type":47,"tag":526,"props":6997,"children":6998},{"style":1460},[6999],{"type":53,"value":7000}," upgradeAction",{"type":47,"tag":526,"props":7002,"children":7003},{"style":655},[7004],{"type":53,"value":1468},{"type":47,"tag":526,"props":7006,"children":7007},{"style":655},[7008],{"type":53,"value":1473},{"type":47,"tag":526,"props":7010,"children":7011},{"class":528,"line":1490},[7012,7017,7021,7025,7029,7033],{"type":47,"tag":526,"props":7013,"children":7014},{"style":1460},[7015],{"type":53,"value":7016},"    redirect",{"type":47,"tag":526,"props":7018,"children":7019},{"style":1484},[7020],{"type":53,"value":1780},{"type":47,"tag":526,"props":7022,"children":7023},{"style":655},[7024],{"type":53,"value":1809},{"type":47,"tag":526,"props":7026,"children":7027},{"style":538},[7028],{"type":53,"value":2767},{"type":47,"tag":526,"props":7030,"children":7031},{"style":655},[7032],{"type":53,"value":1809},{"type":47,"tag":526,"props":7034,"children":7035},{"style":1484},[7036],{"type":53,"value":1818},{"type":47,"tag":526,"props":7038,"children":7039},{"class":528,"line":1509},[7040],{"type":47,"tag":526,"props":7041,"children":7042},{"style":655},[7043],{"type":53,"value":1594},{"type":47,"tag":172,"props":7045,"children":7047},{"id":7046},"error-signatures-diagnose-fast",[7048],{"type":53,"value":7049},"Error Signatures (diagnose fast)",{"type":47,"tag":60,"props":7051,"children":7052},{},[7053],{"type":53,"value":7054},"When you see any of these errors or symptoms, the fix is almost always a Dashboard toggle, not a code change. Do not start editing components.",{"type":47,"tag":379,"props":7056,"children":7057},{},[7058,7079],{"type":47,"tag":383,"props":7059,"children":7060},{},[7061],{"type":47,"tag":387,"props":7062,"children":7063},{},[7064,7069,7074],{"type":47,"tag":391,"props":7065,"children":7066},{},[7067],{"type":53,"value":7068},"Error \u002F symptom",{"type":47,"tag":391,"props":7070,"children":7071},{},[7072],{"type":53,"value":7073},"Root cause",{"type":47,"tag":391,"props":7075,"children":7076},{},[7077],{"type":53,"value":7078},"Fix",{"type":47,"tag":402,"props":7080,"children":7081},{},[7082,7127,7157,7188,7206,7243,7273,7303],{"type":47,"tag":387,"props":7083,"children":7084},{},[7085,7103,7108],{"type":47,"tag":409,"props":7086,"children":7087},{},[7088,7094,7096,7101],{"type":47,"tag":72,"props":7089,"children":7091},{"className":7090},[],[7092],{"type":53,"value":7093},"Clerk: 🔒 The \u003CPricingTable\u002F> component cannot be rendered when billing is disabled.",{"type":53,"value":7095}," (code: ",{"type":47,"tag":72,"props":7097,"children":7099},{"className":7098},[],[7100],{"type":53,"value":212},{"type":53,"value":7102},", dev only)",{"type":47,"tag":409,"props":7104,"children":7105},{},[7106],{"type":53,"value":7107},"Billing is not enabled for this instance",{"type":47,"tag":409,"props":7109,"children":7110},{},[7111,7113,7119,7121,7126],{"type":53,"value":7112},"Enable Billing at ",{"type":47,"tag":104,"props":7114,"children":7116},{"href":106,"rel":7115},[108],[7117],{"type":53,"value":7118},"dashboard.clerk.com → Billing → Settings",{"type":53,"value":7120},", or run ",{"type":47,"tag":72,"props":7122,"children":7124},{"className":7123},[],[7125],{"type":53,"value":119},{"type":53,"value":361},{"type":47,"tag":387,"props":7128,"children":7129},{},[7130,7140,7145],{"type":47,"tag":409,"props":7131,"children":7132},{},[7133,7138],{"type":47,"tag":72,"props":7134,"children":7136},{"className":7135},[],[7137],{"type":53,"value":77},{"type":53,"value":7139}," renders empty",{"type":47,"tag":409,"props":7141,"children":7142},{},[7143],{"type":53,"value":7144},"No plans, OR plan in the wrong tab (User vs Organization), OR Billing not enabled",{"type":47,"tag":409,"props":7146,"children":7147},{},[7148,7150,7155],{"type":53,"value":7149},"Create plan in matching tab; pass ",{"type":47,"tag":72,"props":7151,"children":7153},{"className":7152},[],[7154],{"type":53,"value":328},{"type":53,"value":7156}," for B2B; check Billing Settings",{"type":47,"tag":387,"props":7158,"children":7159},{},[7160,7165,7178],{"type":47,"tag":409,"props":7161,"children":7162},{},[7163],{"type":53,"value":7164},"Users can't subscribe to a personal plan on a B2C + B2B app",{"type":47,"tag":409,"props":7166,"children":7167},{},[7168,7170,7176],{"type":53,"value":7169},"Membership required mode (default since 2025-08-22) disables personal accounts, signed-in users are forced into ",{"type":47,"tag":72,"props":7171,"children":7173},{"className":7172},[],[7174],{"type":53,"value":7175},"choose-organization",{"type":53,"value":7177}," and never land on a personal-subscription state",{"type":47,"tag":409,"props":7179,"children":7180},{},[7181,7183],{"type":53,"value":7182},"If you need personal + org subscriptions coexisting: Dashboard → Organizations settings → ",{"type":47,"tag":7184,"props":7185,"children":7186},"em",{},[7187],{"type":53,"value":1018},{"type":47,"tag":387,"props":7189,"children":7190},{},[7191,7196,7201],{"type":47,"tag":409,"props":7192,"children":7193},{},[7194],{"type":53,"value":7195},"Can't find a Features page",{"type":47,"tag":409,"props":7197,"children":7198},{},[7199],{"type":53,"value":7200},"Features are per-plan, not global",{"type":47,"tag":409,"props":7202,"children":7203},{},[7204],{"type":53,"value":7205},"Dashboard → Billing → Plans → click plan → Features",{"type":47,"tag":387,"props":7207,"children":7208},{},[7209,7227,7232],{"type":47,"tag":409,"props":7210,"children":7211},{},[7212,7217,7219,7225],{"type":47,"tag":72,"props":7213,"children":7215},{"className":7214},[],[7216],{"type":53,"value":1309},{"type":53,"value":7218}," always returns ",{"type":47,"tag":72,"props":7220,"children":7222},{"className":7221},[],[7223],{"type":53,"value":7224},"false",{"type":53,"value":7226}," after a successful checkout",{"type":47,"tag":409,"props":7228,"children":7229},{},[7230],{"type":53,"value":7231},"Session token hasn't been refreshed to include the new plan",{"type":47,"tag":409,"props":7233,"children":7234},{},[7235,7241],{"type":47,"tag":72,"props":7236,"children":7238},{"className":7237},[],[7239],{"type":53,"value":7240},"await clerk.session?.reload()",{"type":53,"value":7242}," or navigate to force a new session",{"type":47,"tag":387,"props":7244,"children":7245},{},[7246,7263,7268],{"type":47,"tag":409,"props":7247,"children":7248},{},[7249,7254,7256,7261],{"type":47,"tag":72,"props":7250,"children":7252},{"className":7251},[],[7253],{"type":53,"value":1309},{"type":53,"value":7255}," returns ",{"type":47,"tag":72,"props":7257,"children":7259},{"className":7258},[],[7260],{"type":53,"value":7224},{"type":53,"value":7262}," before any subscribe attempt",{"type":47,"tag":409,"props":7264,"children":7265},{},[7266],{"type":53,"value":7267},"Plan slug mismatch (case-sensitive), OR Billing not enabled, OR payment gateway not connected in production",{"type":47,"tag":409,"props":7269,"children":7270},{},[7271],{"type":53,"value":7272},"Verify slug in Dashboard → Billing → Plans; confirm Billing → Settings shows enabled + connected gateway",{"type":47,"tag":387,"props":7274,"children":7275},{},[7276,7293,7298],{"type":47,"tag":409,"props":7277,"children":7278},{},[7279,7285,7286,7291],{"type":47,"tag":72,"props":7280,"children":7282},{"className":7281},[],[7283],{"type":53,"value":7284},"has({ permission: 'org:x:y' })",{"type":53,"value":7255},{"type":47,"tag":72,"props":7287,"children":7289},{"className":7288},[],[7290],{"type":53,"value":7224},{"type":53,"value":7292}," for a user who has the role",{"type":47,"tag":409,"props":7294,"children":7295},{},[7296],{"type":53,"value":7297},"The Feature tied to that permission is not included in the organization's active Plan",{"type":47,"tag":409,"props":7299,"children":7300},{},[7301],{"type":53,"value":7302},"Add the Feature to the Plan in Dashboard → Billing → Plans → Features",{"type":47,"tag":387,"props":7304,"children":7305},{},[7306,7311,7322],{"type":47,"tag":409,"props":7307,"children":7308},{},[7309],{"type":53,"value":7310},"Webhook 401 \u002F signature verification failed",{"type":47,"tag":409,"props":7312,"children":7313},{},[7314,7320],{"type":47,"tag":72,"props":7315,"children":7317},{"className":7316},[],[7318],{"type":53,"value":7319},"CLERK_WEBHOOK_SIGNING_SECRET",{"type":53,"value":7321}," mismatch or route protected by middleware",{"type":47,"tag":409,"props":7323,"children":7324},{},[7325,7327],{"type":53,"value":7326},"Copy the Signing Secret from Dashboard → Webhooks; add the webhook route to ",{"type":47,"tag":72,"props":7328,"children":7330},{"className":7329},[],[7331],{"type":53,"value":7332},"createRouteMatcher(['\u002Fapi\u002Fwebhooks(.*)'])",{"type":47,"tag":172,"props":7334,"children":7336},{"id":7335},"billing-gates-permissions",[7337],{"type":53,"value":7338},"Billing Gates Permissions",{"type":47,"tag":60,"props":7340,"children":7341},{},[7342,7344,7350,7351,7356],{"type":53,"value":7343},"When Billing is enabled, ",{"type":47,"tag":72,"props":7345,"children":7347},{"className":7346},[],[7348],{"type":53,"value":7349},"has({ permission: 'org:posts:edit' })",{"type":53,"value":7255},{"type":47,"tag":72,"props":7352,"children":7354},{"className":7353},[],[7355],{"type":53,"value":7224},{"type":53,"value":7357}," if the Feature associated with that permission is not included in the organization's active Plan, even if the user has the permission assigned via their role. This is by design: billing gates permissions at the feature level. Always ensure the required Feature is attached to the Plan in Dashboard → Billing → Plans → Features.",{"type":47,"tag":172,"props":7359,"children":7361},{"id":7360},"see-also",[7362],{"type":53,"value":7363},"See Also",{"type":47,"tag":234,"props":7365,"children":7366},{},[7367,7377,7388],{"type":47,"tag":183,"props":7368,"children":7369},{},[7370,7375],{"type":47,"tag":72,"props":7371,"children":7373},{"className":7372},[],[7374],{"type":53,"value":504},{"type":53,"value":7376}," - Initial Clerk install",{"type":47,"tag":183,"props":7378,"children":7379},{},[7380,7386],{"type":47,"tag":72,"props":7381,"children":7383},{"className":7382},[],[7384],{"type":53,"value":7385},"clerk-orgs",{"type":53,"value":7387}," - B2B organizations (required for B2B billing and seat-limit plans)",{"type":47,"tag":183,"props":7389,"children":7390},{},[7391,7396],{"type":47,"tag":72,"props":7392,"children":7394},{"className":7393},[],[7395],{"type":53,"value":929},{"type":53,"value":7397}," - Webhook signature verification and routing",{"type":47,"tag":7399,"props":7400,"children":7401},"style",{},[7402],{"type":53,"value":7403},"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":7405,"total":5899},[7406,7420,7435,7451,7469,7477,7495,7512,7528,7545,7560,7574],{"slug":8,"name":8,"fn":7407,"description":7408,"org":7409,"tags":7410,"stars":26,"repoUrl":27,"updatedAt":7419},"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},[7411,7412,7413,7416],{"name":21,"slug":22,"type":13},{"name":9,"slug":8,"type":13},{"name":7414,"slug":7415,"type":13},"Mobile","mobile",{"name":7417,"slug":7418,"type":13},"Web Development","web-development","2026-07-18T05:12:23.438307",{"slug":7421,"name":7421,"fn":7422,"description":7423,"org":7424,"tags":7425,"stars":26,"repoUrl":27,"updatedAt":7434},"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},[7426,7429,7430,7433],{"name":7427,"slug":7428,"type":13},"Android","android",{"name":9,"slug":8,"type":13},{"name":7431,"slug":7432,"type":13},"Kotlin","kotlin",{"name":7414,"slug":7415,"type":13},"2026-04-10T05:00:18.622871",{"slug":7436,"name":7436,"fn":7437,"description":7438,"org":7439,"tags":7440,"stars":26,"repoUrl":27,"updatedAt":7450},"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},[7441,7444,7445,7446,7447],{"name":7442,"slug":7443,"type":13},"Astro","astro",{"name":21,"slug":22,"type":13},{"name":9,"slug":8,"type":13},{"name":24,"slug":25,"type":13},{"name":7448,"slug":7449,"type":13},"Serverless","serverless","2026-04-07T04:46:14.731808",{"slug":7452,"name":7452,"fn":7453,"description":7454,"org":7455,"tags":7456,"stars":26,"repoUrl":27,"updatedAt":7468},"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},[7457,7460,7461,7464,7465],{"name":7458,"slug":7459,"type":13},"API Development","api-development",{"name":21,"slug":22,"type":13},{"name":7462,"slug":7463,"type":13},"Backend","backend",{"name":9,"slug":8,"type":13},{"name":7466,"slug":7467,"type":13},"REST API","rest-api","2026-04-10T05:00:08.728072",{"slug":4,"name":4,"fn":5,"description":6,"org":7470,"tags":7471,"stars":26,"repoUrl":27,"updatedAt":28},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7472,7473,7474,7475,7476],{"name":21,"slug":22,"type":13},{"name":9,"slug":8,"type":13},{"name":24,"slug":25,"type":13},{"name":18,"slug":19,"type":13},{"name":15,"slug":16,"type":13},{"slug":7478,"name":7478,"fn":7479,"description":7480,"org":7481,"tags":7482,"stars":26,"repoUrl":27,"updatedAt":7494},"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},[7483,7486,7487,7488,7491],{"name":7484,"slug":7485,"type":13},"Auth","auth",{"name":9,"slug":8,"type":13},{"name":24,"slug":25,"type":13},{"name":7489,"slug":7490,"type":13},"OAuth","oauth",{"name":7492,"slug":7493,"type":13},"Security","security","2026-04-07T04:46:08.489328",{"slug":7496,"name":7496,"fn":7497,"description":7498,"org":7499,"tags":7500,"stars":26,"repoUrl":27,"updatedAt":7511},"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},[7501,7502,7503,7504,7507,7510],{"name":7458,"slug":7459,"type":13},{"name":21,"slug":22,"type":13},{"name":9,"slug":8,"type":13},{"name":7505,"slug":7506,"type":13},"CLI","cli",{"name":7508,"slug":7509,"type":13},"Deployment","deployment",{"name":7492,"slug":7493,"type":13},"2026-07-31T05:52:40.580813",{"slug":7513,"name":7513,"fn":7514,"description":7515,"org":7516,"tags":7517,"stars":26,"repoUrl":27,"updatedAt":7527},"clerk-custom-ui","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},[7518,7519,7522,7523,7526],{"name":21,"slug":22,"type":13},{"name":7520,"slug":7521,"type":13},"Branding","branding",{"name":9,"slug":8,"type":13},{"name":7524,"slug":7525,"type":13},"Design","design",{"name":24,"slug":25,"type":13},"2026-04-10T05:00:10.109158",{"slug":7529,"name":7529,"fn":7530,"description":7531,"org":7532,"tags":7533,"stars":26,"repoUrl":27,"updatedAt":7544},"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},[7534,7535,7536,7539,7540,7541],{"name":21,"slug":22,"type":13},{"name":9,"slug":8,"type":13},{"name":7537,"slug":7538,"type":13},"Expo","expo",{"name":24,"slug":25,"type":13},{"name":7414,"slug":7415,"type":13},{"name":7542,"slug":7543,"type":13},"React Native","react-native","2026-05-19T06:48:47.074181",{"slug":7546,"name":7546,"fn":7547,"description":7548,"org":7549,"tags":7550,"stars":26,"repoUrl":27,"updatedAt":7559},"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},[7551,7552,7553,7556],{"name":9,"slug":8,"type":13},{"name":24,"slug":25,"type":13},{"name":7554,"slug":7555,"type":13},"Next.js","next-js",{"name":7557,"slug":7558,"type":13},"Performance","performance","2026-04-10T05:00:15.80215",{"slug":7561,"name":7561,"fn":7562,"description":7563,"org":7564,"tags":7565,"stars":26,"repoUrl":27,"updatedAt":7573},"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},[7566,7567,7568,7569,7570],{"name":21,"slug":22,"type":13},{"name":7462,"slug":7463,"type":13},{"name":9,"slug":8,"type":13},{"name":24,"slug":25,"type":13},{"name":7571,"slug":7572,"type":13},"Nuxt","nuxt","2026-04-07T04:46:18.337538",{"slug":7385,"name":7385,"fn":7575,"description":7576,"org":7577,"tags":7578,"stars":26,"repoUrl":27,"updatedAt":7587},"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},[7579,7580,7583,7586],{"name":9,"slug":8,"type":13},{"name":7581,"slug":7582,"type":13},"Multi-Tenant","multi-tenant",{"name":7584,"slug":7585,"type":13},"RBAC","rbac",{"name":15,"slug":16,"type":13},"2026-04-10T05:00:14.40165",{"items":7589,"total":5899},[7590,7597,7604,7612,7620,7628,7636],{"slug":8,"name":8,"fn":7407,"description":7408,"org":7591,"tags":7592,"stars":26,"repoUrl":27,"updatedAt":7419},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7593,7594,7595,7596],{"name":21,"slug":22,"type":13},{"name":9,"slug":8,"type":13},{"name":7414,"slug":7415,"type":13},{"name":7417,"slug":7418,"type":13},{"slug":7421,"name":7421,"fn":7422,"description":7423,"org":7598,"tags":7599,"stars":26,"repoUrl":27,"updatedAt":7434},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7600,7601,7602,7603],{"name":7427,"slug":7428,"type":13},{"name":9,"slug":8,"type":13},{"name":7431,"slug":7432,"type":13},{"name":7414,"slug":7415,"type":13},{"slug":7436,"name":7436,"fn":7437,"description":7438,"org":7605,"tags":7606,"stars":26,"repoUrl":27,"updatedAt":7450},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7607,7608,7609,7610,7611],{"name":7442,"slug":7443,"type":13},{"name":21,"slug":22,"type":13},{"name":9,"slug":8,"type":13},{"name":24,"slug":25,"type":13},{"name":7448,"slug":7449,"type":13},{"slug":7452,"name":7452,"fn":7453,"description":7454,"org":7613,"tags":7614,"stars":26,"repoUrl":27,"updatedAt":7468},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7615,7616,7617,7618,7619],{"name":7458,"slug":7459,"type":13},{"name":21,"slug":22,"type":13},{"name":7462,"slug":7463,"type":13},{"name":9,"slug":8,"type":13},{"name":7466,"slug":7467,"type":13},{"slug":4,"name":4,"fn":5,"description":6,"org":7621,"tags":7622,"stars":26,"repoUrl":27,"updatedAt":28},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7623,7624,7625,7626,7627],{"name":21,"slug":22,"type":13},{"name":9,"slug":8,"type":13},{"name":24,"slug":25,"type":13},{"name":18,"slug":19,"type":13},{"name":15,"slug":16,"type":13},{"slug":7478,"name":7478,"fn":7479,"description":7480,"org":7629,"tags":7630,"stars":26,"repoUrl":27,"updatedAt":7494},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7631,7632,7633,7634,7635],{"name":7484,"slug":7485,"type":13},{"name":9,"slug":8,"type":13},{"name":24,"slug":25,"type":13},{"name":7489,"slug":7490,"type":13},{"name":7492,"slug":7493,"type":13},{"slug":7496,"name":7496,"fn":7497,"description":7498,"org":7637,"tags":7638,"stars":26,"repoUrl":27,"updatedAt":7511},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[7639,7640,7641,7642,7643,7644],{"name":7458,"slug":7459,"type":13},{"name":21,"slug":22,"type":13},{"name":9,"slug":8,"type":13},{"name":7505,"slug":7506,"type":13},{"name":7508,"slug":7509,"type":13},{"name":7492,"slug":7493,"type":13}]