Index of every page on this site: llms.txt
All skills
jeremylongshore avatar

/klaviyo-webhooks-events

@0d57af8
Run it yourself

Implement Klaviyo webhooks with HMAC-SHA256 signature verification and event handling. Use when setting up webhook endpoints, handling Klaviyo event notifications, or creating event-driven integrations with Klaviyo. Trigger with phrases like "klaviyo webhook", "klaviyo events", "klaviyo webhook signature", "handle klaviyo events", "klaviyo notifications".

Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/klaviyo-webhooks-events

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesexamples.md

≈617 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Klaviyo Webhooks — Worked Examples

Concrete end-to-end scenarios that build on the full walkthrough in implementation.md. Use these to see how the individual steps combine in real integrations, and how to exercise the endpoint locally before pointing production traffic at it.

Example 1: Sync new profiles into your own database

Subscribe to profile.created and profile.updated, then upsert each profile into your users table. This is the most common webhook use case — keeping your system-of-record in step with Klaviyo profile changes in near real time.

  1. Register the subscription (Step 1 of the walkthrough) with both topics:
webhookTopics: {
  data: [
    { type: 'webhook-topic', id: 'profile.created' },
    { type: 'webhook-topic', id: 'profile.updated' },
  ],
},
  1. The router (Step 4) already maps both topics to upsert/update handlers. A profile.created payload arrives as:
{
  "type": "profile.created",
  "data": {
    "id": "01H8XVZ...",
    "attributes": { "email": "jane@example.com", "firstName": "Jane" }
  }
}
  1. routeWebhookEvent dispatches it to the profile.created handler, which upserts { email, firstName, klaviyoProfileId } into db.users.

Example 2: Track campaign sends into analytics

Subscribe to campaign.sent. The handler in Step 4 forwards each send to your analytics pipeline:

'campaign.sent': async (data) => {
  console.log(`Campaign sent: ${data.attributes.name}`);
  await analytics.track('campaign_sent', { campaignId: data.id });
},

Because the endpoint returns 200 immediately after the router resolves and the event ID is recorded in Redis (Step 5), a Klaviyo retry of the same campaign.sent event is short-circuited by the idempotency check and never double-counted.

Testing Webhooks Locally

# 1. Start your app
npm run dev  # localhost:3000

# 2. Expose via ngrok
ngrok http 3000

# 3. Register ngrok URL as webhook endpoint in Klaviyo
# https://abc123.ngrok.io/webhooks/klaviyo

# 4. Trigger an event (e.g., create a profile) and watch your logs

A correctly wired endpoint logs the received topic, returns 200 with { received: true }, and (on a replayed event) returns { status: 'already_processed' }. An invalid signature returns 401 with { error: 'Invalid signature' } — the fastest way to confirm your signing secret matches the value from the createWebhook response.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    This skill provides a secure implementation for Klaviyo webhooks, incorporating industry-standard HMAC-SHA256 signature verification and idempotency handling using Redis. It follows security best practices by utilizing environment variables for secret management and implementing timing-safe comparisons for cryptographic checks.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: MEDIUM · 1 issue

Signed by skilld at 0d57af8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 4 months ago
What it can do
Reads files Edits files Runs commands
version
1.7.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
[
  "saas",
  "klaviyo",
  "email-marketing",
  "cdp"
]
All 5 allowed tools
ReadWriteEditBash(curl:*)Bash(npm:*)
Other metadata
compatibility
Designed for Claude Code

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/klaviyo-webhooks-events