@venturekit-pro/billing
Installation
Section titled “Installation”npm install @venturekit-pro/billing@devWhat It Provides
Section titled “What It Provides”Plan Definitions
Section titled “Plan Definitions”import { definePlans } from '@venturekit-pro/billing';
const plans = definePlans([ { id: 'free', name: 'Free', price: 0, currency: 'USD', interval: 'month', active: true, features: [ { featureKey: 'projects', enabled: true, limit: 3, description: 'Projects' }, { featureKey: 'support', enabled: false, description: 'Support' }, ], }, { id: 'pro', name: 'Pro', price: 2900, currency: 'USD', interval: 'month', active: true, features: [ { featureKey: 'projects', enabled: true, limit: 50, description: 'Projects' }, { featureKey: 'support', enabled: true, description: 'Support' }, ], },]);Feature Checking
Section titled “Feature Checking”import { getFeatureLimit, hasFeature } from '@venturekit-pro/billing';
const freePlan = plans.find(p => p.id === 'free')!;getFeatureLimit(freePlan, 'projects'); // → 3hasFeature(freePlan, 'support'); // → falseUsage-to-Invoice Mapping
Section titled “Usage-to-Invoice Mapping”import { mapUsageToLineItems } from '@venturekit-pro/billing';
// (plan, usage) — usage is a Record<featureKey, quantity>const lineItems = mapUsageToLineItems(plan, { projects: 12, apiRequests: 8500 });Auto-Migrations
Section titled “Auto-Migrations”import { getBillingMigrationsDir } from '@venturekit-pro/billing';
const dir = getBillingMigrationsDir(); // Path to billing SQL migrationsPlanDefinition,PlanFeature— plan configuration types
Dependencies
Section titled “Dependencies”@venturekit/core— required
Related
Section titled “Related”- Billing Guide — setup walkthrough
- Multi-Tenancy — per-tenant billing
- API Reference — full type documentation