@commet/node 9.4.0 → 9.6.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.
Files changed (197) hide show
  1. package/dist/index.d.mts +41 -41
  2. package/dist/index.d.ts +41 -41
  3. package/dist/index.js +3 -3
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +3 -3
  6. package/dist/index.mjs.map +1 -1
  7. package/docs/ai-onboarding/ai-onboarding.md +2 -3
  8. package/docs/ai-onboarding/billing-best-practices-skill.md +2 -3
  9. package/docs/ai-onboarding/commet-skill.md +4 -5
  10. package/docs/ai-onboarding/mcp-server.md +8 -9
  11. package/docs/ai-onboarding/pricing-models-skill.md +2 -3
  12. package/docs/ai-onboarding/subscription-patterns-skill.md +2 -3
  13. package/docs/api-reference/offers.md +2 -2
  14. package/docs/api-reference/plans.md +1 -1
  15. package/docs/api-reference/promo-codes.md +3 -3
  16. package/docs/api-reference/subscriptions.md +4 -4
  17. package/docs/documentation/api-versioning.md +2 -2
  18. package/docs/documentation/better-auth.md +0 -1
  19. package/docs/documentation/choose-a-billing-model.md +14 -8
  20. package/docs/documentation/cli.md +14 -15
  21. package/docs/documentation/create-api-key.md +0 -1
  22. package/docs/documentation/customers/customer-credits.md +0 -1
  23. package/docs/documentation/customers/customer-portal.md +14 -2
  24. package/docs/documentation/customers/manage-customers.md +1 -2
  25. package/docs/documentation/error-handling.md +1 -2
  26. package/docs/documentation/examples.md +0 -1
  27. package/docs/documentation/finance/acceptable-use.md +0 -1
  28. package/docs/documentation/finance/finance-overview.md +0 -1
  29. package/docs/documentation/finance/local-currency-taxes.md +0 -1
  30. package/docs/documentation/finance/merchant-of-record.md +0 -1
  31. package/docs/documentation/finance/payouts-verification.md +6 -3
  32. package/docs/documentation/finance/payouts.md +0 -1
  33. package/docs/documentation/finance/supported-countries.md +0 -1
  34. package/docs/documentation/go/integrate-with-encore.md +7 -8
  35. package/docs/documentation/go/integrate-with-go.md +8 -9
  36. package/docs/documentation/introduction.md +3 -4
  37. package/docs/documentation/invoicing/handle-failed-payments.md +9 -4
  38. package/docs/documentation/invoicing/invoices-and-billing-cycles.md +10 -10
  39. package/docs/documentation/invoicing/manage-invoices.md +0 -1
  40. package/docs/documentation/java/integrate-with-java.md +6 -7
  41. package/docs/documentation/nodejs/integrate-with-astro.md +6 -7
  42. package/docs/documentation/nodejs/integrate-with-bun.md +6 -7
  43. package/docs/documentation/nodejs/integrate-with-express.md +7 -8
  44. package/docs/documentation/nodejs/integrate-with-hono.md +7 -8
  45. package/docs/documentation/nodejs/integrate-with-nextjs.md +6 -7
  46. package/docs/documentation/nodejs/integrate-with-nuxt.md +6 -7
  47. package/docs/documentation/nodejs/integrate-with-remix.md +6 -7
  48. package/docs/documentation/nodejs/integrate-with-sveltekit.md +6 -7
  49. package/docs/documentation/payments/accept-one-time-payments.md +0 -1
  50. package/docs/documentation/payments/payment-orchestration.md +0 -1
  51. package/docs/documentation/payments/payment-providers.md +0 -1
  52. package/docs/documentation/payments/transactions-refunds-and-retries.md +2 -1
  53. package/docs/documentation/php/integrate-with-laravel.md +8 -9
  54. package/docs/documentation/php/integrate-with-php.md +6 -7
  55. package/docs/documentation/php/integrate-with-symfony.md +7 -8
  56. package/docs/documentation/plans/add-ons.md +0 -1
  57. package/docs/documentation/plans/balance-and-top-ups.md +1 -2
  58. package/docs/documentation/plans/configure-features.md +0 -1
  59. package/docs/documentation/plans/consumption-models.md +7 -8
  60. package/docs/documentation/plans/create-plans.md +0 -1
  61. package/docs/documentation/plans/credit-packs.md +0 -1
  62. package/docs/documentation/plans/one-time-payments.md +0 -1
  63. package/docs/documentation/plans/plan-groups.md +0 -1
  64. package/docs/documentation/platform/custom-domains.md +0 -1
  65. package/docs/documentation/platform/dashboard-metrics-and-events.md +0 -1
  66. package/docs/documentation/platform/members-and-permissions.md +0 -1
  67. package/docs/documentation/platform/organization-settings.md +0 -1
  68. package/docs/documentation/python/integrate-with-django.md +8 -9
  69. package/docs/documentation/python/integrate-with-fastapi.md +8 -9
  70. package/docs/documentation/python/integrate-with-flask.md +8 -9
  71. package/docs/documentation/python/integrate-with-python.md +6 -7
  72. package/docs/documentation/sales/card-promotions.md +0 -1
  73. package/docs/documentation/sales/introductory-offers.md +0 -1
  74. package/docs/documentation/sales/offers.md +0 -1
  75. package/docs/documentation/sales/promo-codes.md +19 -5
  76. package/docs/documentation/sales/promotional-offers.md +1 -2
  77. package/docs/documentation/sales/regional-prices.md +0 -1
  78. package/docs/documentation/sales/trial-periods.md +8 -8
  79. package/docs/documentation/sdk-reference.md +1 -2
  80. package/docs/documentation/subscriptions/manage-subscriptions.md +2 -1
  81. package/docs/documentation/subscriptions/plan-grants.md +0 -1
  82. package/docs/documentation/subscriptions/upgrade-and-downgrade-plans.md +0 -1
  83. package/docs/documentation/testing-sandbox.md +0 -1
  84. package/docs/documentation/usage/ai-token-billing.md +0 -1
  85. package/docs/documentation/usage/quota-management.md +0 -1
  86. package/docs/documentation/usage/seat-management.md +0 -1
  87. package/docs/documentation/usage/track-usage.md +0 -1
  88. package/docs/knowledge-base/how-do-balance-and-top-ups-work.md +1 -2
  89. package/docs/knowledge-base/how-do-credits-credit-packs-and-customer-credits-differ.md +0 -1
  90. package/docs/knowledge-base/how-do-discounts-work.md +0 -1
  91. package/docs/knowledge-base/how-do-free-plans-work-without-payment.md +8 -9
  92. package/docs/knowledge-base/how-do-monthly-quarterly-and-yearly-billing-work.md +6 -7
  93. package/docs/knowledge-base/how-do-offers-promo-codes-and-card-promotions-work-together.md +0 -1
  94. package/docs/knowledge-base/how-do-trial-periods-work.md +0 -1
  95. package/docs/knowledge-base/how-does-billing-work.md +0 -1
  96. package/docs/knowledge-base/how-does-payment-routing-work.md +0 -1
  97. package/docs/knowledge-base/how-does-quota-based-billing-work.md +0 -1
  98. package/docs/knowledge-base/how-does-seat-based-billing-work.md +0 -1
  99. package/docs/knowledge-base/how-is-proration-calculated-when-changing-plans.md +1 -2
  100. package/docs/knowledge-base/what-happens-when-a-customer-changes-plans.md +2 -1
  101. package/docs/knowledge-base/what-happens-when-a-payment-fails.md +0 -1
  102. package/docs/knowledge-base/what-happens-when-you-change-your-prices.md +0 -1
  103. package/docs/knowledge-base/what-happens-when-you-refund-or-retry-a-transaction.md +0 -1
  104. package/docs/knowledge-base/what-invoices-do-customers-receive-and-when.md +13 -14
  105. package/docs/manifest.json +72 -157
  106. package/docs/platform-documentation.md +69 -155
  107. package/docs/schemas.md +10 -9
  108. package/docs/webhooks/introduction.md +0 -1
  109. package/docs/webhooks.md +2 -0
  110. package/docs/webhooks.openapi.json +11058 -0
  111. package/package.json +1 -1
  112. package/docs/ai-onboarding/meta.json +0 -17
  113. package/docs/api-reference/meta.json +0 -7
  114. package/docs/documentation/customers/meta.json +0 -5
  115. package/docs/documentation/finance/meta.json +0 -13
  116. package/docs/documentation/go/meta.json +0 -5
  117. package/docs/documentation/invoicing/meta.json +0 -9
  118. package/docs/documentation/java/meta.json +0 -5
  119. package/docs/documentation/meta.json +0 -36
  120. package/docs/documentation/nodejs/meta.json +0 -14
  121. package/docs/documentation/payments/meta.json +0 -10
  122. package/docs/documentation/php/meta.json +0 -9
  123. package/docs/documentation/plans/meta.json +0 -14
  124. package/docs/documentation/platform/meta.json +0 -10
  125. package/docs/documentation/python/meta.json +0 -10
  126. package/docs/documentation/sales/meta.json +0 -13
  127. package/docs/documentation/subscriptions/meta.json +0 -9
  128. package/docs/documentation/usage/meta.json +0 -10
  129. package/docs/knowledge-base/meta.json +0 -29
  130. package/docs/meta.json +0 -11
  131. package/docs/webhooks/addon-activated.md +0 -44
  132. package/docs/webhooks/addon-deactivated.md +0 -40
  133. package/docs/webhooks/balance-depleted.md +0 -37
  134. package/docs/webhooks/balance-low.md +0 -39
  135. package/docs/webhooks/balance-topped-up.md +0 -41
  136. package/docs/webhooks/checkout-ready.md +0 -43
  137. package/docs/webhooks/credits-depleted.md +0 -35
  138. package/docs/webhooks/credits-expired.md +0 -35
  139. package/docs/webhooks/credits-granted.md +0 -37
  140. package/docs/webhooks/credits-low.md +0 -39
  141. package/docs/webhooks/credits-purchased.md +0 -41
  142. package/docs/webhooks/customer-created.md +0 -49
  143. package/docs/webhooks/customer-state-changed.md +0 -134
  144. package/docs/webhooks/customer-updated.md +0 -49
  145. package/docs/webhooks/invoice-created.md +0 -45
  146. package/docs/webhooks/invoice-overdue.md +0 -53
  147. package/docs/webhooks/invoice-upcoming.md +0 -43
  148. package/docs/webhooks/invoice-voided.md +0 -53
  149. package/docs/webhooks/meta.json +0 -89
  150. package/docs/webhooks/payment-dispute-resolved.md +0 -52
  151. package/docs/webhooks/payment-disputed.md +0 -49
  152. package/docs/webhooks/payment-failed.md +0 -178
  153. package/docs/webhooks/payment-link-canceled.md +0 -41
  154. package/docs/webhooks/payment-link-completed.md +0 -89
  155. package/docs/webhooks/payment-link-created.md +0 -41
  156. package/docs/webhooks/payment-link-failed.md +0 -87
  157. package/docs/webhooks/payment-method-attached.md +0 -44
  158. package/docs/webhooks/payment-method-updated.md +0 -37
  159. package/docs/webhooks/payment-received.md +0 -202
  160. package/docs/webhooks/payment-recovered.md +0 -43
  161. package/docs/webhooks/payment-refunded.md +0 -47
  162. package/docs/webhooks/payment-retry-failed.md +0 -39
  163. package/docs/webhooks/payout-available.md +0 -33
  164. package/docs/webhooks/payout-created.md +0 -48
  165. package/docs/webhooks/payout-failed.md +0 -52
  166. package/docs/webhooks/payout-paid.md +0 -48
  167. package/docs/webhooks/plan-grant-created.md +0 -74
  168. package/docs/webhooks/plan-grant-expired.md +0 -86
  169. package/docs/webhooks/plan-grant-revoked.md +0 -86
  170. package/docs/webhooks/plan-grant-updated.md +0 -86
  171. package/docs/webhooks/quota-exceeded.md +0 -44
  172. package/docs/webhooks/quota-threshold-reached.md +0 -41
  173. package/docs/webhooks/seats-limit-reached.md +0 -39
  174. package/docs/webhooks/seats-updated.md +0 -39
  175. package/docs/webhooks/subscription-activated.md +0 -43
  176. package/docs/webhooks/subscription-canceled.md +0 -58
  177. package/docs/webhooks/subscription-cancellation-revoked.md +0 -37
  178. package/docs/webhooks/subscription-cancellation-scheduled.md +0 -45
  179. package/docs/webhooks/subscription-created.md +0 -35
  180. package/docs/webhooks/subscription-past-due.md +0 -43
  181. package/docs/webhooks/subscription-pause-revoked.md +0 -27
  182. package/docs/webhooks/subscription-pause-scheduled.md +0 -35
  183. package/docs/webhooks/subscription-pause-updated.md +0 -31
  184. package/docs/webhooks/subscription-paused.md +0 -35
  185. package/docs/webhooks/subscription-plan-change-revoked.md +0 -50
  186. package/docs/webhooks/subscription-plan-change-scheduled.md +0 -55
  187. package/docs/webhooks/subscription-plan-changed.md +0 -43
  188. package/docs/webhooks/subscription-reactivated.md +0 -53
  189. package/docs/webhooks/subscription-resume-failed.md +0 -33
  190. package/docs/webhooks/subscription-resumed.md +0 -35
  191. package/docs/webhooks/subscription-updated.md +0 -39
  192. package/docs/webhooks/trial-checkout-ready.md +0 -39
  193. package/docs/webhooks/trial-converted.md +0 -39
  194. package/docs/webhooks/trial-expired.md +0 -39
  195. package/docs/webhooks/trial-started.md +0 -46
  196. package/docs/webhooks/trial-will-end.md +0 -41
  197. package/docs/webhooks/usage-recorded.md +0 -41
