Skip to content

@venturekit-pro/billing

Terminal window
npm install @venturekit-pro/billing@dev
import { definePlans } from '@venturekit-pro/billing';
const plans = definePlans([
{ id: 'free', name: 'Free', features: { projects: { limit: 3 }, support: false } },
{ id: 'pro', name: 'Pro', features: { projects: { limit: 50 }, support: true } },
]);
import { getFeatureLimit, hasFeature } from '@venturekit-pro/billing';
getFeatureLimit(plans, 'free', 'projects'); // → 3
hasFeature(plans, 'free', 'support'); // → false
import { mapUsageToLineItems } from '@venturekit-pro/billing';
const lineItems = mapUsageToLineItems(currentUsage, planFeatures);
import { getBillingMigrationsDir } from '@venturekit-pro/billing';
const dir = getBillingMigrationsDir(); // Path to billing SQL migrations
  • PlanDefinition, PlanFeature — plan configuration types
  • @venturekit/core — required