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.

referencesexamples.md

≈678 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Klaviyo Install & Auth — Worked Examples

Concrete end-to-end examples that build on the client configured in the main walkthrough (references/implementation.md). Each one is a self-contained sequence you can copy into a fresh project.

Example 1: Fresh Node.js project from zero

# Install the official SDK
npm install klaviyo-api

# Store the private key (never commit it)
echo 'KLAVIYO_PRIVATE_KEY=pk_***********************************' >> .env
echo '.env' >> .gitignore
// 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);

Example 2: Verify the key works before deploying

Run the verification script once in CI or locally; it exits non-zero on a bad key so a broken credential fails the build instead of surfacing at runtime.

// src/klaviyo/verify.ts
import { ApiKeySession, AccountsApi } from 'klaviyo-api';

async function verifyKlaviyoConnection(): Promise<void> {
  const session = new ApiKeySession(process.env.KLAVIYO_PRIVATE_KEY!);
  const accountsApi = new AccountsApi(session);

  try {
    const accounts = await accountsApi.getAccounts();
    const account = accounts.body.data[0];
    console.log(`Connected to Klaviyo account: ${account.attributes.contactInformation.organizationName}`);
  } catch (error: any) {
    if (error.status === 401) {
      console.error('Invalid API key. Check KLAVIYO_PRIVATE_KEY in your .env file.');
    }
    process.exit(1);
  }
}

verifyKlaviyoConnection();

Expected output on success:

Connected to Klaviyo account: Acme Coffee Co.

Example 3: Python equivalent with retry tuning

# pip install klaviyo-api
from klaviyo_api import KlaviyoAPI

klaviyo = KlaviyoAPI(
    api_key="pk_***",
    max_delay=60,   # Max retry delay in seconds
    max_retries=3   # Auto-retry on 429/5xx
)

accounts = klaviyo.Accounts.get_accounts()
print(f"Connected: {accounts['data'][0]['attributes']['contact_information']['organization_name']}")

Example 4: Quick raw-HTTP smoke test (no SDK)

Useful for confirming a key from a shell before wiring 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 confirms the key and revision header are valid; a 401 means the key is wrong, a 403 means it is missing the profiles:read scope.

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

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