@@ -1,5 +1,4 @@
1
1
  ---
2
- lastModified: 2026-07-31
3
2
  title: Integrate with Go
4
3
  description: Add billing and payments to your Go application using net/http.
5
4
  ---
@@ -10,12 +9,12 @@ Install the Commet Skill so your coding agent can integrate the current SDK and
10
9
  npx skills add commet-labs/skills --skill commet
11
10
  ```
12
11
 
13
- 1. ## Install
12
+ 1. ### Install
14
13
  ```bash
15
14
  go get github.com/commet-labs/commet-go/v9
16
15
  ```
17
16
 
18
- 2. ## Configure
17
+ 2. ### Configure
19
18
  ```bash title=".env"
20
19
  COMMET_API_KEY=ck_sandbox_xxx
21
20
  COMMET_WEBHOOK_SECRET=whsec_xxx
@@ -42,7 +41,7 @@ npx skills add commet-labs/skills --skill commet
42
41
  ```
43
42
  There is no environment option on the client: sandbox vs live is decided by the organization the API key belongs to.
44
43
 
45
- 3. ## Subscribe
44
+ 3. ### Subscribe
46
45
  ```go title="billing/handlers.go"
47
46
  package billing
48
47
 
@@ -94,7 +93,7 @@ npx skills add commet-labs/skills --skill commet
94
93
  }
95
94
  ```
96
95
 
97
- 4. ## Check Access
96
+ 4. ### Check Access
98
97
  ```go title="billing/handlers.go"
99
98
  func GetSubscription(w http.ResponseWriter, r *http.Request) {
100
99
  customerID := r.PathValue("customerID")
@@ -133,7 +132,7 @@ npx skills add commet-labs/skills --skill commet
133
132
  }
134
133
  ```
135
134
 
136
- 5. ## Track Usage
135
+ 5. ### Track Usage
137
136
  ```go title="billing/handlers.go"
138
137
  func float64Ptr(value float64) *float64 { return &value }
139
138
 
@@ -164,7 +163,7 @@ npx skills add commet-labs/skills --skill commet
164
163
  ```
165
164
  Usage is aggregated and billed at end of period.
166
165
 
167
- 6. ## Customer Portal
166
+ 6. ### Customer Portal
168
167
  ```go title="billing/handlers.go"
169
168
  func Portal(w http.ResponseWriter, r *http.Request) {
170
169
  customerID := "user_123"
@@ -180,7 +179,7 @@ npx skills add commet-labs/skills --skill commet
180
179
  }
181
180
  ```
182
181
 
183
- 7. ## Webhooks
182
+ 7. ### Webhooks
184
183
  ```go title="billing/webhooks.go"
185
184
  package billing
186
185
 
@@ -220,7 +219,7 @@ npx skills add commet-labs/skills --skill commet
220
219
  }
221
220
  ```
222
221
 
223
- 8. ## Start Server
222
+ 8. ### Start Server
224
223
  ```go title="main.go"
225
224
  package main
226
225
 
@@ -1,5 +1,4 @@
1
1
  ---
2
- lastModified: 2026-09-07
3
2
  title: Introduction
4
3
  description: Measure consumption, manage subscriptions, and accept payments for your SaaS or AI product with Commet.
5
4
  ---
@@ -8,8 +7,8 @@ Commet is a billing and payments platform for SaaS and AI products. It connects
8
7
 
