hubspot-webhook-handlers
Build and harden HubSpot v3 webhook handlers that survive production: HMAC-SHA256 signature verification, Redis SET NX deduplication, async batch processing with immediate 200 ACK, dead-letter queuing for permanent failures, and event-ordering guards for property-change streams. Use when implementing HubSpot webhooks for the first time, hardening an existing handler against retry storms or duplicate processing, debugging signature verification failures, or designing a reliable event pipeline for contact, company, or deal change events. Trigger with "hubspot webhook", "hubspot signature verif
npx skills add jeremylongshore/claude-code-plugins-plus-skills --skill hubspot-webhook-handlers --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Guides building HubSpot v3 webhook handlers that survive production failures. It covers: verifying HMAC-SHA256 signatures, using Redis SET NX for per-event deduplication, immediately acknowledging webhooks and processing in the background via a queue, routing permanently failed events to a dead-letter queue, guarding property-change event ordering, and handling list-membership subscriptions separately to avoid scope mismatches. It provides concrete code patterns and prerequisites for Node.js/TypeScript or Python environments and outlines how to wire these pieces together in production-grade webhook pipelines.
How it works
- Signature verification: Uses HMAC-SHA256 over a string composed of the HTTP method, full request URI, raw body, and timestamp. Requires the raw body to be preserved (express.raw) and compares the computed hex digest against X-HubSpot-Signature-v3 in a timing-safe way. If headers are missing or timestamp is stale, responds with 403 and an error. On success, attaches parsed hubspot events to the request for downstream use.
- Redis SET NX deduplication: Each event has a unique eventId. Performs a SET with NX and a 24-hour TTL to determine if an event is new. If the key already exists, the event is skipped; if new, the handler processes it and, on transient failure, deletes the key to allow retries.
- Immediate ACK with async batch processing: For batch deliveries, responds with 200 immediately and enqueues each event to a BullMQ queue for background processing. The queue uses per-event jobs with dedup and retries configured.
- Dead-letter queue: Uses BullMQ worker failed handling to route permanently failed jobs to a DLQ store, and emits an alert. Includes a replay pattern that re-enqueues DLQ items after clearing dedup keys.
- Property change ordering guard: Applies property-change updates only if the incoming occurredAt is newer than the last applied version, stored in Redis, thus preventing older values from overwriting newer ones. Keeps a TTL to survive burst retries.
- List-membership subscription: Documents that list-membership changes require separate subscriptions, since lifecyclestage changes delivered via contact.propertyChange do not include membership events.
When to use it
Use when implementing HubSpot webhooks for the first time, hardening an existing handler against retry storms or duplicate processing, debugging signature verification failures, or designing a reliable event pipeline for contact, company, or deal change events. Trigger phrases include: hubspot webhook, hubspot signature verification, hubspot webhook dedup, hubspot webhook retry storm, hubspot event handler, hubspot property change webhook, hubspot list membership webhook, hubspot dead letter queue.
What it can touch
- Redis (SET NX deduplication, property-change versioning, DLQ state)
- BullMQ queue (hubspot-events) for asynchronous processing
- Express raw body capture for signature verification
- Optional logging and alerting on failures
- Environment variables HUBSPOT_CLIENT_SECRET, Redis connection details
Caveats
- Requires proper middleware ordering to preserve raw body for signature verification.
- DLQ handling relies on BullMQ failure events and a Redis-backed store for DLQ records.
- List-membership events require separate subscription setup via HubSpot webhook API; lifecyclestage changes alone do not deliver list membership changes.
- Standardized error responses follow the explicit error keys used in the instructions (e.g., missing_signature, timestamp_out_of_window, invalid_signature, misconfigured_middleware).
# HubSpot Webhook Handlers ## Overview Receive and process HubSpot webhook events reliably at production scale. This is not a walkthrough for getting your first event — it is the handler code your integration runs when HubSpot delivers 100 events in a single payload at 2am, when a misconfigured proxy silently strips your signature header, when a 3-day outage causes events to arrive in a burst afte
What does the hubspot-webhook-handlers skill do?
Build and harden HubSpot v3 webhook handlers that survive production: HMAC-SHA256 signature verification, Redis SET NX deduplication, async batch processing with immediate 200 ACK, dead-letter queuing for permanent failures, and event-ordering guards for property-change streams. Use when implementing HubSpot webhooks for the first time, hardening an existing handler against retry storms or duplicate processing, debugging signature verification failures, or designing a reliable event pipeline for contact, company, or deal change events. Trigger with "hubspot webhook", "hubspot signature verif
How do I install it?
Run `npx skills add jeremylongshore/claude-code-plugins-plus-skills --skill hubspot-webhook-handlers --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From jeremylongshore/claude-code-plugins-plus-skills, a repository with 2,596 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
