Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Create a minimal working Klaviyo example with real API calls. Use when starting a new Klaviyo integration, testing your setup, or learning basic profile creation and event tracking patterns. Trigger with phrases like "klaviyo hello world", "klaviyo example", "klaviyo quick start", "simple klaviyo code", "first klaviyo call".
.claude/skills/jeremylongshore-klaviyo-hello-world/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 16% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 18% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 41% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -29% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 18% | 0% |
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 withProfiles 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:
profilesApi.createProfile(...) with a JSON:APIpayload. The essential skeleton:
typescript 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: 'hello@example.com', firstName: 'Hello', lastName: 'World' }, }, }); console.log('Profile created:', profile.body.data.id);
eventsApi.createEvent(...) with a metric (created onfirst use) linked to the profile by email.
profilesApi.getProfiles({ filter: '...' }) toconfirm the write landed.
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:
typescriptawait eventsApi.createEvent({ data: { type: 'event', attributes: { metric: { data: { type: 'metric', attributes: { name: 'Hello World Test' } } }, profile: { data: { type: 'profile', attributes: { email: 'hello@example.com' } } }, 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.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 14,487 | 16,485 | +14% | 1 | 1 | 0% | 3,188 | 3,704 | +16% | 0 | 0 | — |
case-02 | fail→pass | 23,775 | 16,515 | -31% | 1 | 1 | 0% | 3,044 | 3,582 | +18% | 0 | 0 | — |
case-03 | fail→pass | 20,183 | 13,364 | -34% | 1 | 1 | 0% | 2,988 | 4,216 | +41% | 0 | 0 | — |
case-04 | fail→pass | 27,743 | 13,707 | -51% | 1 | 1 | 0% | 4,063 | 2,872 | -29% | 0 | 0 | — |
case-05 | pass→pass | 19,811 | 11,353 | -43% | 1 | 1 | 0% | 2,659 | 2,442 | -8% | 0 | 0 | — |
case-06 | pass→pass | 18,266 | 15,199 | -17% | 1 | 1 | 0% | 2,633 | 2,664 | +1% | 0 | 0 | — |
case-07 | fail→pass | 9,687 | 5,165 | -47% | 1 | 1 | 0% | 1,828 | 2,156 | +18% | 0 | 0 | — |
case-08 | pass→pass | 12,144 | 8,378 | -31% | 1 | 1 | 0% | 1,173 | 1,571 | +34% | 0 | 0 | — |
case-09 | fail→pass | 11,324 | 1,987 | -82% | 1 | 1 | 0% | 1,159 | 1,468 | +27% | 0 | 0 | — |
case-10 | pass→pass | 8,874 | 13,096 | +48% | 1 | 1 | 0% | 1,743 | 2,660 | +53% | 0 | 0 | — |
case-11 | pass→pass | 18,307 | 12,085 | -34% | 1 | 1 | 0% | 2,199 | 2,520 | +15% | 0 | 0 | — |
case-12 | pass→pass | 12,974 | 3,931 | -70% | 1 | 1 | 0% | 1,490 | 1,863 | +25% | 0 | 0 | — |
case-13 | fail→pass | 13,476 | 6,832 | -49% | 1 | 1 | 0% | 1,475 | 2,572 | +74% | 0 | 0 | — |
case-14 | pass→pass | 13,602 | 10,912 | -20% | 1 | 1 | 0% | 1,228 | 2,317 | +89% | 0 | 0 | — |
case-15 | pass→pass | 10,608 | 3,046 | -71% | 1 | 1 | 0% | 981 | 1,776 | +81% | 0 | 0 | — |
case-16 | fail→pass | 18,953 | 14,367 | -24% | 1 | 1 | 0% | 2,271 | 2,806 | +24% | 0 | 0 | — |
case-17 | pass→pass | 12,328 | 10,064 | -18% | 1 | 1 | 0% | 1,368 | 2,089 | +53% | 0 | 0 | — |
case-18 | fail→pass | 11,632 | 1,746 | -85% | 1 | 1 | 0% | 1,119 | 1,492 | +33% | 0 | 0 | — |
case-19 | pass→pass | 14,001 | 6,423 | -54% | 1 | 1 | 0% | 1,542 | 2,160 | +40% | 0 | 0 | — |
case-20 | pass→pass | 3,775 | 3,988 | +6% | 1 | 1 | 0% | 653 | 1,776 | +172% | 0 | 0 | — |
case-21 | pass→pass | 13,736 | 19,705 | +43% | 1 | 1 | 0% | 2,753 | 4,128 | +50% | 0 | 0 | — |
case-22 | pass→pass | 12,709 | 12,806 | +1% | 1 | 1 | 0% | 2,425 | 3,659 | +51% | 0 | 0 | — |
case-23 | pass→pass | 10,919 | 8,913 | -18% | 1 | 1 | 0% | 2,031 | 3,027 | +49% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +39 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.