Index of every page on this site: llms.txt
All skills
jeremylongshore avatar

/klaviyo-install-auth

@820dfc8
Run it yourself

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

Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/klaviyo-install-auth

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈87 tokens for metadata: the name and description. ≈1.1k when used: this file. ≈1.7k more on demand in 2 files.

Description uses 4.3% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈347 characters, or 4.3%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

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

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

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

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.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The skill provides instructions for installing and configuring the official Klaviyo SDK. It follows security best practices by recommending the use of environment variables for secrets, utilizing .gitignore, and suggesting least-privilege API scopes. No malicious patterns or security vulnerabilities were detected.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

Signed by skilld at 820dfc8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 20 hours ago.

Activeupdated 4 months ago
What it can do
Reads files Edits files Runs commands
version
1.7.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
[
  "saas",
  "klaviyo",
  "email-marketing",
  "cdp"
]
All 7 allowed tools
ReadWriteEditBash(npm:*)Bash(pnpm:*)Bash(pip:*)Grep
Other metadata
compatibility
Designed for Claude Code

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/klaviyo-install-auth