klaviyo-vercel-shop
Klaviyo for Vercel Shop
This skill connects a Vercel Shop storefront to Klaviyo, so browsing and cart activity, email signups and back-in-stock requests reach Klaviyo, and the flows Klaviyo already runs for Shopify stores (welcome, browse abandonment, abandoned cart, back in stock) work on the headless storefront too. Shopify still owns the catalog, orders and checkout, and Klaviyo's Shopify integration still syncs them. The storefront only adds what a headless site would otherwise lose: onsite activity, which used to come from the Shopify theme.
The integration is a destination on the Hydrogen analytics bus that Vercel Shop already uses. It never publishes events itself, it loads klaviyo.js only after the shopper's consent allows tracking, and it uses only the public API key (the six-character site ID) and Klaviyo's client APIs. No Klaviyo private API key ever goes into the storefront, its Vercel environment, or a commit.
Work through the steps in order. Ask before every write to the user's Klaviyo account or Vercel project.
Step 0 — Check the project
- Confirm this is Vercel Shop:
package.jsonhas"name": "vercel-shop", andlib/analytics/client.tsexportsaddAnalyticsDestination. Read theversion. This skill was written against2026.10.2; on a later version, read each file before editing it rather than trusting the anchors inreferences/code-changes.md. - Check whether Klaviyo is already there. If
lib/klaviyo/index.tsexists, don't copy anything over it: compare it with assets/lib/klaviyo/index.ts, report the differences, and ask before replacing it. Every edit inreferences/code-changes.mdsays how to tell it's already applied. - Check whether the Vercel project is linked (
.vercel/project.jsonexists). If not, and the user wants environment variables set from the terminal, ask them to runvercel link.
Step 1 — Ask what the user has and wants
Ask these together and wait for every answer: