Browse SDK examples

Add checkout to a button

Publish an offer with the slug upgrade, then connect a button on your page. HTML attributes need only the browser bundle. JavaScript and React let the page await the checkout result and refresh access from your server.

The SDK scans the page and binds the button automatically. Use your organization's SDK URL.

upgrade.html
<script defer src="https://your-org.plandalf.dev/js/plandalf-sdk.js"></script>
<button data-plandalf-present="upgrade">Upgrade</button>

This opens checkout without application JavaScript. If the upgrade grants access to a paid feature, your server must confirm the purchase before granting it.

usePresent() returns the core FlowHandle<FlowResult>, so the same awaitable result and type definitions apply. The HTML trigger opens the same offer but has no Promise in the markup. The checked-out Numi React package currently has typecheck errors; verify a matching package build before using it in production.

Feature detail