9
8
  You define what you sell and how you price it. Commet manages the billing cycle, invoices, and payment flows. Your application reports consumption and uses Commet's access checks and events to decide what each customer can do.
10
9
 
11
- - [**Quickstart**](/docs/choose-a-billing-model)
12
- - [**Build with an agent**](/docs/mcp-server)
10
+ - [**Quickstart**](/docs/choose-a-billing-model) — Go from creating an account to your first subscription and test payment.
11
+ - [**Build with an agent**](/docs/mcp-server) — Connect your assistant to Commet's documentation and API through MCP.
13
12
 
14
13
  ## What can you build with Commet?
15
14
 
@@ -67,7 +66,7 @@ Using Better Auth? The [Commet plugin](/docs/better-auth) connects customer crea
67
66
 
68
67
  ### Tools for developers and agents
69
68
 
70
- The [CLI](/docs/cli) lets you manage Commet from your terminal and work with billing configuration as code. The [REST API reference](/docs/api-reference) documents the endpoints available to your own tools and integrations.
69
+ The [CLI](/docs/cli) lets you manage Commet from your terminal and work with billing configuration as code. The [REST API reference](/docs/api-reference/overview) documents the endpoints available to your own tools and integrations.
71
70
 
72
71
  For an AI coding assistant, install the [Commet skill](/docs/commet-skill) for integration guidance. Connect the [MCP server](/docs/mcp-server) when the assistant also needs to read documentation and work with resources in your organization. The skill provides guidance; MCP provides access to tools.
73
72
 
@@ -1,5 +1,4 @@
1
1
  ---
2
- lastModified: 2026-07-28
3
2
  title: Handle Failed Payments
4
3
  description: What happens when a customer's payment fails and how they can reactivate from the Customer Portal.
5
4
  ---
@@ -33,9 +32,15 @@ Initial checkout card declines do not emit `payment.failed`; the checkout respon
33
32
 
34
33
  Retries run on day 1, day 3, day 5, and day 7 after the original failure (4 retries). The calendar is anchored to the failure and never moves. After the last failed retry the subscription is canceled.
35
34
 
