/klaviyo-pack:klaviyo-upgrade-migrationfrom klaviyo-pack
Upgrades klaviyo-api SDK versions and migrates between Klaviyo API revisions, handling breaking changes from legacy v1/v2 APIs to the current REST API.
Ships in klaviyo-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Guide for upgrading the klaviyo-api SDK, migrating from legacy v1/v2 APIs, and
handling breaking changes between Klaviyo API revisions. The workflow assesses the
current version, surfaces breaking changes with the TypeScript compiler, applies the
matching migration pattern, and ships behind a staging deploy with a clean rollback.
Deep before/after code and the full command sequence live in references/ so this
file stays a scannable map of the workflow:
ConfigWrapper → ApiKeySession), property casing.klaviyo-api package installed and a known current version (npm list klaviyo-api).npm test), and ideally a staging integration test target.Each revision is supported for 2 years after release. Plan to move to the latest every 12-18 months so you never fall inside the deprecation window.
| Revision | Released | Deprecated | Key Changes |
|---|---|---|---|
2024-10-15 | Oct 2024 | Oct 2026 | Reporting API, campaign message updates |
2024-07-15 | Jul 2024 | Jul 2026 | Custom objects, tracking settings |
2024-02-15 | Feb 2024 | Feb 2026 | Bulk operations, segments V2 |
2023-12-15 | Dec 2023 | Dec 2025 | Profile subscription changes |
2023-07-15 | Jul 2023 | Jul 2025 | Relationship endpoint restructuring |
Compare what is installed against what is published to size the jump. A single major step is routine; skipping several majors means expect casing and import changes.
npm list klaviyo-api # e.g. [email protected]
npm view klaviyo-api version # latest, e.g. 21.0.0
Read the releases changelog for the target major, then locate the call sites that will need edits.
grep -rn "from 'klaviyo-api'" src/
grep -rn "ApiKeySession\|ConfigWrapper\|ProfilesApi\|EventsApi" src/
Pick the pattern that fits the errors you see and edit each call site. Full before/after code is in migration patterns:
/api/v2/... HTTP calls with typed EventsApi / ProfilesApi resource classes.ConfigWrapper('pk_***') for a per-instance new ApiKeySession('pk_***') passed to each *Api.snake_case attributes (first_name) to camelCase (firstName).Install the target version pinned, let tsc and the test suite gate the change, and
deploy to staging before production. Full commands: upgrade procedure.
git checkout -b upgrade/klaviyo-api-v21
npm install [email protected] --save-exact
npx tsc --noEmit 2>&1 | grep -i "klaviyo\|error TS" # find breaking changes
npm test
If error rates rise after the upgrade, reinstall the previous exact version — see the rollback procedure. Because Step 4 pinned versions, rollback is a clean reinstall with no dependency guesswork.
Running this workflow produces:
upgrade/klaviyo-api-vNN branch with package.json + package-lock.json pinned to the target version via --save-exact.src/ using the current ApiKeySession pattern and camelCase attributes, with npx tsc --noEmit clean.npm test (and staging test:integration) run confirming the migration.| Issue | Cause | Solution |
|---|---|---|
TypeError: ConfigWrapper is not a function | Old SDK pattern | Switch to ApiKeySession pattern |
Property 'first_name' does not exist | Casing change | Use firstName (camelCase) |
response.data is undefined | Access pattern change | Use response.body.data |
revision not supported | Deprecated revision | Update revision header value |
Migrate a v2 identify call to the current SDK. After grep finds a legacy
/api/identify call, replace it with createOrUpdateProfile:
import { ApiKeySession, ProfilesApi, ProfileEnum } from 'klaviyo-api';
const session = new ApiKeySession(process.env.KLAVIYO_PRIVATE_KEY!);
const profilesApi = new ProfilesApi(session);
await profilesApi.createOrUpdateProfile({
data: {
type: ProfileEnum.Profile,
attributes: { email: '[email protected]', firstName: 'Jane', properties: { plan: 'pro' } },
},
});
The full set of before/after examples — event tracking, the ConfigWrapper →
ApiKeySession upgrade, and property casing — is in
migration patterns.
For wiring these upgrade checks into continuous integration, see the
klaviyo-ci-integration skill.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
24 skills in this plugin
/klaviyo-ci-integrationConfigure CI/CD pipelines for Klaviyo integrations with GitHub Actions.
Use when setting up automated testing, configuring CI secrets,
or integrating Klaviyo SDK tests into your build pipeline.
Trigger with phrases like "klaviyo CI", "klaviyo GitHub Actions",
"klaviyo automated tests", "CI klaviyo", "klaviyo pipeline".
/klaviyo-common-errorsDiagnose and fix common Klaviyo API errors and exceptions.
Use when encountering Klaviyo 4xx/5xx errors, debugging failed requests,
or troubleshooting SDK integration issues.
Trigger with phrases like "klaviyo error", "fix klaviyo",
"klaviyo not working", "debug klaviyo", "klaviyo 400", "klaviyo 429".
/klaviyo-core-workflow-aExecute Klaviyo primary workflow: profiles, lists, and subscriptions.
Use when creating/updating profiles, managing lists, subscribing contacts,
or syncing customer data to Klaviyo for email/SMS marketing.
Trigger with phrases like "klaviyo profiles", "klaviyo lists",
"klaviyo subscribe", "add contacts to klaviyo", "klaviyo customer data".
/klaviyo-core-workflow-bExecute the Klaviyo secondary workflow: event tracking, segments, and campaigns.
Use when you need to track customer events, query or size segments, build and send
email campaigns, or inspect metric-triggered flows through the Klaviyo API.
Trigger with phrases like "klaviyo events", "klaviyo segments", "klaviyo campaigns",
"track klaviyo event", "klaviyo flow trigger".
/klaviyo-cost-tuningOptimize Klaviyo costs through plan selection, contact management, and usage monitoring.
Use when analyzing Klaviyo billing, reducing active profile costs,
or implementing usage monitoring and budget alerts.
Trigger with phrases like "klaviyo cost", "klaviyo billing",
"reduce klaviyo costs", "klaviyo pricing", "klaviyo expensive", "klaviyo budget".
/klaviyo-data-handlingImplement Klaviyo data privacy, GDPR/CCPA compliance, and PII handling patterns.
Use when handling profile data, implementing right-to-deletion, configuring
data retention, or ensuring compliance with privacy regulations.
Trigger with phrases like "klaviyo data", "klaviyo PII",
"klaviyo GDPR", "klaviyo data retention", "klaviyo privacy", "klaviyo CCPA",
"klaviyo delete profile", "klaviyo data privacy".
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin klaviyo-packOther plugins' skills for the same job