Overview
Billing SDK offers:- React Components: Pre-built, customizable billing components for React applications
- CLI Tooling: Command-line interface for project initialization and component management
- Framework Support: Integration with Next.js, Express.js, Hono, Fastify, and React
- Payment Provider: Full integration with Dodo Payments
Quick Start
Get started with Billing SDK in minutes:Install the CLI
Use npx to run the CLI without installation:Or install it globally for frequent use:
Initialize a Project
Run the interactive setup to create a new billing project:You’ll be prompted to select:
- Your preferred framework (Next.js, Express.js, Hono, Fastify, React)
- Your payment provider (Dodo Payments)
Supported Frameworks
Billing SDK supports multiple frameworks with comprehensive Dodo Payments integration:| Framework | Dodo Payments |
|---|---|
| Next.js | ✅ Yes |
| Express.js | ✅ Yes |
| Hono | ✅ Yes |
| React | ✅ Yes |
| Fastify | ✅ Yes |
CLI Commands
@billingsdk/cli init
Initialize a new billing project with complete setup including framework configuration, Dodo Payments integration, and essential dependencies.
What it does:
- Framework Selection: Choose your preferred framework
- Template Installation: Downloads and installs framework-specific templates with Dodo Payments integration
- Dependency Management: Automatically installs required dependencies
- File Generation: Creates necessary configuration files and boilerplate code
@billingsdk/cli add
Add individual billing components to your existing project using the shadcn/ui registry system.
Examples:
- Downloads the component configuration from the registry
- Installs the component files in your
components/billingsdk/directory - Updates your project configuration if needed
- Installs any additional dependencies
Generated Files Structure
After runninginit, you’ll get a complete project structure with:
- API Routes: Comprehensive endpoints for checkout, customers, products, subscriptions, and webhooks
- Hooks: React hooks for billing operations (if using React/Next.js)
- Library Files: Payment provider client initialization and utilities
- Environment Configuration: Example environment variable files
Next.js Example Structure
Environment Configuration
Configure your environment variables after initialization:Available Components
Billing SDK provides a comprehensive collection of React components:- Pricing Tables: Multiple variants for displaying product pricing
- Subscription Management: Components for managing customer subscriptions
- Usage Monitoring: Visual components for tracking usage-based billing
- Checkout Components: Pre-built checkout flows
- Customer Portal: Components for customer self-service
Open Source
Billing SDK is built on open-source principles:- 🔍 Transparency: Full visibility into how components work
- 🤝 Community: Built by developers, for developers
- 🔒 Security: Open code means better security through peer review
- 📈 Innovation: Faster iteration through community contributions
Billing SDK is released under the GNU General Public License (GPL), ensuring the project remains open and free.
Getting Help
Need assistance with Billing SDK?- GitHub Issues: Open an issue
- Documentation: Visit billingsdk.com/docs
- LLMs Full Documentation: billingsdk.com/llms-full.txt
Contributing
We welcome contributions! See our contribution guide for details on:- Reporting bugs
- Requesting features
- Submitting pull requests
- Adding new components
- Improving documentation
Learn More
Full Documentation
Complete guide to Billing SDK with examples and best practices
CLI Reference
Detailed CLI documentation for all commands and options
Component Library
Browse all available components with live examples