clerk-billing

Implement Clerk Billing subscriptions, plan gating, and billing webhooks in Next.js applications.

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/Rajaryan1726/ai-code-review-system --skill clerk-billing-rajaryan1726
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: clerk-billing
Source: https://github.com/Rajaryan1726/ai-code-review-system/tree/main/client/.agents/skills/clerk-billing
Command: npx skills add https://github.com/Rajaryan1726/ai-code-review-system --skill clerk-billing-rajaryan1726

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @clerk/nextjs, and includes references (resource) components.

What problem does it solve? Adding subscription monetization to a Next.js app with Clerk authentication requires coordinating plan configuration, checkout UI, entitlement checks, and webhook lifecycle handling, and mistakes like creating plans in the wrong tab or using Stripe event names cause silent failures. ## Core Features & Use Cases - Subscription UI: Render <PricingTable /> and <CheckoutButton /> for in-app checkout, plus <UserProfile /> / <OrganizationProfile /> for self-service billing management with invoices and payment methods. - Plan and Feature Gating: Gate routes and capabilities with has({ plan }) and has({ feature }) from auth() or useAuth(), including B2B organization plans with seat limits. - Billing Webhooks: Handle Clerk's 16 billing events (subscription.created, subscriptionItem.canceled, subscriptionItem.pastDue, etc.) with correct payload shapes and signature verification. - Use Case: A B2B SaaS needs team subscriptions where each organization subscribes to a seat-limited plan; this Skill provides the org-level plan check, the <PricingTable for="organization" /> pricing page, and webhook handlers syncing subscription status to a database. ## Quick Start Ask the AI to add a pricing page with Clerk's PricingTable and protect a Pro-only dashboard route using has({ plan: 'pro' }).

Frequently Asked Questions about clerk-billing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a subscription pricing page with Clerk Billing?▼

Render the `<PricingTable />` component from `@clerk/nextjs` on a pricing page after enabling Billing in Clerk Dashboard → Billing → Settings and creating plans under Billing → Plans. Selecting a plan opens Clerk's in-app checkout drawer; no Stripe Checkout integration code is needed.

How do I gate a route to Pro plan users in Next.js with Clerk?▼

Call `await auth()` from `@clerk/nextjs/server` in a server component and check `has({ plan: 'pro' })`, redirecting to a pricing page when the check fails. For individual capabilities like export or analytics, prefer `has({ feature: 'export' })` over plan checks.

Why does has({ plan }) return false after a successful checkout?▼

The session token has not refreshed to include the new plan, the plan slug in code does not exactly match the Dashboard slug, or Billing is not enabled for the instance. Reload the session with `clerk.session.reload()` and verify the subscription exists in Dashboard → Billing → Subscriptions.

Does Clerk Billing support per-seat or metered usage billing?▼

Clerk Billing uses seat-limit plans with a fixed price per plan and a membership cap enforced at invite time, not metered pricing that scales per member. For usage-based models, gate allotments with `has({ feature })` and track consumption in your own datastore.

What webhook events does Clerk Billing send for cancellations?▼

Cancellation fires as `subscriptionItem.canceled`, not `subscription.canceled`, which does not exist. Clerk uses dot-notation camelCase event names like `subscription.created` and `subscriptionItem.pastDue`, verified with `verifyWebhook(req)` from `@clerk/nextjs/webhooks`.

Can I enable Clerk Billing via the CLI or API instead of the Dashboard?▼

Yes, run `clerk enable billing` after linking the project with `clerk auth login` and `clerk link`, or patch the config via `clerk config patch`. Plans and features can also be managed programmatically through the PLAPI billing config handler.