clerk-billing

Implement Clerk subscription billing with PricingTable, plan gating, and billing webhooks in Next.js.

Updated Apr 19, 2026
One-click install
npx skills add https://github.com/divinaarmuela/Content --skill clerk-billing-divinaarmuela
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clerk-billing
Source: https://github.com/divinaarmuela/Content/tree/main/.claude/skills/clerk-billing
Command: npx skills add https://github.com/divinaarmuela/Content --skill clerk-billing-divinaarmuela

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Adding subscriptions to a Next.js app with Clerk requires coordinating dashboard configuration, plan and feature setup, checkout UI, entitlement checks, and webhook handling, and mistakes in any step cause silent failures like empty pricing tables or false plan checks. ## Core Features & Use Cases - Subscription UI: Render Clerk's PricingTable and in-app checkout drawer, plus UserProfile or OrganizationProfile for billing management, invoices, and payment methods. - Plan and Feature Gating: Gate routes and UI with has({ plan }) for tier-level checks and has({ feature }) for capability-level entitlements, on both server and client. - B2B and B2C Patterns: Configure user plans for B2C and organization plans with seat limits for B2B, including admin-gated billing UI. - Billing Webhooks: Handle the full Clerk event catalog (subscription.created, subscriptionItem.canceled, subscriptionItem.pastDue, and more) to sync subscription state to your database. - Use Case: A SaaS team adds a /pricing page rendering PricingTable, gates the analytics dashboard behind has({ feature: 'analytics' }), and syncs subscription status via verified webhooks. ## Quick Start Ask the AI to add a Clerk billing pricing page to your Next.js app and gate a pro-only 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 in Next.js?

Render the PricingTable component from @clerk/nextjs on a pricing page after enabling Billing in the Clerk Dashboard and creating plans. Selecting a plan opens Clerk's in-app checkout drawer; pass for="organization" for B2B org plans.

How do I gate a route to a specific subscription plan with Clerk?

Call await auth() from @clerk/nextjs/server in a server component and check has({ plan: 'pro' }), redirecting to /pricing when it returns false. For individual capabilities, 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, or the plan slug in code does not exactly match the Dashboard slug. Reload the session with clerk.session.reload() and verify the slug and that Billing is enabled in Dashboard settings.

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

Clerk Billing uses seat-limit plans with fixed per-plan pricing and a membership cap, not metered pricing that scales per member or per API call. Tier plans by seat cap to charge larger organizations more, and track usage in your own datastore.

Why is my Clerk PricingTable rendering empty?

The plan was created in the wrong tab (User Plans vs Organization Plans), Billing is not enabled, or no plans exist. Create the plan in the tab matching your PricingTable's for prop and confirm Billing is enabled in Dashboard settings.

How do I handle Clerk billing webhooks for subscription sync?

Verify requests with verifyWebhook from @clerk/nextjs/webhooks and branch on Clerk event names like subscription.created and subscriptionItem.canceled, never Stripe event names. Add /api/webhooks(.*) to createRouteMatcher so the route is public.