@venturekit-pro/billing API
Functions
Section titled “Functions”| Function | Signature | Description |
|---|---|---|
definePlans | (plans: PlanDefinition[]) => Plans | Define billing plans with feature limits |
getFeatureLimit | (plans: Plans, planId: string, feature: string) => number | Get numeric limit for a feature |
hasFeature | (plans: Plans, planId: string, feature: string) => boolean | Check if a plan has a boolean feature |
mapUsageToLineItems | (usage, features) => LineItem[] | Map usage data to invoice line items |
Migrations
Section titled “Migrations”| Function | Signature | Description |
|---|---|---|
getBillingMigrationsDir | () => string | Get path to billing SQL migration files |
| Type | Description |
|---|---|
PlanDefinition | Plan with id, name, and feature map |
PlanFeature | Feature definition with numeric limit or boolean |
Additional billing types are exported from ./types/index.js.