Agent skill · software engineering · jeremylongshore

klaviyo-local-dev-loop

Configure Klaviyo local development with hot reload, mocking, and testing.

Why this skill is useful

Adds specific configuration patterns and scripts for setting up a Klaviyo development environment that the AI wouldn't reliably generate on its own.

What it needs

Requires node installed locally. Requires klaviyo account access. About 3k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

Klaviyo Local Dev Loop Overview Set up a fast, reproducible local development workflow for Klaviyo integrations with hot reload, SDK mocking, and integration tests. The loop keeps three concerns separate: a lazily-instantiated SDK client singleton, mocked unit tests that never hit the network, and live integration tests gated behind an opt-in flag so they only run in CI. Prerequisites Completed klaviyo-install-auth setup (provides your private API key) Node.js 18+ with npm or pnpm on the PATH klaviyo-api package installed as a project dependency tsx and vitest installed as dev dependencies for hot reload and tests Instructions Follow six steps to stand up the loop. The full file contents for each step — project layout, .env templates, package.json scripts, and the client singleton — live in full walkthrough. The complete test files live in test examples. 1. Project structure — create src/klaviyo/ for SDK modules and tests/{unit,integration}/. Keep secrets in a git-ignored .env.local, ship a committed .env.example. 2. Environment configuration — define KLAVIYOPRIVATEKEY / KLAVIYOPUBLICKEY and wire the dev, test, test:watch, test:integration, and typecheck scripts. 3. SDK client singleton — read the key once, cache the ApiKeySession, and export lazy per-API accessors so you only instantiate what you use: 4. Unit testing with mocks — vi.mock('klaviyo-api', ...) the whole SDK so unit tests are deterministic and offline. See test examples. 5. Integration test — a describe.skipIf(!process.env.KLAVIYOTEST) suite that exercises the live account. See test examples. 6. Hot reload development — run npm run dev (tsx watch) in one terminal and npm run test:watch in another for a tight edit-test cycle. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/klaviyo-local-dev-loop

View the source on GitHub

Browse the @skills marketplace