-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathbilling.development.config.js
More file actions
82 lines (81 loc) · 2.81 KB
/
Copy pathbilling.development.config.js
File metadata and controls
82 lines (81 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
const config = {
audit: {
routeTypeMap: {
billing: 'Organization',
},
},
billing: {
activated: true,
// Plans available for subscriptions — extend as needed
plans: ['free', 'starter', 'pro', 'enterprise'],
// Quotas — downstream projects override these per plan:
// quotas: {
// free: { documents: { create: 10, export: 50 } },
// starter: { documents: { create: 100, export: 500 } },
// pro: { documents: { create: Infinity, export: Infinity } },
// },
// Stripe subscription statuses — see https://docs.stripe.com/api/subscriptions/object#subscription_object-status
statuses: [
'incomplete',
'incomplete_expired',
'trialing',
'active',
'past_due',
'canceled',
'unpaid',
'paused',
],
/**
* Feature flag — default OFF.
* Set to true in downstream project config to enable meter-based pricing.
* When false, all meter code paths are no-ops; legacy behavior unchanged.
*/
meterMode: false,
/**
* Meter unit parameters — downstream projects must override with their
* actual unit economics before enabling meterMode in production.
*
* runBaseUnits: flat units charged per run (before per-feature ratios).
* maxUnitsPerOperation: safety cap per single operation run.
*/
meter: {
runBaseUnits: 1,
/**
* Conversion ratio: 1 unit = 1 / dollarsToUnitRatio USD of underlying cost.
*
* DOWNSTREAM-OVERRIDE-REQUIRED — the devkit default (1000) is illustrative.
* Each downstream project must set this based on their unit economics
* (cost-target × margin multiplier). Setting this wrong directly affects
* gross margin: a value of N means each $1 of cost consumes N units, so
* lowering N halves the margin coverage.
*/
dollarsToUnitRatio: 1000,
maxUnitsPerOperation: 10000,
},
/**
* Extra meter packs — downstream projects override with actual packs.
* Example: [{ packId: 'pack_500k', meterUnits: 500000, stripePriceId: 'price_xxx' }]
*/
packs: [],
},
stripe: {
secretKey: process.env.DEVKIT_NODE_stripe_secretKey ?? '',
webhookSecret: process.env.DEVKIT_NODE_stripe_webhookSecret ?? '',
prices: {
starter: {
monthly: process.env.DEVKIT_NODE_stripe_prices_starter_monthly ?? '',
annual: process.env.DEVKIT_NODE_stripe_prices_starter_annual ?? '',
},
pro: {
monthly: process.env.DEVKIT_NODE_stripe_prices_pro_monthly ?? '',
annual: process.env.DEVKIT_NODE_stripe_prices_pro_annual ?? '',
},
/**
* Extra packs price map — downstream project override.
* Example: { pack_500k: 'price_xxx', pack_2m: 'price_yyy' }
*/
packs: {},
},
},
};
export default config;