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

/klaviyo-migration-deep-dive

@0d57af8
Run it yourself

Use when you are moving an email/CDP stack onto Klaviyo — off the deprecated v1/v2 APIs, off a competitor ESP (Mailchimp, SendGrid), or re-platforming gradually with the strangler fig pattern — and need field mapping, batch import, and post-migration validation. Trigger with phrases like "migrate to klaviyo", "klaviyo migration", "switch to klaviyo", "klaviyo replatform", "mailchimp to klaviyo", "legacy to klaviyo", "v1 to v2 klaviyo".

Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/klaviyo-migration-deep-dive

Nothing lands on disk. Nothing to clean up.

Fork this Skill

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

referencesexamples.md

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

Klaviyo Migration — Worked Examples

Concrete end-to-end runs that stitch the building blocks in implementation.md together. Each example is a scenario you can adapt directly.

Example 1: Mailchimp export → Klaviyo import

Take a Mailchimp CSV export, drop the suppressed contacts, and batch-import the rest with progress tracking and rate limiting.

import { ApiKeySession, ProfilesApi } from 'klaviyo-api';

const session = new ApiKeySession(process.env.KLAVIYO_PRIVATE_KEY!);
const profilesApi = new ProfilesApi(session);

// contacts loaded from the Mailchimp export and typed as CompetitorContact[]
// (see implementation.md Step 3 for the interface + transformToKlaviyo/migrateContacts)
const contacts: CompetitorContact[] = loadMailchimpExport('./mailchimp-export.csv');

const result = await migrateContacts(contacts);

console.log(`Imported: ${result.imported}`);
console.log(`Skipped (suppressed): ${result.skipped}`);
console.log(`Failed: ${result.failed.length}`);
if (result.failed.length) {
  console.log('Retry these emails:', result.failed);
}

Expected console output for a 10,000-contact list with 1,200 unsubscribed:

Progress: 50/10000 (48 imported, 2 skipped)
Progress: 100/10000 (95 imported, 5 skipped)
...
Progress: 10000/10000 (8800 imported, 1200 skipped)
Imported: 8800
Skipped (suppressed): 1200
Failed: 0

Example 2: Cut over v1 identify calls to createOrUpdateProfile

Before (deprecated v1 identify):

// POST https://a.klaviyo.com/api/identify
// Body: { token: PUBLIC_KEY, properties: { $email, $first_name, plan } }

After (current REST API — note the field renames from the Step 2 mapping table):

await profilesApi.createOrUpdateProfile({
  data: {
    type: 'profile',
    attributes: {
      email: 'user@example.com',   // was $email
      firstName: 'Jane',           // was $first_name
      properties: { plan: 'pro' }, // custom props unchanged
    },
  },
});

Example 3: Gate the cutover behind a feature flag

Route 10% of event traffic to Klaviyo while keeping campaigns on the legacy system until the flag reaches 100% (see the MigrationRouter in implementation.md Step 4).

const router = new MigrationRouter(
  legacyService,
  klaviyoService,
  () => Number(process.env.KLAVIYO_ROLLOUT_PCT ?? '0')  // start at 0, raise gradually
);

// KLAVIYO_ROLLOUT_PCT=10 → ~10% of events go to Klaviyo, campaigns stay legacy
await router.trackEvent({ metric: 'Placed Order', email: 'user@example.com' });

Example 4: Gate deployment on a validation pass

Run validateMigration (implementation.md Step 5) and fail the deploy if any check regresses:

const report = await validateMigration(200);
for (const check of report.checks) {
  console.log(`${check.passed ? 'PASS' : 'FAIL'}  ${check.name}: ${check.details}`);
}
if (!report.passed) {
  throw new Error('Migration validation failed — do not decommission legacy system');
}

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 comprehensive and safe technical guide for migrating data and API integrations to Klaviyo. It follows security best practices by recommending environment variables for API keys and using official SDKs. No malicious code, exfiltration patterns, or obfuscation were detected.

  • 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(npm:*)Bash(node:*)
Other metadata
compatibility
Designed for Claude Code

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/klaviyo-migration-deep-dive