clerk-billing

Implement Clerk Billing subscription plans, entitlement checks, and webhook sync in Next.js.

Updated Apr 7, 2026
One-click install
npx skills add https://github.com/koushik-hait/xigenis-landingpage-v1 --skill clerk-billing-koushik-hait
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clerk-billing
Source: https://github.com/koushik-hait/xigenis-landingpage-v1/tree/main/.agents/skills/clerk-billing
Command: npx skills add https://github.com/koushik-hait/xigenis-landingpage-v1 --skill clerk-billing-koushik-hait

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Clerk Billing configuration and entitlement checks for subscription-based SaaS can be hard to wire correctly, leading to empty pricing tables, incorrect plan gates, and webhook sync bugs. This Skill provides a practical, end-to-end reference for rendering plan UI, gating access by plans/features, and handling Clerk billing webhook events safely.

Core Features & Use Cases

  • Render subscription plans with Clerk’s UI: Use PricingTable to display configured plans and open Clerk’s in-app checkout drawer, including B2B org pricing via for="organization".
  • Gate access using entitlement-aware checks: Use has({ plan }) for tier-level gating and has({ feature }) for capability gating, with server-side auth() and client-side useAuth() patterns.
  • Synchronize subscription lifecycle via webhooks: Verify webhook signatures with verifyWebhook, branch on Clerk’s dot-camelCase event names, and persist payer + plan + status updates to your database.
  • Use cases: building a /pricing page, protecting /dashboard routes for Pro-only access, implementing B2B organization plan checks (orgId + has({ plan: 'org:team' })), and maintaining accurate subscription state in your app after checkout.

Quick Start

Create a PricingTable-backed /pricing page, enable Billing in the Clerk Dashboard → Billing → Settings, then add server-side route gating with has({ plan: 'pro' }) for tier access or has({ feature: 'export' }) for capability access.

Frequently Asked Questions about clerk-billing

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

FAQPage Schema
How do I set up subscription billing with Clerk in Next.js?

To set up Clerk subscription billing in Next.js, enable Billing in the Clerk Dashboard, configure plan and feature slugs, render the PricingTable UI, and use webhook events to sync subscription lifecycle state to your database.

How do I gate user access by subscription plan using Clerk?

Gate access by subscription plan using Clerk by applying server-side auth() and client-side useAuth() entitlement checks, using has({ plan }) for tier-level gating and has({ feature }) for capability gating.

How do I handle Clerk billing webhooks for subscription state synchronization?

Handle Clerk billing webhooks by verifying webhook signatures with verifyWebhook, branching on Clerk-specific dot-camelCase event names, and extracting nested payload fields to persist payer, plan, and status updates to your database.

Can I render B2B organization pricing tables with Clerk?

Yes, you can render B2B organization pricing tables with Clerk by using the PricingTable component configured with for="organization", and checking organization plan entitlements using orgId with has({ plan: 'org:team' }).

Why is my Clerk pricing table empty or not showing configured plans?

An empty Clerk pricing table usually means Billing is not enabled in the Clerk Dashboard Settings, or your plan and feature slugs are incorrectly configured, preventing the PricingTable UI from rendering available subscription options.

Do I need to enable Billing in the Clerk Dashboard before using subscription features?

Yes, you must enable Billing in the Clerk Dashboard under Settings and correctly configure your plan and feature slugs before rendering pricing UI or performing entitlement checks for subscription gating in your Next.js application.