In-app upgrade from a settings screen
A SaaS app adds an Upgrade button to its billing screen. The button opens the Pro offer, and the app calls identify() so the purchase is tied to the signed-in user.
Checkout embed
A React app can open a Plandalf checkout from a data attribute or a hook, and Stripe processes the payment.
No credit card required. No coding required.
ReactPlandalf is not a Stripe component library for React. It gives a React app two ways to open its checkout: data attributes on JSX elements after one script load, or a provider and hooks from the React package. Either way the payment runs through the Stripe account connected in Plandalf.
| Event | From and to | Through | What happens |
|---|---|---|---|
| User clicks a buy button | React → Plandalf | A button with data-plandalf-present opens the offer in a modal. A div with data-plandalf-mount renders it inline. The SDK picks up elements React adds after page load. | |
| Payment | Plandalf → Stripe | Payment connection | The charge is made in your connected Stripe account, and your React bundle never holds a Stripe secret. |
| Checkout state changes | Plandalf → React | With the React package, a hook such as usePresent returns present and a presenting flag, and the SDK's handle can emit events your components subscribe to. | |
| Subscription or invoice events | Plandalf (paid via Stripe) → React | Webhook | Your backend, not the browser, should learn about paid invoices. A sequence can post them to an endpoint you control with Send Webhook. |
You need a published Plandalf offer with a Stripe price, and the ability to edit your HTML shell and a component.
Authorize Stripe in Plandalf, add the price to the offer and publish. Copy the offer slug and your public SDK URL from the share code.
Put the Plandalf script tag in your HTML shell with defer. Do not place an API secret or signing key in React code or a public environment variable.
Add a JSX button with data-plandalf-present set to the slug, data-plandalf-frame set to modal and data-plandalf-mode set to test. This is the simplest install and works for pricing screens and in-app upgrades.
When the offer or promo can change, render the button with a key made from both values and close the old handle in the effect cleanup. Updating attributes on an element the SDK already bound is not enough.
If the app needs gates or shared state, wrap it in PlandalfProvider and call usePresent. The React package page explains which package version those examples assume.
Confirm the connected Stripe account is a test account, pay with a test card, then reopen checkout from the same button and try a declined card. Check each result against the Plandalf invoice.
A SaaS app adds an Upgrade button to its billing screen. The button opens the Pro offer, and the app calls identify() so the purchase is tied to the signed-in user.
A landing page built as a React app uses attribute buttons, so designers can move the buy button without touching checkout code.
A step in a wizard mounts the offer inline with sdk.mount() inside an effect and closes the handle on unmount, so the checkout lives inside the flow.
promo query parameter on the page. The checkout can still receive the URL's promo, so check which campaign the resulting session used.data-plandalf-present, and the payment runs in your Stripe account.PlandalfProvider and hooks when the app needs gates, context or per-call user identity.key so React creates a new element.Checked October 26, 2026 against Plandalf's own setup guides.