@schematichq/schematic-components 2.16.3 → 2.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -48,24 +48,34 @@ selection stage.
48
48
  initializeWithPlan('plan_VBXv4bHjSf3');
49
49
  ```
50
50
 
51
- Passing a config object allows pre-selecting Add-ons as well as hiding
52
- specific stages.
51
+ Passing a config object allows pre-selecting Add-ons and pay-in-advance
52
+ quantities, as well as hiding specific stages.
53
53
 
54
54
  ```ts
55
55
  const config = {
56
56
  planId: 'plan_VBXv4bHjSf3', // pre-select a Plan
57
57
  addOnIds: ['plan_AWv7bPjSx2'], // pre-select 1 or more Add-ons
58
58
  period: 'month', // pre-select 'month' or 'year' for the billing period (optional)
59
+ payInAdvanceQuantities: { // pre-fill pay-in-advance quantities, keyed by feature id (optional)
60
+ feat_cns2asuKAG2: 3, // "feat_cns2asuKAG2" is a feature id, 3 is the quantity
61
+ },
59
62
  skipped: {
60
63
  planStage: true, // if true, skip Plan selection
61
- addOnStage: true // if true, skip Add-on selection
62
- }
63
- hideSkipped: true // if true, hide skipped stages from breadcrumb navigation
64
+ addOnStage: true, // if true, skip Add-on selection
65
+ usageStage: true, // if true, skip the pay-in-advance Quantity stage
66
+ addOnUsageStage: true, // if true, skip the add-on Quantity stage
67
+ },
68
+ hideSkipped: true, // if true, hide skipped stages from breadcrumb navigation
64
69
  };
65
70
 
66
71
  initializeWithPlan(config);
67
72
  ```
68
73
 
74
+ `payInAdvanceQuantities` only applies to entitlements with pay-in-advance
75
+ pricing; entries for other (or unknown) features are ignored. Combine it with
76
+ `skipped.usageStage` / `skipped.addOnUsageStage` to send the customer straight to
77
+ the final checkout step with the quantities already set.
78
+
69
79
  The Plans and Add-ons available to the checkout flows must be live in your
70
80
  Schematic account [Catalog configuration](https://docs.schematichq.com/catalog/overview).
71
81