Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Install and configure Klaviyo Node.js SDK with API key authentication. Use when setting up a new Klaviyo integration, configuring API keys, or initializing the klaviyo-api package in your project. Trigger with phrases like "install klaviyo", "setup klaviyo", "klaviyo auth", "configure klaviyo API key", "klaviyo SDK setup".
.claude/skills/jeremylongshore-klaviyo-install-auth/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 23% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 5% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 52% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 37% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 26% | 0% |
Set up the official klaviyo-api Node.js SDK and configure private API key authentication against Klaviyo's REST API (revision 2024-10-15). The workflow below is the high-level path; the verbatim code for every step lives in the full implementation walkthrough, and copy-paste sequences live in worked examples.
The full sequence is five steps. The essentials are below; drill into references/implementation.md for the complete code of each step (verify script, revision header, Python setup, scope table).
bash# Node.js (official SDK -- NOT @klaviyo/sdk, that's deprecated) npm install klaviyo-api
> Important: The npm package is klaviyo-api, not @klaviyo/sdk. The SDK exports per-resource API classes (ProfilesApi, EventsApi, etc.) that each take an ApiKeySession.
Store the private key in .env and confirm it is gitignored. Klaviyo uses two key types:
| Key Type | Prefix | Use Case | Header | |----------|--------|----------|--------| | Private API Key | pk_ | Server-side REST API | Authorization: Klaviyo-API-Key pk_*** | | Public API Key | 6-char | Client-side Track/Identify | Query param company_id |
typescript// src/klaviyo/client.ts import { ApiKeySession, ProfilesApi, EventsApi, ListsApi } from 'klaviyo-api'; const session = new ApiKeySession(process.env.KLAVIYO_PRIVATE_KEY!); export const profilesApi = new ProfilesApi(session); export const eventsApi = new EventsApi(session); export const listsApi = new ListsApi(session);
Run a one-time verification against AccountsApi.getAccounts() to prove the key works, and remember every request needs a revision: 2024-10-15 header (the SDK adds it automatically; raw HTTP does not). Full verify script + cURL smoke test: references/implementation.md.
klaviyo-api package installed in node_modules.env file with KLAVIYO_PRIVATE_KEY set| Error | Status | Cause | Solution | |-------|--------|-------|----------| | Authentication failed | 401 | Invalid or expired private key | Regenerate key at Settings > API Keys | | Forbidden | 403 | Key missing required scopes | Create key with appropriate scopes (e.g., profiles:read) | | Rate limited | 429 | Exceeded 75 req/s burst or 700 req/min steady | Honor Retry-After header; see klaviyo-rate-limits | | MODULE_NOT_FOUND | N/A | Wrong package name | Use klaviyo-api, not @klaviyo/sdk | | ENOTFOUND a.klaviyo.com | N/A | DNS/network failure | Check internet connectivity, firewall rules |
Four copy-paste sequences (fresh Node project, key verification, Python with retry tuning, raw-HTTP smoke test) are in references/examples.md. The fastest sanity check — confirm a key from a shell before writing any code:
bashcurl -X GET "https://a.klaviyo.com/api/profiles/" \ -H "Authorization: Klaviyo-API-Key pk_***" \ -H "revision: 2024-10-15" \ -H "Accept: application/vnd.api+json"
A 200 with a JSON data array means the key and revision header are valid; a 401 means the key is wrong; a 403 means it lacks the profiles:read scope.
After successful auth, proceed to the klaviyo-hello-world skill for your first profile + event API call, then klaviyo-rate-limits to harden request handling against the 75 req/s burst ceiling.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 15,922 | 13,177 | -17% | 1 | 1 | 0% | 2,474 | 3,044 | +23% | 0 | 0 | — |
case-02 | fail→pass | 17,031 | 15,446 | -9% | 1 | 1 | 0% | 3,331 | 3,493 | +5% | 0 | 0 | — |
case-03 | fail→pass | 13,476 | 9,813 | -27% | 1 | 1 | 0% | 1,501 | 2,289 | +52% | 0 | 0 | — |
case-13 | fail→pass | 7,151 | 1,796 | -75% | 1 | 1 | 0% | 1,173 | 1,605 | +37% | 0 | 0 | — |
case-04 | pass→pass | 14,548 | 12,863 | -12% | 1 | 1 | 0% | 1,693 | 2,524 | +49% | 0 | 0 | — |
case-05 | fail→pass | 9,816 | 7,985 | -19% | 1 | 1 | 0% | 1,517 | 1,904 | +26% | 0 | 0 | — |
case-06 | pass→pass | 6,800 | 9,243 | +36% | 1 | 1 | 0% | 1,316 | 1,897 | +44% | 0 | 0 | — |
case-07 | fail→pass | 19,418 | 16,961 | -13% | 1 | 1 | 0% | 2,738 | 3,503 | +28% | 0 | 0 | — |
case-18 | pass→pass | 13,134 | 3,674 | -72% | 1 | 1 | 0% | 1,286 | 1,895 | +47% | 0 | 0 | — |
case-08 | fail→pass | 14,357 | 6,279 | -56% | 1 | 1 | 0% | 2,668 | 2,452 | -8% | 0 | 0 | — |
case-09 | fail→pass | 15,452 | 13,253 | -14% | 1 | 1 | 0% | 2,000 | 2,966 | +48% | 0 | 0 | — |
case-10 | pass→pass | 8,138 | 14,833 | +82% | 1 | 1 | 0% | 1,439 | 2,904 | +102% | 0 | 0 | — |
case-11 | pass→pass | 32,430 | 12,703 | -61% | 1 | 1 | 0% | 1,994 | 2,503 | +26% | 0 | 0 | — |
case-12 | pass→pass | 6,433 | 6,953 | +8% | 1 | 1 | 0% | 1,019 | 1,595 | +57% | 0 | 0 | — |
case-14 | fail→pass | 11,576 | 10,163 | -12% | 1 | 1 | 0% | 1,669 | 2,254 | +35% | 0 | 0 | — |
case-15 | pass→pass | 12,398 | 2,516 | -80% | 1 | 1 | 0% | 1,726 | 1,670 | -3% | 0 | 0 | — |
case-16 | pass→pass | 15,414 | 1,920 | -88% | 1 | 1 | 0% | 1,972 | 1,635 | -17% | 0 | 0 | — |
case-17 | fail→pass | 11,102 | 8,133 | -27% | 1 | 1 | 0% | 1,151 | 1,891 | +64% | 0 | 0 | — |
case-19 | fail→pass | 8,768 | 9,011 | +3% | 1 | 1 | 0% | 1,659 | 1,969 | +19% | 0 | 0 | — |
case-20 | fail→fail | 15,590 | 20,205 | +30% | 1 | 1 | 0% | 3,109 | 4,759 | +53% | 0 | 0 | — |
case-21 | fail→fail | 27,400 | 28,445 | +4% | 1 | 1 | 0% | 4,303 | 6,173 | +43% | 0 | 0 | — |
case-22 | fail→fail | 13,148 | 8,526 | -35% | 1 | 1 | 0% | 1,463 | 2,947 | +101% | 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. 22 cases were attempted. The headline lift of +50 percentage points is the difference between those two pass rates over the 22 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.