36
- Manual retries — from the Customer Portal or [`reactivate`](#retry-the-charge-server-to-server) — count against the same calendar: a declined manual retry consumes the next scheduled slot. Four declined retries cancel the subscription even before day 7.
35
+ Manual retries from the Customer Portal or [`reactivate`](#retry-the-charge-server-to-server) use the default payment method and have separate daily limits. They do not consume automatic retry slots or start another charge while an automatic retry is in progress.
37
36
 
38
- Retries use the payment connection already associated with the subscription. Changing country routing does not move the retry to another provider, and Commet does not silently switch a saved payment method to a different account.
37
+ ### Saved payment methods
38
+
39
+ Commet first tries the default saved method on the subscription's payment connection. After a confirmed decline, it tries the other available methods on that connection, newest first. OXXO is excluded from these retries. Changing country routing does not change the connection used for these retries.
40
+
41
+ Trying several methods counts as one scheduled retry. Commet stops when a payment succeeds. If a result is pending or unknown, it waits for that result before trying another method.
42
+
43
+ A successful charge with another method does not change the customer's default payment method.
39
44
 
40
45
  ## Dunning communications
41
46
 
@@ -217,7 +222,7 @@ Customers in `past_due` see their subscription in the [Customer Portal](/docs/cu
217
222
  - **Retry with their current card** — useful when the failure was temporary (insufficient funds that are now available, a bank hold that cleared).
218
223
  - **Update their payment method** — enter a new card through the subscription's payment provider and retry in the same step.
219
224
 
220
- A successful retry settles the outstanding invoice, moves the subscription back to `active`, and emits a `payment.recovered` event. A declined retry consumes the next slot on the dunning calendar. Retry attempts are rate-limited to 3 per day per customer.
225
+ A successful retry settles the outstanding invoice, moves the subscription back to `active`, and emits a `payment.recovered` event. A declined manual retry preserves the automatic dunning calendar. Retry attempts are rate-limited to 3 per day per customer.
221
226
 
222
227
  ## Prompt payment update
223
228
 
@@ -1,5 +1,4 @@
1
1
  ---
2
- lastModified: 2026-07-10
3
2
  title: Invoices and Billing Cycles
4
3
  description: How Commet generates invoices, what they contain, and when customers are charged.
5
4
  ---
@@ -11,7 +10,7 @@ Invoices are the financial records Commet generates automatically whenever a sub
11
10
  | Type | When Generated | Example |
12
11
  | --------------------- | ------------------------------------------------------- | ------------------------------------------ |
13
12
  | **Recurring** | Every billing cycle | $99 plan base + $12.50 overage |
14
- | **Overage** | Between cycles (quarterly/yearly only) | 15k extra API calls billed monthly |
13
+ | **Overage** | Between cycles (quarterly, semiannual, and yearly only) | 15k extra API calls billed monthly |
15
14
  | **Plan change** | Customer upgrades mid-cycle | Starter to Pro, prorated $45 |
16
15
  | **Credit purchase** | Customer buys a credit pack | 500 credits for $40 |
17
16
  | **Balance top-up** | Customer adds funds | $50 balance top-up |
@@ -51,15 +50,16 @@ Each invoice is made of typed lines. The line type tells you what the charge is
51
50
 
52
51
  ## Billing intervals
53
52
 
54
- | Interval | Base Invoice | Overage Invoice | Consumption Reset | Example |
55
- | ------------- | ------------------------- | --------------------------------- | ----------------- | ------------------------------------ |
56
- | **Weekly** | Every 7 days | Included in recurring invoice | Every 7 days | $25/week every Monday |
57
- | **Monthly** | Every month | Included in recurring invoice | Every month | $99/month on the 1st |
58
- | **Quarterly** | Every 3 months | Monthly | Every month | $297 base quarterly, overage monthly |
59
- | **Yearly** | Every 12 months | Monthly | Every month | $899 base yearly, overage monthly |
60
- | **One-time** | Single charge at checkout | At period end (if overage exists) | Never | $299 lifetime, no recurring charges |
53
+ | Interval | Base Invoice | Overage Invoice | Consumption Reset | Example |
54
+ | -------------- | ------------------------- | --------------------------------- | ----------------- | ----------------------------------------- |
55
+ | **Weekly** | Every 7 days | Included in recurring invoice | Every 7 days | $25/week every Monday |
56
+ | **Monthly** | Every month | Included in recurring invoice | Every month | $99/month on the 1st |
57
+ | **Quarterly** | Every 3 months | Monthly | Every month | $297 base quarterly, overage monthly |
58
+ | **Semiannual** | Every 6 months | Monthly | Every month | $540 base every 6 months, overage monthly |
59
+ | **Yearly** | Every 12 months | Monthly | Every month | $899 base yearly, overage monthly |
60
+ | **One-time** | Single charge at checkout | At period end (if overage exists) | Never | $299 lifetime, no recurring charges |
61
61
 
62
- For quarterly and yearly plans, overage is calculated and invoiced monthly even though the base charge is less frequent. For weekly plans, everything runs on a 7-day cycle. For one-time plans, the customer pays once at checkout and never receives a recurring invoice — only overage charges if applicable. See [One-Time Payments](/docs/one-time-payments) for details.
62
+ For quarterly, semiannual, and yearly plans, overage is calculated and invoiced monthly even though the base charge is less frequent. For weekly plans, everything runs on a 7-day cycle. For one-time plans, the customer pays once at checkout and never receives a recurring invoice — only overage charges if applicable. See [One-Time Payments](/docs/one-time-payments) for details.
63
63
 
64
64
  ## Learn more
65
65
 
@@ -1,5 +1,4 @@
1
1
  ---
2
- lastModified: 2026-08-16
3
2
  title: Manage Invoices
4
3
  description: Review invoices, create adjustments, update outstanding status, send email, and generate PDF links.
5
4
  ---
@@ -1,5 +1,4 @@
1
1
  ---
2
- lastModified: 2026-07-28
3
2
  title: Integrate with Java
4
3
  description: Install and configure the Commet Java SDK.
5
4
  ---
@@ -10,7 +9,7 @@ Install the Commet Skill so your coding agent can integrate the current SDK and
10
9
  npx skills add commet-labs/skills --skill commet
11
10
  ```
12
11
 
13
- 1. ## Install
12
+ 1. ### Install
14
13
  ### Maven
15
14
  ```xml title="pom.xml"
16
15
  <dependency>
@@ -24,7 +23,7 @@ npx skills add commet-labs/skills --skill commet
24
23
  implementation("co.commet:commet-java:9.0.0")
25
24
  ```
26
25
 
27
- 2. ## Configure
26
+ 2. ### Configure
28
27
  ```bash title=".env"
29
28
  COMMET_API_KEY=ck_sandbox_xxx
30
29
  ```
@@ -40,7 +39,7 @@ npx skills add commet-labs/skills --skill commet
40
39
  ```
41
40
  There is no environment option on the client: sandbox vs live is decided by the organization the API key belongs to.
42
41
 
43
- 3. ## Create Customer and Subscribe
42
+ 3. ### Create Customer and Subscribe
44
43
  `customers().create` is idempotent — if a customer with the same `id` already exists, it returns the existing record.
45
44
  ```java
46
45
  import co.commet.params.CreateCustomerParams;
@@ -62,7 +61,7 @@ npx skills add commet-labs/skills --skill commet
62
61
  ```
63
62
  The customer is redirected to checkout to complete payment.
64
63
 
65
- 4. ## Check Access
64
+ 4. ### Check Access
66
65
  ```java
67
66
  import co.commet.models.FeatureAccess;
68
67
  import co.commet.models.Subscription;
@@ -80,7 +79,7 @@ npx skills add commet-labs/skills --skill commet
80
79
  boolean allowed = access.allowed();
81
80
  ```
82
81
 
83
- 5. ## Track Usage
82
+ 5. ### Track Usage
84
83
  ```java
85
84
  import co.commet.params.TrackUsageParams;
86
85
 
@@ -92,7 +91,7 @@ npx skills add commet-labs/skills --skill commet
92
91
  ```
93
92
  Usage is aggregated and billed at end of period.
94
93
 
95
- 6. ## Webhooks
94
+ 6. ### Webhooks
96
95
  ```java
97
96
  import co.commet.resources.Webhooks;
98
97
  import java.util.Map;
@@ -1,5 +1,4 @@
1
1
  ---
2
- lastModified: 2026-07-28
3
2
  title: Integrate with Astro
4
3
  description: Add billing and payments to your Astro application.
5
4
  ---
@@ -14,7 +13,7 @@ npx skills add commet-labs/skills --skill commet
14
13
  >
15
14
  > Astro requires an SSR adapter for API routes. Set `output: 'server'` or `output: 'hybrid'` in your `astro.config.mjs`.
16
15
 
17
- 1. ## Install
16
+ 1. ### Install
18
17
  ### pnpm
19
18
  ```bash
20
19
  pnpm add @commet/node
@@ -32,7 +31,7 @@ npx skills add commet-labs/skills --skill commet
32
31
  bun add @commet/node
33
32
  ```
34
33
 
35
- 2. ## Configure
34
+ 2. ### Configure
36
35
  ```bash title=".env"
37
36
  COMMET_API_KEY=ck_sandbox_xxx
38
37
  ```
@@ -44,7 +43,7 @@ npx skills add commet-labs/skills --skill commet
44
43
  })
45
44
  ```
46
45
 
47
- 3. ## Subscribe
46
+ 3. ### Subscribe
48
47
  `customers.create` is idempotent — if a customer with the same `id` already exists, it returns the existing record.
49
48
  ```typescript title="src/pages/api/billing/subscribe.ts"
50
49
  import type { APIRoute } from 'astro'
@@ -64,7 +63,7 @@ npx skills add commet-labs/skills --skill commet
64
63
  }
65
64
  ```
66
65
 
67
- 4. ## Check Access
66
+ 4. ### Check Access
68
67
  ```typescript title="src/pages/api/billing/access/[customerId].ts"
69
68
  import type { APIRoute } from 'astro'
70
69
  import { commet } from '../../../../lib/commet'
@@ -88,7 +87,7 @@ npx skills add commet-labs/skills --skill commet
88
87
  }
89
88
  ```
90
89
 
91
- 5. ## Track Usage
90
+ 5. ### Track Usage
92
91
  ```typescript title="src/pages/api/billing/usage.ts"
93
92
  import type { APIRoute } from 'astro'
94
93
  import { commet } from '../../../lib/commet'
@@ -107,7 +106,7 @@ npx skills add commet-labs/skills --skill commet
107
106
  ```
108
107
  Usage is aggregated and billed at end of period.
109
108
 
110
- 6. ## Customer Portal
109
+ 6. ### Customer Portal
111
110
  ```typescript title="src/pages/api/billing/portal.ts"
112
111
  import type { APIRoute } from 'astro'
113
112
  import { commet } from '../../../lib/commet'
@@ -1,5 +1,4 @@
1
1
  ---
2
- lastModified: 2026-07-28
3
2
  title: Integrate with Bun
4
3
  description: Add billing and payments to your Bun application.
5
4
  ---
@@ -10,12 +9,12 @@ Install the Commet Skill so your coding agent can integrate the current SDK and
10
9
  npx skills add commet-labs/skills --skill commet
11
10
  ```
12
11
 
13
- 1. ## Install
12
+ 1. ### Install
14
13
  ```bash
15
14
  bun add @commet/node
16
15
  ```
17
16
 
18
- 2. ## Configure
17
+ 2. ### Configure
19
18
  ```bash title=".env"
20
19
  COMMET_API_KEY=ck_sandbox_xxx
21
20
  ```
@@ -27,7 +26,7 @@ npx skills add commet-labs/skills --skill commet
27
26
  })
28
27
  ```
29
28
 
30
- 3. ## Subscribe
29
+ 3. ### Subscribe
31
30
  ```typescript title="src/index.ts"
32
31
  import { commet } from './commet'
33
32
 
@@ -54,7 +53,7 @@ npx skills add commet-labs/skills --skill commet
54
53
  })
