Checkout embed

Next.js + MailerLite integration

Next.js hosts the buying action, Plandalf takes the payment, and MailerLite gets the buyer in a group through native steps.

No credit card required. No coding required.

Does Next.js integrate with MailerLite?

The checkout and MailerLite connect through Plandalf, not through Next.js. Your app loads the SDK and opens the offer; after payment a Plandalf sequence runs native MailerLite steps to find or create the subscriber and add them to a group. Your app needs no code for the MailerLite side.

What moves between Next.js and MailerLite

EventFrom and toThroughWhat happens
Checkout openedNext.jsPlandalfCheckout embedA client provider loads the SDK, and a client component renders a button with data-plandalf-present or calls the SDK's present().
Checkout completedPlandalfMailerLiteNative stepFind or Create Subscriber and Add Subscriber to Group run on the server side of Plandalf, so no MailerLite token touches your Next.js bundle.
Invoice paidPlandalfMailerLiteNative stepRenewals and invoices you send fire this too, which lets Update Subscriber Fields keep a plan field current.
Subscriber createdMailerLitePlandalfNative stepPlandalf registers the webhook with MailerLite when you save the trigger. A group filter limits which new subscribers start the sequence.
Purchase confirmation to your appPlandalfNext.jsWebhookA Send Webhook step can call a route handler of yours when the app itself must grant access, since MailerLite group membership proves nothing about payment.

Group assignment for Next.js buyers

Only the MailerLite token and the SDK URL are needed here. Neither lives in your repository.

  1. Set up the provider

    Add a client component with 'use client' that renders next/script after interaction and hands the ready SDK to context. Mount it under your root layout so route changes reuse one script.

  2. Open checkout from a client component

    Render the button once the SDK is ready. If the offer or promo can change at runtime, key the component on those values so React builds a fresh bound element.

  3. Generate a MailerLite token

    In MailerLite go to Integrations, MailerLite API, Use, Generate new token. The token appears once, so copy it before closing the dialog.

  4. Connect and build the sequence

    In Plandalf connect MailerLite under Automation, Marketplace. Start a sequence on Checkout Completed with Find or Create Subscriber (email from {{trigger.customer_email}}), then Add Subscriber to Group using the returned subscriber_id.

  5. Rehearse in test mode

    Turn on Run on test purchases, buy once with a Stripe test card from your Next.js page, and confirm the group membership in MailerLite. Switch the setting off before launch.

What sellers do with Next.js and MailerLite

Indie developers selling a template or boilerplate

A buyer of a Next.js starter kit lands in a Customers group, and a MailerLite automation sends the repo invite steps and later release notes.

Paid newsletter or community apps

A custom Next.js site sells a yearly pass. The group drives a welcome automation, while your server grants the logged-in area from a verified invoice.

Limits and gotchas

  • Group membership in MailerLite is not an entitlement. Grant access in your own app from a server-side check of the paid purchase.
  • Only current MailerLite works. Classic accounts use a different API.
  • The Next.js guide documents the App Router. Pages Router needs separate verification, and some SDK cleanup repairs it mentions were unreleased when written.
  • Adding a buyer to a group does not record marketing consent.

Next.js and MailerLite: common questions

Does Next.js integrate with MailerLite?
Not directly. Next.js opens the Plandalf checkout, and Plandalf's native MailerLite steps add the buyer to a group after payment. Your app does not call MailerLite.
How do I connect MailerLite to a Next.js checkout?
Load the Plandalf script in a client provider, connect MailerLite with an API token under Automation, and use Find or Create Subscriber then Add Subscriber to Group on Checkout Completed.
Do I need an API route to use MailerLite with Plandalf?
No. The MailerLite steps run inside Plandalf. You only need a route if your app must grant access or store the order itself.

Feature detail