Ecommerce-style Next.js storefronts
A small brand with a custom Next.js catalogue sells through Plandalf's checkout. The purchase event drives a post-purchase flow and a replenishment reminder.

Checkout embed
Your Next.js app owns the page, Plandalf owns checkout, and the paid order lands in Klaviyo as an event that can start a flow.
No credit card required. No coding required.
Next.js
KlaviyoPlandalf has no native Klaviyo steps. A Next.js client component opens the checkout; after payment a Send Webhook step can post to Klaviyo's events API directly or to a route handler in your app. Klaviyo flows can also post to a Plandalf catch URL to enrol a profile in a promo.
| Event | From and to | Through | What happens |
|---|---|---|---|
| Checkout opened | Next.js → Plandalf | The provider loads the SDK with next/script, and a client component renders data-plandalf-present after the SDK is ready. | |
| Checkout completed | Plandalf → Klaviyo | Webhook | Send Webhook calls your route handler, which creates the event on Klaviyo's /api/events endpoint with a metric name, the profile's email, properties and a numeric value. |
| Profile update | Plandalf → Klaviyo | Webhook | The same handler can call the profile import endpoint, which creates a profile (201) or updates an existing one (200). |
| Flow webhook | Klaviyo → Plandalf | Webhook | A flow webhook action posts to a Plandalf Webhook Trigger URL, and Enroll in Promo gives that profile a countdown. |
| Countdown inside a flow email | Plandalf → Klaviyo | By hand | The Plandalf countdown image tag goes into an HTML block, with Klaviyo's person email merge tag as the ref. |
A route handler keeps the Klaviyo private key on the server and gives you somewhere to shape the body Klaviyo expects.
Wrap the root layout's children in a client provider that loads the Plandalf script with next/script. Render the checkout button only after the SDK's ready callback has fired, so server rendering never touches window.
If buyers have accounts, sign a Plandalf customer JWT on your server with sub, email and name, and pass it with plandalf.identify(token) before opening checkout. Keep the signing key off the client.
Make a key with the events write scope, and the profiles write scope if you will also import profiles. Put it in a server-only environment variable.
Accept a POST with a shared secret header, then call Klaviyo's create event endpoint with the revision header, a metric named Plandalf Purchase, the email, a properties object and the amount as value. Return quickly, since Klaviyo answers 202 for queued events.
Start a sequence on Checkout Completed, add Send Webhook to your handler's URL with the secret in Headers, and a JSON payload using {{trigger.customer_email}}, {{trigger.total_amount}} and {{trigger.invoice_number}}.
In Klaviyo make a flow triggered by the Plandalf Purchase metric. Test with a Stripe test card and Run on test purchases switched on.
A small brand with a custom Next.js catalogue sells through Plandalf's checkout. The purchase event drives a post-purchase flow and a replenishment reminder.
An app opens the checkout from an upgrade button with the user's JWT. The event lets Klaviyo separate upgraded accounts from free ones in campaigns.
Checked October 26, 2026 against Plandalf's own setup guides and the vendor documentation: Klaviyo API: create event, Klaviyo API: create or update profile, Klaviyo help: understanding webhooks in flows.