55
54
  ```
56
55
 
57
- 4. ## Check Access
56
+ 4. ### Check Access
58
57
  Add these routes to the `fetch` handler.
59
58
  ```typescript title="src/index.ts"
60
59
  if (url.pathname.startsWith('/subscription/') && req.method === 'GET') {
@@ -78,7 +77,7 @@ npx skills add commet-labs/skills --skill commet
78
77
  }
79
78
  ```
80
79
 
81
- 5. ## Track Usage
80
+ 5. ### Track Usage
82
81
  ```typescript title="src/index.ts"
83
82
  if (url.pathname === '/usage' && req.method === 'POST') {
84
83
  const { customerId } = await req.json()
@@ -94,7 +93,7 @@ npx skills add commet-labs/skills --skill commet
94
93
  ```
95
94
  Usage is aggregated and billed at end of period.
96
95
 
97
- 6. ## Customer Portal
96
+ 6. ### Customer Portal
98
97
  ```typescript title="src/index.ts"
99
98
  if (url.pathname === '/portal' && req.method === 'GET') {
100
99
  const customerId = url.searchParams.get('customerId')!
@@ -1,5 +1,4 @@
1
1
  ---
2
- lastModified: 2026-07-28
3
2
  title: Integrate with Express
4
3
  description: Add billing and payments to your Express application.
5
4
  ---
@@ -10,7 +9,7 @@ Install the Commet Skill so your coding agent can integrate the current SDK and
10
9
  npx skills add commet-labs/skills --skill commet
11
10
  ```
12
11
 
13
- 1. ## Install
12
+ 1. ### Install
14
13
  ### pnpm
15
14
  ```bash
16
15
  pnpm add @commet/node express
@@ -24,7 +23,7 @@ npx skills add commet-labs/skills --skill commet
24
23
  yarn add @commet/node express
25
24
  ```
26
25
 
27
- 2. ## Configure
26
+ 2. ### Configure
28
27
  ```bash title=".env"
29
28
  COMMET_API_KEY=ck_sandbox_xxx
30
29
  ```
@@ -36,7 +35,7 @@ npx skills add commet-labs/skills --skill commet
36
35
  })
37
36
  ```
38
37
 
39
- 3. ## Subscribe
38
+ 3. ### Subscribe
40
39
  ```typescript title="src/routes/billing.ts"
41
40
  import { Router } from 'express'
42
41
  import { commet } from '../commet'
@@ -59,7 +58,7 @@ npx skills add commet-labs/skills --skill commet
59
58
  export default router
60
59
  ```
61
60
 
62
- 4. ## Check Access
61
+ 4. ### Check Access
63
62
  ```typescript title="src/routes/billing.ts"
64
63
  router.get('/subscription/:customerId', async (req, res) => {
65
64
  const subscription = await commet.subscriptions.getActive({ customerId: req.params.customerId })
@@ -81,7 +80,7 @@ npx skills add commet-labs/skills --skill commet
81
80
  })
82
81
  ```
83
82
 
84
- 5. ## Track Usage
83
+ 5. ### Track Usage
85
84
  ```typescript title="src/routes/billing.ts"
86
85
  router.post('/usage', async (req, res) => {
87
86
  await commet.usage.track({
@@ -95,7 +94,7 @@ npx skills add commet-labs/skills --skill commet
95
94
  ```
96
95
  Usage is aggregated and billed at end of period.
97
96
 
98
- 6. ## Customer Portal
97
+ 6. ### Customer Portal
99
98
  ```typescript title="src/routes/billing.ts"
100
99
  router.get('/portal', async (req, res) => {
101
100
  const portal = await commet.portal.getUrl({
@@ -106,7 +105,7 @@ npx skills add commet-labs/skills --skill commet
106
105
  })
107
106
  ```
108
107
 
109
- 7. ## Start Server
108
+ 7. ### Start Server
110
109
  ```typescript title="src/index.ts"
111
110
  import express from 'express'
112
111
  import billingRoutes from './routes/billing'
@@ -1,5 +1,4 @@
1
1
  ---
2
- lastModified: 2026-07-28
3
2
  title: Integrate with Hono
4
3
  description: Add billing and payments to your Hono application.
5
4
  ---
@@ -10,7 +9,7 @@ Install the Commet Skill so your coding agent can integrate the current SDK and
10
9
  npx skills add commet-labs/skills --skill commet
11
10
  ```
12
11
 
13
- 1. ## Install
12
+ 1. ### Install
14
13
  ### pnpm
15
14
  ```bash
16
15
  pnpm add @commet/node hono
@@ -24,7 +23,7 @@ npx skills add commet-labs/skills --skill commet
24
23
  bun add @commet/node hono
25
24
  ```
26
25
 
27
- 2. ## Configure
26
+ 2. ### Configure
28
27
  ```bash title=".env"
29
28
  COMMET_API_KEY=ck_sandbox_xxx
30
29
  ```
@@ -36,7 +35,7 @@ npx skills add commet-labs/skills --skill commet
36
35
  })
