klaviyo-hello-world
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".
Best use case
klaviyo-hello-world is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
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".
Teams using klaviyo-hello-world should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/klaviyo-hello-world/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How klaviyo-hello-world Compares
| Feature / Agent | klaviyo-hello-world | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
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".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# Klaviyo Hello World
## Overview
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/*`.
## Prerequisites
- Completed `klaviyo-install-auth` setup
- `KLAVIYO_PRIVATE_KEY` set in environment
- `klaviyo-api` package installed
## Instructions
### Step 1: Create a Profile
```typescript
// hello-klaviyo.ts
import {
ApiKeySession,
ProfilesApi,
EventsApi,
ProfileCreateQuery,
ProfileEnum,
EventCreateQueryV2,
EventEnum,
} from 'klaviyo-api';
const session = new ApiKeySession(process.env.KLAVIYO_PRIVATE_KEY!);
const profilesApi = new ProfilesApi(session);
const eventsApi = new EventsApi(session);
// Create or update a profile
// NOTE: SDK uses camelCase (firstName, not first_name)
const profilePayload: ProfileCreateQuery = {
data: {
type: ProfileEnum.Profile,
attributes: {
email: 'hello@example.com',
firstName: 'Hello',
lastName: 'World',
properties: {
source: 'hello-world-script',
signupDate: new Date().toISOString(),
},
},
},
};
const profile = await profilesApi.createProfile(profilePayload);
console.log('Profile created:', profile.body.data.id);
```
### Step 2: Track an Event
```typescript
// Track a custom event tied to the profile
const eventPayload: EventCreateQueryV2 = {
data: {
type: EventEnum.Event,
attributes: {
// The metric name -- creates the metric if it doesn't exist
metric: {
data: {
type: 'metric',
attributes: {
name: 'Hello World Test',
},
},
},
// Link to the profile by email
profile: {
data: {
type: ProfileEnum.Profile,
attributes: {
email: 'hello@example.com',
},
},
},
properties: {
message: 'First event from API!',
timestamp: new Date().toISOString(),
},
time: new Date().toISOString(),
value: 0,
},
},
};
await eventsApi.createEvent(eventPayload);
console.log('Event tracked: Hello World Test');
```
### Step 3: Retrieve the Profile
```typescript
// Fetch profiles filtered by email
const profiles = await profilesApi.getProfiles({
filter: 'equals(email,"hello@example.com")',
});
const p = profiles.body.data[0];
console.log(`Found: ${p.attributes.firstName} ${p.attributes.lastName}`);
console.log(`ID: ${p.id}`);
console.log(`Created: ${p.attributes.created}`);
```
### Step 4: Complete Script
```typescript
// hello-klaviyo.ts -- full runnable script
import {
ApiKeySession,
ProfilesApi,
EventsApi,
ProfileEnum,
} from 'klaviyo-api';
async function main() {
const session = new ApiKeySession(process.env.KLAVIYO_PRIVATE_KEY!);
const profilesApi = new ProfilesApi(session);
const eventsApi = new EventsApi(session);
// 1. Create profile
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}`);
// 2. Track event
await 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(),
},
},
});
console.log('Event tracked successfully');
// 3. Query profile back
const result = await profilesApi.getProfiles({
filter: 'equals(email,"hello@example.com")',
});
console.log(`Verified: ${result.body.data[0]?.attributes.firstName}`);
}
main().catch(console.error);
```
Run it:
```bash
npx tsx hello-klaviyo.ts
```
## Output
```
Profile created: 01JXXXXXXXXXXXXXXXXXXXXXX
Event tracked successfully
Verified: Hello
```
## Error Handling
| 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 |
## Key SDK Conventions
- **camelCase properties**: The SDK uses `firstName`, `phoneNumber`, `lastName` (not snake_case)
- **JSON:API format**: All payloads use `{ data: { type, attributes } }` structure
- **Response body**: Access via `response.body.data` (not `response.data`)
- **Profile identifiers**: Use `email`, `phoneNumber`, or `externalId` to identify profiles
## Resources
- [Create Profile API](https://developers.klaviyo.com/en/reference/create_profile)
- [Create Event API](https://developers.klaviyo.com/en/reference/create_event)
- [Get Profiles API](https://developers.klaviyo.com/en/reference/get_profiles)
- [klaviyo-api-node Examples](https://github.com/klaviyo/klaviyo-api-node)
## Next Steps
Proceed to `klaviyo-local-dev-loop` for development workflow setup, or `klaviyo-core-workflow-a` for profile and list management.Related Skills
workhuman-hello-world
Workhuman hello world for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman hello world".
wispr-hello-world
Wispr Flow hello world for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr hello world".
windsurf-hello-world
Create your first Windsurf Cascade interaction and Supercomplete experience. Use when starting with Windsurf, testing your setup, or learning basic Cascade and Supercomplete workflows. Trigger with phrases like "windsurf hello world", "windsurf example", "windsurf quick start", "first windsurf project", "try windsurf".
webflow-hello-world
Create a minimal working Webflow Data API v2 example. Use when starting a new Webflow integration, testing your setup, or learning basic Webflow API patterns — list sites, read CMS collections, create items. Trigger with phrases like "webflow hello world", "webflow example", "webflow quick start", "simple webflow code", "first webflow API call".
vercel-hello-world
Create a minimal working Vercel deployment with a serverless API route. Use when starting a new Vercel project, testing your setup, or learning basic Vercel deployment and API route patterns. Trigger with phrases like "vercel hello world", "vercel example", "vercel quick start", "simple vercel project", "first vercel deploy".
veeva-hello-world
Veeva Vault hello world with REST API and VQL. Use when integrating with Veeva Vault for life sciences document management. Trigger: "veeva hello world".
vastai-hello-world
Rent your first GPU instance on Vast.ai and run a workload. Use when starting a new Vast.ai integration, testing your setup, or learning basic Vast.ai GPU rental patterns. Trigger with phrases like "vastai hello world", "vastai example", "vastai quick start", "rent first gpu", "vastai first instance".
twinmind-hello-world
Create your first TwinMind meeting transcription and AI summary. Use when starting with TwinMind, testing your setup, or learning basic transcription and summary patterns. Trigger with phrases like "twinmind hello world", "first twinmind meeting", "twinmind quick start", "test twinmind transcription".
together-hello-world
Run inference with Together AI -- chat completions, streaming, and model selection. Use when testing open-source models, comparing model performance, or learning the Together AI API. Trigger: "together hello world, together AI example, run llama".
techsmith-hello-world
Capture a screenshot with Snagit COM API and produce a Camtasia video. Use when automating screen captures, batch-processing recordings, or building documentation pipelines with TechSmith tools. Trigger: "techsmith hello world, snagit capture, camtasia render".
supabase-hello-world
Run your first Supabase query — insert a row and read it back. Use when starting a new Supabase project, verifying your connection works, or learning the basic insert-then-select pattern with @supabase/supabase-js. Trigger with phrases like "supabase hello world", "first supabase query", "supabase quick start", "test supabase connection", "supabase insert and select".
stackblitz-hello-world
Boot a WebContainer, mount files, install npm packages, and run a dev server in the browser. Use when learning WebContainers, building browser-based IDEs, or running Node.js without a backend server. Trigger: "stackblitz hello world", "webcontainer example", "run node in browser".