SaaS pricing page
A product team replaces a hand-built billing form with an upgrade button on its pricing route. Your server still reads the Stripe subscription before it changes a user's plan.
Checkout embed
In a Next.js app the Plandalf SDK runs in client components, and the checkout it opens charges your connected Stripe account.
No credit card required. No coding required.
Next.jsPlandalf has no Next.js package to install. You load the organization SDK with next/script in a client provider, render a button after the SDK is ready, and the checkout it opens takes payment through the Stripe account you connected in Plandalf. Access control stays on your server.
| Event | From and to | Through | What happens |
|---|---|---|---|
| Button opens checkout | Next.js → Plandalf | A client component renders a button with data-plandalf-present, or calls the ready SDK's present() or mount(). Server components must not touch window or open checkout. | |
| Payment | Plandalf → Stripe | Payment connection | Plandalf creates the checkout session against your connected Stripe account, and Stripe processes the card. |
| Checkout completed | Plandalf (paid via Stripe) → Next.js | Webhook | A sequence on Checkout Completed or Invoice Paid can post the buyer and invoice to a route handler you write. Browser events can update the page but should not grant durable access. |
| Route change | Next.js → Plandalf | A modal or inline checkout opened by a page component should be closed from its effect cleanup, because a shared root layout does not unmount when a child route changes. |
You need a published Plandalf offer on a Stripe price and a Next.js app using the App Router.
Authorize Stripe in Plandalf, attach a price to the offer and publish it. Copy the offer slug and your organization's SDK URL, which are public configuration.
Create a client component that renders next/script with the SDK URL and strategy set to afterInteractive. In its onReady callback call plandalf('ready', ...) and store the SDK in context.
Wrap children in the provider in app/layout, so client navigation reuses one SDK instance instead of loading it per route.
In a client component return null or a loading line until the SDK exists, then render a button with data-plandalf-present set to your offer slug. Use data-plandalf-mode set to test while rehearsing.
Return a cleanup from the effect that calls the handle's close(). If the offer or promo changes, give the button a new React key that includes it, because changing an attribute on a bound element does nothing.
Check that the Stripe test connection is the one in use, pay with a Stripe test card, and match the Plandalf invoice to the Stripe payment before any live traffic.
A product team replaces a hand-built billing form with an upgrade button on its pricing route. Your server still reads the Stripe subscription before it changes a user's plan.
A launch route mounts the promo countdown in an effect with sdk.promo(), and the buy button applies the same promo, so the Stripe charge matches the tier on screen.
A route reached through a partner link loads the SDK before checkout, so the referral is captured when the visitor later pays through Stripe.
onReady and onLoad handlers in next/script work only inside client components, and server rendering must not open checkout or create widgets.data-plandalf-present button once the SDK is ready.key containing both values so a fresh element is created.Checked October 26, 2026 against Plandalf's own setup guides and the vendor documentation: Next.js docs: loading scripts.