37
36
  ```
38
37
 
39
- 3. ## Subscribe
38
+ 3. ### Subscribe
40
39
  ```typescript title="src/routes/billing.ts"
41
40
  import { Hono } from 'hono'
42
41
  import { commet } from '../commet'
@@ -59,7 +58,7 @@ npx skills add commet-labs/skills --skill commet
59
58
  export default billing
60
59
  ```
61
60
 
62
- 4. ## Check Access
61
+ 4. ### Check Access
63
62
  ```typescript title="src/routes/billing.ts"
64
63
  billing.get('/subscription/:customerId', async (c) => {
65
64
  const subscription = await commet.subscriptions.getActive({ customerId: c.req.param('customerId') })
@@ -81,7 +80,7 @@ npx skills add commet-labs/skills --skill commet
81
80
  })
82
81
  ```
83
82
 
84
- 5. ## Track Usage
83
+ 5. ### Track Usage
85
84
  ```typescript title="src/routes/billing.ts"
86
85
  billing.post('/usage', async (c) => {
87
86
  const { customerId } = await c.req.json()
@@ -97,7 +96,7 @@ npx skills add commet-labs/skills --skill commet
97
96
  ```
98
97
  Usage is aggregated and billed at end of period.
99
98
 
100
- 6. ## Customer Portal
99
+ 6. ### Customer Portal
101
100
  ```typescript title="src/routes/billing.ts"
102
101
  billing.get('/portal', async (c) => {
103
102
  const customerId = c.get('customerId')
@@ -108,7 +107,7 @@ npx skills add commet-labs/skills --skill commet
108
107
  })
109
108
  ```
110
109
 
111
- 7. ## Start Server
110
+ 7. ### Start Server
112
111
  ### Node.js
113
112
  ```typescript title="src/index.ts"
114
113
  import { serve } from '@hono/node-server'
@@ -1,5 +1,4 @@
1
1
  ---
2
- lastModified: 2026-07-28
3
2
  title: Integrate with Next.js
4
3
  description: Add billing and payments to your Next.js application.
5
4
  ---
@@ -10,7 +9,7 @@ Install the Commet Skill so your coding agent can integrate the current SDK and
10
9
  npx skills add commet-labs/skills --skill commet
11
10
  ```
12
11
 
13
- 1. ## Install
12
+ 1. ### Install
14
13
  ### pnpm
15
14
  ```bash
16
15
  pnpm add @commet/node @commet/next
@@ -28,7 +27,7 @@ npx skills add commet-labs/skills --skill commet
28
27
  bun add @commet/node @commet/next
29
28
  ```
30
29
 
31
- 2. ## Configure
30
+ 2. ### Configure
32
31
  ```bash title=".env.local"
33
32
  COMMET_API_KEY=ck_sandbox_xxx
34
33
  ```
@@ -40,7 +39,7 @@ npx skills add commet-labs/skills --skill commet
40
39
  })
41
40
  ```
42
41
 
43
- 3. ## Create Customer and Subscribe
42
+ 3. ### Create Customer and Subscribe
44
43
  `customers.create` is idempotent — if a customer with the same `id` already exists, it returns the existing record.
45
44
  ```typescript title="app/actions/billing.ts"
46
45
  'use server'
@@ -67,7 +66,7 @@ npx skills add commet-labs/skills --skill commet
67
66
  ```
68
67
  The customer is redirected to checkout to complete payment. When `checkoutUrl` is `null` no payment is needed and the subscription is already active.
69
68
 
70
- 4. ## Check Access
69
+ 4. ### Check Access
71
70
  ```typescript title="app/actions/billing.ts"
72
71
  export async function getSubscription(customerId: string) {
73
72
  const subscription = await commet.subscriptions.getActive({ customerId })
@@ -83,7 +82,7 @@ npx skills add commet-labs/skills --skill commet
83
82
  }
84
83
  ```
85
84
 
86
- 5. ## Track Usage
85
+ 5. ### Track Usage
87
86
  ```typescript title="app/actions/usage.ts"
88
87
  export async function trackApiCall(customerId: string) {
89
88
  await commet.usage.track({
@@ -95,7 +94,7 @@ npx skills add commet-labs/skills --skill commet
95
94
  ```
96
95
  Usage is aggregated and billed at end of period.
97
96
 
98
- 6. ## Customer Portal
97
+ 6. ### Customer Portal
99
98
  ```typescript title="app/api/commet/portal/route.ts"
100
99
  import { CustomerPortal } from '@commet/next'
101
100
 
@@ -1,5 +1,4 @@
1
1
  ---
2
- lastModified: 2026-07-28
3
2
  title: Integrate with Nuxt
4
3
  description: Add billing and payments to your Nuxt application.
5
4
  ---
@@ -10,7 +9,7 @@ Install the Commet Skill so your coding agent can integrate the current SDK and
10
9
  npx skills add commet-labs/skills --skill commet
11
10
  ```
12
11
 
13
- 1. ## Install
12
+ 1. ### Install
14
13
  ### pnpm
15
14
  ```bash
16
15
  pnpm add @commet/node
@@ -28,7 +27,7 @@ npx skills add commet-labs/skills --skill commet
28
27
  bun add @commet/node
29
28
  ```
30
29
 
31
- 2. ## Configure
30
+ 2. ### Configure
32
31
  ```bash title=".env"
33
32
  COMMET_API_KEY=ck_sandbox_xxx
34
33
  ```
@@ -50,7 +49,7 @@ npx skills add commet-labs/skills --skill commet
50
49
  })
