/klaviyo-pack:klaviyo-multi-env-setupfrom klaviyo-pack
Configures Klaviyo across dev, staging, and production with separate API keys, environment detection, secret management, and production safeguards.
Ships in klaviyo-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Configure Klaviyo across development, staging, and production with separate API keys, environment detection, secret management, and production safeguards. Every environment follows the same shape — detect the env, resolve its config, load its secret, guard destructive/send operations. The lean workflow and first skeleton live here; full step-by-step code lives in references/implementation.md.
klaviyo-api SDK installed| Environment | Klaviyo Account | API Key | Use Case |
|---|---|---|---|
| Development | Test account | pk_test_dev_*** | Local development, exploration |
| Staging | Test account | pk_test_staging_*** | Pre-prod validation, integration tests |
| Production | Production account | pk_live_*** | Real customer data, live sends |
Important: Klaviyo does not have a sandbox mode. Use a separate test account for dev/staging to avoid sending real emails.
The pattern is the same across all three environments; only the API key and the per-env flags change. Read the matching section in references/implementation.md, then:
src/config/klaviyo.ts
with a detectEnvironment() helper and a per-env ENV_CONFIGS map that flips
enableSending, cache, and rate-limit concurrency by environment.gcloud secrets create, aws secretsmanager create-secret, or
Vault). Never commit keys; local dev reads a git-ignored .env.local.guardCampaignSend, guardedProfileDeletion).staging→staging key and
main→prod key, verifies connectivity, then deploys.pk_live_*** key is detected outside production.// src/config/klaviyo.ts — see reference for the full ENV_CONFIGS + getSession
type Environment = 'development' | 'staging' | 'production';
function detectEnvironment(): Environment {
const env = process.env.NODE_ENV || 'development';
if (['production', 'staging'].includes(env)) return env as Environment;
return 'development';
}
// development/staging force enableSending:false; only production sends.
The full config module, per-platform secret commands, guard functions, the CI matrix, and the startup validator are in references/implementation.md.
src/config/klaviyo.ts resolving a typed config per environment| Issue | Cause | Solution |
|---|---|---|
| Wrong key for environment | Missing env-specific secret | Verify secret per environment |
| Production key in dev | Key leak risk | Add startup validation warning |
| Sends in staging | enableSending not checked | Add campaign send guard |
| Config merge fails | Invalid env value | Validate NODE_ENV on startup |
Block a campaign send outside production. The guard reads the resolved config and throws when sending is disabled, so a staging run can never email real customers:
guardCampaignSend(); // throws in dev/staging (enableSending:false), passes in prod
Catch a leaked production key in staging. Startup validation warns when a
pk_live_*** key is present outside production:
[Klaviyo] Environment: staging
[Klaviyo] Sending enabled: false
[Klaviyo] WARNING: Production API key detected in non-production environment!
The full config module, secret-store commands for each platform, the guard implementations, the CI matrix, and the startup validator are in references/implementation.md.
klaviyo-observability skill.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin klaviyo-pack24 skills in this plugin
/klaviyo-ci-integrationConfigure CI/CD pipelines for Klaviyo integrations with GitHub Actions.
Use when setting up automated testing, configuring CI secrets,
or integrating Klaviyo SDK tests into your build pipeline.
Trigger with phrases like "klaviyo CI", "klaviyo GitHub Actions",
"klaviyo automated tests", "CI klaviyo", "klaviyo pipeline".
/klaviyo-common-errorsDiagnose and fix common Klaviyo API errors and exceptions.
Use when encountering Klaviyo 4xx/5xx errors, debugging failed requests,
or troubleshooting SDK integration issues.
Trigger with phrases like "klaviyo error", "fix klaviyo",
"klaviyo not working", "debug klaviyo", "klaviyo 400", "klaviyo 429".
/klaviyo-Other plugins' skills for the same job