/klaviyo-pack:klaviyo-hello-worldfrom klaviyo-pack
Creates a minimal Klaviyo integration with real API calls for profile creation, event tracking, and data retrieval. Use when starting a new Klaviyo integration or testing API setup.
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.
Minimal working example: create a profile, track an event, and query the result
using the klaviyo-api Node.js SDK against a.klaviyo.com/api/*. This is the
smoke test that proves your API key, SDK install, and network path all work
end-to-end before you build anything real.
klaviyo-install-auth setup so credentials are in place.KLAVIYO_PRIVATE_KEY exported in your environment (a private API key with
Profiles and Events scopes).klaviyo-api installed in the project (npm install klaviyo-api).tsx available to run the TypeScript file (npx tsx …).Write the code into a single hello-klaviyo.ts file, then run it with
npx tsx hello-klaviyo.ts. The full script performs four things in order:
Create a profile — profilesApi.createProfile(...) with a JSON:API
payload. The essential skeleton:
import { ApiKeySession, ProfilesApi, ProfileEnum } from 'klaviyo-api';
const session = new ApiKeySession(process.env.KLAVIYO_PRIVATE_KEY!);
const profilesApi = new ProfilesApi(session);
const profile = await profilesApi.createProfile({
data: {
type: ProfileEnum.Profile,
attributes: { email: '[email protected]', firstName: 'Hello', lastName: 'World' },
},
});
console.log('Profile created:', profile.body.data.id);
Track an event — eventsApi.createEvent(...) with a metric (created on
first use) linked to the profile by email.
Retrieve the profile — profilesApi.getProfiles({ filter: '...' }) to
confirm the write landed.
Run the combined script — npx tsx hello-klaviyo.ts.
For the complete step-by-step code (all payloads with camelCase and JSON:API detail), see the full walkthrough. For the single combined runnable script and variations, see worked examples.
Running the combined script prints one line per operation. The profile ID is a
26-character ULID; Verified echoes the firstName read back from the API,
proving the round trip succeeded:
Profile created: 01JXXXXXXXXXXXXXXXXXXXXXX
Event tracked successfully
Verified: Hello
| Error | Status | Cause | Solution |
|---|---|---|---|
Duplicate profile | 409 | Email already exists | Use createOrUpdateProfile instead |
Invalid email format | 400 | Malformed email | Validate email before sending |
Missing metric name | 400 | Empty metric object | Always include metric.data.attributes.name |
Unauthorized | 401 | Bad API key | Check KLAVIYO_PRIVATE_KEY env var |
The canonical example is the single combined script that creates a profile,
tracks an event, and reads the profile back — see the
worked examples for the full file plus two common
variations (idempotent upsert with createOrUpdateProfile, and a revenue event
that sets value). The core shape of every call is the same JSON:API envelope:
await eventsApi.createEvent({
data: {
type: 'event',
attributes: {
metric: { data: { type: 'metric', attributes: { name: 'Hello World Test' } } },
profile: { data: { type: 'profile', attributes: { email: '[email protected]' } } },
properties: { source: 'hello-world' },
time: new Date().toISOString(),
},
},
});
firstName, phoneNumber, lastName (not snake_case){ data: { type, attributes } } structureresponse.body.data (not response.data)email, phoneNumber, or externalId to identify profilesProceed to klaviyo-local-dev-loop for development workflow setup, or
klaviyo-core-workflow-a for profile and list management.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin klaviyo-pack24 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-Other plugins' skills for the same job