INTEGRATIONS

Klaviyo

Sign a unique image URL per Klaviyo profile and store it on a custom property.

Install the jsontoimg Klaviyo CLI. Map profile fields to named layers, sign each profile, and write the URL to a custom property. Same /api/v1 contract as REST and n8n.

A campaign <img> cannot carry Klaviyo merge tags. POST /api/v1/img/sign binds the exact layer text into sig, so each profile is signed with its real values.

This CLI is run-driven. It does not fire on profile create/update. For that, use n8n or HTTP.

Install

  1. Clone the klaviyo folder from j2i-integrations.
  2. npm install
  3. Copy config.example.json to config.json.

Credentials

  1. Create an API key under Integrations → API keys.
  2. In Klaviyo, create a private API key with profiles:read, profiles:write, and lists:read or segments:read.
  3. Set j2iApiKey, klaviyoApiKey, exactly one of listId or segmentId, template, and outputProperty (example j2i_hero_url). Leave j2iBaseUrl as https://app.jsontoimg.com or omit it.
  4. node --experimental-strip-types src/cli.ts test

Prefer dedicated keys you can revoke.

First sync

  1. Map named layers to profile paths: email, first_name, last_name, phone_number, organization, title, location.city, custom keys as properties.plan_name. Image layers need an http(s) URL.
  2. node --experimental-strip-types src/cli.ts sync --limit 50

Each profile mints POST /api/v1/img/sign and PATCHes the signed GET /api/v1/img/{template}?sig= URL onto outputProperty, plus ${outputProperty}_layers (sha256 of the layer payload). Unchanged fingerprints are skipped.

In the email template:

{{ person|lookup:'j2i_hero_url' }}

Limits

  • 50 profiles per run
  • The CLI does not subscribe to profile changes; use n8n or HTTP for automations

On this page