What’s in the SDK
The@billingos/sdk package gives you everything you need to add billing to a React app:
| Category | What you get |
|---|---|
| Components | Drop-in UI for pricing, checkout, portals, feature gates |
| Hooks | TanStack Query-powered hooks for subscriptions, entitlements, usage |
| Client | Low-level API client for custom integrations |
| Provider | Context provider that manages auth and SDK state |
Components
| Component | Purpose |
|---|---|
<PricingTable /> | Display plans with pricing, features, and built-in checkout |
<CheckoutModal /> | Secure, iframe-based checkout modal |
<CustomerPortal /> | Self-service subscription, invoices, and payment management |
<FeatureGate /> | Show/hide content based on plan entitlements |
<UsageDisplay /> | Progress bars showing feature usage vs limits |
<UpgradeNudge /> | Automated upgrade prompts when users hit limits |
<UpgradePrompt /> | Manual upgrade call-to-action |
Hooks
| Hook | Purpose |
|---|---|
useSubscription | Fetch and manage subscriptions |
useCheckout | Programmatic checkout flow |
useFeature | Check feature access and track usage |
useEntitlements | List entitlements and check limits |
useTrackUsage | Track usage events and view metrics |
useProducts | Fetch products and pricing |
What you don’t need to do
- No Stripe SDK — BillingOS handles all Stripe communication. No
@stripe/stripe-jsor@stripe/react-stripe-jsneeded. - No PCI compliance — Checkout runs in a secure iframe. Card data never touches your servers.
- No webhook handling — Entitlements update automatically after checkout.
Quick example
Architecture
Requirements
- React 18+ (React 19 supported)
- TypeScript types included — no separate
@typespackage needed - Built on TanStack Query for data fetching and caching
- Tree-shakeable bundle (
sideEffects: false)
Next steps
Installation
Install the SDK and set up peer dependencies.
BillingOSProvider
Configure the provider and connect to your app.