51
50
  ```
52
51
 
53
- 3. ## Subscribe
52
+ 3. ### Subscribe
54
53
  `customers.create` is idempotent — if a customer with the same `id` already exists, it returns the existing record.
55
54
  ```typescript title="server/api/billing/subscribe.post.ts"
56
55
  export default defineEventHandler(async (event) => {
@@ -67,7 +66,7 @@ npx skills add commet-labs/skills --skill commet
67
66
  })
68
67
  ```
69
68
 
70
- 4. ## Check Access
69
+ 4. ### Check Access
71
70
  ```typescript title="server/api/billing/access/[customerId].get.ts"
72
71
  export default defineEventHandler(async (event) => {
73
72
  const customerId = getRouterParam(event, 'customerId')!
@@ -90,7 +89,7 @@ npx skills add commet-labs/skills --skill commet
90
89
  })
91
90
  ```
92
91
 
93
- 5. ## Track Usage
92
+ 5. ### Track Usage
94
93
  ```typescript title="server/api/billing/usage.post.ts"
95
94
  export default defineEventHandler(async (event) => {
96
95
  const { customerId } = await readBody(event)
@@ -106,7 +105,7 @@ npx skills add commet-labs/skills --skill commet
106
105
  ```
107
106
  Usage is aggregated and billed at end of period.
108
107
 
109
- 6. ## Customer Portal
108
+ 6. ### Customer Portal
110
109
  ```typescript title="server/api/billing/portal.get.ts"
111
110
  export default defineEventHandler(async (event) => {
112
111
  const customerId = 'user_123'
@@ -1,5 +1,4 @@
1
1
  ---
2
- lastModified: 2026-07-28
3
2
  title: Integrate with Remix
4
3
  description: Add billing and payments to your Remix application.
5
4
  ---
@@ -10,7 +9,7 @@ Install the Commet Skill so your coding agent can integrate the current SDK and
10
9
  npx skills add commet-labs/skills --skill commet
11
10
  ```
12
11
 
13
- 1. ## Install
12
+ 1. ### Install
14
13
  ### pnpm
15
14
  ```bash
16
15
  pnpm add @commet/node @remix-run/node
@@ -28,7 +27,7 @@ npx skills add commet-labs/skills --skill commet
28
27
  bun add @commet/node @remix-run/node
29
28
  ```
30
29
 
31
- 2. ## Configure
30
+ 2. ### Configure
32
31
  ```bash title=".env"
33
32
  COMMET_API_KEY=ck_sandbox_xxx
34
33
  ```
@@ -41,7 +40,7 @@ npx skills add commet-labs/skills --skill commet
41
40
  })
42
41
  ```
43
42
 
44
- 3. ## Subscribe
43
+ 3. ### Subscribe
45
44
  `customers.create` is idempotent — if a customer with the same `id` already exists, it returns the existing record.
46
45
  ```typescript title="app/routes/billing.subscribe.ts"
47
46
  import { json, redirect, type ActionFunctionArgs } from '@remix-run/node'
@@ -68,7 +67,7 @@ npx skills add commet-labs/skills --skill commet
68
67
  }
69
68
  ```
70
69
 
71
- 4. ## Check Access
70
+ 4. ### Check Access
72
71
  ```typescript title="app/routes/billing.status.ts"
73
72
  import { json, type LoaderFunctionArgs } from '@remix-run/node'
74
73
  import { commet } from '~/lib/commet.server'
@@ -95,7 +94,7 @@ npx skills add commet-labs/skills --skill commet
95
94
  }
96
95
  ```
97
96
 
98
- 5. ## Track Usage
97
+ 5. ### Track Usage
99
98
  ```typescript title="app/routes/billing.usage.ts"
100
99
  import { json, type ActionFunctionArgs } from '@remix-run/node'
101
100
  import { commet } from '~/lib/commet.server'
@@ -114,7 +113,7 @@ npx skills add commet-labs/skills --skill commet
114
113
  ```
115
114
  Usage is aggregated and billed at end of period.
116
115
 
117
- 6. ## Customer Portal
116
+ 6. ### Customer Portal
118
117
  ```typescript title="app/routes/billing.portal.ts"
119
118
  import { redirect, type LoaderFunctionArgs } from '@remix-run/node'
120
119
  import { commet } from '~/lib/commet.server'