Skip to content

@venturekit-pro/billing API

FunctionSignatureDescription
definePlans(plans: PlanDefinition[]) => PlansDefine billing plans with feature limits
getFeatureLimit(plans: Plans, planId: string, feature: string) => numberGet numeric limit for a feature
hasFeature(plans: Plans, planId: string, feature: string) => booleanCheck if a plan has a boolean feature
mapUsageToLineItems(usage, features) => LineItem[]Map usage data to invoice line items
FunctionSignatureDescription
getBillingMigrationsDir() => stringGet path to billing SQL migration files
TypeDescription
PlanDefinitionPlan with id, name, and feature map
PlanFeatureFeature definition with numeric limit or boolean

Additional billing types are exported from ./types/index.js.