MCPcopy Index your code
hub / github.com/dodopayments/billingsdk

github.com/dodopayments/billingsdk @v1.4.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.4.0 ↗ · + Follow
762 symbols 1,849 edges 343 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Billing SDK

Billing SDK Cover

GitHub stars Join Discord Twitter Follow License

Modern, type-safe billing and subscription management components for React, built with TypeScript and Tailwind CSS. Designed to work seamlessly alongside shadcn/ui.

BillingSDK is part of the Vercel OSS Program.

Vercel OSS Program

Table of Contents

Overview

Billing SDK provides production-ready UI building blocks for pricing, usage, and subscription workflows. Drop them into your app, wire up your data, and ship faster with consistent UX.

Features

  • Ready-to-use components: End-to-end billing and subscription building blocks
  • Multiple themes: Classic, Minimal, and custom theme tokens
  • Responsive by default: Optimized for mobile, tablet, and desktop
  • TypeScript-first: Strongly typed props for safe composition
  • Easy integration: One-command install via CLI or shadcn/ui registry

Components

  • Pricing Tables: Multiple variants for different use cases
  • Subscription Management: Manage plans, status, and details
  • Usage Meters: Linear and circular quota indicators
  • Banner Notifications: Announcements and promotional banners
  • Plan Updates: Upgrade/downgrade flows with clear affordances
  • Cancellation Flow: Guided cancellation with retention patterns

Quick Example

import { PricingTableOne } from "@/components/billingsdk/pricing-table-one";

const plans = [
  {
    id: "starter",
    title: "Starter",
    price: 9,
    period: "month",
    features: ["100 requests", "Basic support", "1 project"],
    popular: false,
  },
  {
    id: "pro",
    title: "Pro",
    price: 29,
    period: "month",
    features: ["Unlimited requests", "Priority support", "10 projects"],
    popular: true,
  },
];

export default function App() {
  return (
    <PricingTableOne
      plans={plans}
      title="Choose your plan"
      description="Select the plan that works best for you"
      onPlanSelect={(planId) => {
        console.log("Selected plan:", planId);
      }}
      theme="classic"
      size="medium"
    />
  );
}

Tech Stack

  • Runtime: React 19, Next.js 15
  • Language: TypeScript
  • Styling: Tailwind CSS
  • UI: shadcn/ui
  • Animation: Motion

Quick Start

  1. Install dependencies
npm install
  1. Start the development server
npm run dev
  1. Open http://localhost:3000

Installation in Your Project

Using CLI (Recommended)

For complete project setup with framework integration:

# Initialize billing to a new project
npx @billingsdk/cli init

# Add individual components
npx @billingsdk/cli add pricing-table-one

Manual Installation

Add Billing SDK components to your existing shadcn/ui project:

npx shadcn@latest add @billingsdk/[component-name]

Documentation

Explore docs, guides and interactive examples:

billingsdk.com/docs

Contributing

See CONTRIBUTING.md for development setup, project structure, and contribution guidelines.

Contributors

Thanks to all our amazing contributors for their support and code!

Star History

Star History Chart

License

This project is licensed under the GNU General Public License (GPL), which allows you to use, modify, and distribute the software freely, provided that any derivative works are also distributed under the same license.

Extension points exported contracts — how you extend this code

UseBillingState (Interface)
(no doc)
packages/templates/react/hooks/dodopayments/useBilling.ts
BackendComponent (Interface)
(no doc)
packages/cli/src/types/registry.ts
UsageResource (Interface)
(no doc)
src/registry/billingsdk/detailed-usage-table.tsx
CodeBlockTheme (Interface)
(no doc)
src/components/code.tsx
Plan (Interface)
(no doc)
src/lib/billingsdk-config.ts
ThemeContextType (Interface)
(no doc)
src/contexts/theme-context.tsx
UseBillingState (Interface)
(no doc)
packages/templates/react/hooks/stripe/useBilling.ts
Registry (Interface)
(no doc)
packages/cli/src/types/registry.ts

Core symbols most depended-on inside this repo

cn
called by 282
src/lib/utils.ts
getDodoPaymentsClient
called by 14
packages/templates/hono/src/lib/dodopayments.ts
getDodoPaymentsClient
called by 14
packages/templates/express/src/lib/dodopayments.ts
getStripe
called by 14
packages/templates/nestjs/src/lib/stripe.ts
getDodoPaymentsClient
called by 14
packages/templates/nestjs/src/lib/dodopayments.ts
getDodoPaymentsClient
called by 12
packages/templates/fastify/src/lib/dodopayments.ts
clamp
called by 12
src/registry/billingsdk/usage-based-pricing.tsx
handleInputChange
called by 12
src/registry/billingsdk/payment-details.tsx

Shape

Function 610
Interface 90
Method 32
Class 30

Languages

TypeScript100%

Modules by API surface

src/registry/billingsdk/demo/billing-settings-demo.tsx16 symbols
src/components/playground/auto-discovery.ts16 symbols
src/components/billing-settings-demo.tsx16 symbols
src/registry/billingsdk/usage-based-pricing.tsx15 symbols
src/components/ui/dropdown-menu.tsx15 symbols
src/components/playground/preview-panel.tsx15 symbols
src/registry/billingsdk/billing-settings-2.tsx14 symbols
src/registry/billingsdk/payment-details.tsx13 symbols
src/registry/billingsdk/billing-settings.tsx12 symbols
src/components/ui/select.tsx10 symbols
src/components/ui/dialog.tsx10 symbols
src/components/search.tsx9 symbols

For agents

$ claude mcp add billingsdk \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page