How it works
- You register an endpoint URL in the Commet dashboard
- You select which events you want to receive
- When an event occurs, Commet sends a
POSTrequest to your URL with the event data
Local development
Use the Commet CLI to forward webhook events to your local server in real time — no tunneling tools needed:--events:
COMMET_WEBHOOK_SECRET in your .env to verify signatures locally with the same code you’ll use in production.
Payload structure
Every webhook delivers a JSON payload with this envelope:
The same event is retried with the same
id when your endpoint doesn’t respond with a 2xx, so store processed ids and skip duplicates.
Handling webhooks
Receive events by exposing an HTTP endpoint. The Node.js SDK ships a dedicated Next.js handler that verifies signatures and routes events automatically; in other languages, verify the payload and dispatch onevent.
- Node.js
- Python
- Go
- Java
- PHP
app/api/webhooks/commet/route.ts
Verifying signatures manually
If you’re not using@commet/next, verify the HMAC-SHA256 signature yourself with the SDK:
- Node.js
- Python
- Go
- Java
- PHP
Headers
Commet sends these headers with every webhook request:Retry policy
If your endpoint returns a non-2xx status or times out (10 seconds), Commet retries with exponential backoff capped at 1 hour. The initial delivery counts as the first attempt, followed by up to 7 retries — 8 attempts in total over a window of roughly 4 hours:
After 8 failed attempts (the initial delivery plus 7 retries), the delivery is marked as failed and we email your organization’s notification recipient with the endpoint URL, event type, and the last response we received (HTTP status or error code).
Auto-disable for broken endpoints
If three events in a row fail to deliver, Commet automatically disables the endpoint so it stops consuming retries. You’ll get a second email confirming the endpoint was turned off. Once you’ve fixed the issue on your receiver, re-enable the endpoint from the Commet dashboard under Settings → Webhooks → Endpoints. Events that arrived while the endpoint was disabled are not replayed automatically — contact support if you need to backfill any missed events. You can monitor delivery status, inspect payloads, and retry individual deliveries from the dashboard at any time.Subscription status lifecycle
Everysubscription.* webhook includes a status field. These are the valid values and which ones grant access to your product:
Typical flow:
- Without a trial,
pending_paymentgoes straight toactivewhen the first charge confirms; with one, it goes totrialing. trialing → activehappens when the trial converts — and also when it expires: trial expiry activates the subscription and regular billing begins.active ⇄ past_due: a failed renewal starts dunning; a recovered payment returns the subscription toactive.canceledis terminal, reached when a scheduled cancellation executes at period end or when dunning exhausts its retries.
status === "active" || status === "trialing". Rely on subscription.activated to turn access on and subscription.canceled to turn it off.