agentsclimarketplace

Klaviyo install auth

Skill jeremylongshore/claude-code-plugins-plus-skills/plugins/saas-packs/klaviyo-pack/skills/klaviyo-install-auth

'Install and configure Klaviyo Node.js SDK with API key authentication.From its SKILL.md

Install
npx -y skills add jeremylongshore/claude-code-plugins-plus-skills --skill klaviyo-install-auth

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

5.1 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it

Klaviyo Install & Auth

Overview

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.

Prerequisites

  • Node.js 18+ (or Python 3.10+ for Python SDK)
  • Klaviyo account at https://www.klaviyo.com/
  • Private API key from Settings > API Keys in Klaviyo dashboard
  • Public API key (for client-side only -- never use in server code)

Instructions

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).

Step 1: Install the Official SDK

# 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.

Step 2: Configure Authentication

Store the private key in .env and confirm it is gitignored. Klaviyo uses two key types:

Key TypePrefixUse CaseHeader
Private API Keypk_Server-side REST APIAuthorization: Klaviyo-API-Key pk_***
Public API Key6-charClient-side Track/IdentifyQuery param company_id

Step 3: Initialize the SDK

// 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);

Steps 4-5: Verify & set the revision header

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.

Output

  • klaviyo-api package installed in node_modules
  • .env file with KLAVIYO_PRIVATE_KEY set
  • Verified API connection with account name printed
  • Per-resource API clients ready for import

Error Handling

ErrorStatusCauseSolution
Authentication failed401Invalid or expired private keyRegenerate key at Settings > API Keys
Forbidden403Key missing required scopesCreate key with appropriate scopes (e.g., profiles:read)
Rate limited429Exceeded 75 req/s burst or 700 req/min steadyHonor Retry-After header; see klaviyo-rate-limits
MODULE_NOT_FOUNDN/AWrong package nameUse klaviyo-api, not @klaviyo/sdk
ENOTFOUND a.klaviyo.comN/ADNS/network failureCheck internet connectivity, firewall rules

Examples

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:

curl -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.

Resources

Next Steps

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.

What ships with it: 2 files

6.6 KB alongside SKILL.md

references/

Keep looking

Skills are one crate of 326,144. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.