Gates
Use Plandalf gates to check access before showing a checkout, upgrade, or protected product action.
Gates let you centralize “can this customer access this?” checks around a named action and fallback offer.
Register a gate
plandalf.addGate("export-csv", "upgrade-pro", async () => {
const user = await getCurrentUser();
return user.plan === "pro";
});
Check a gate
const { access } = await plandalf.gate("export-csv");
if (!access) {
await plandalf.present("upgrade-pro");
}
Use cases
- unlock a paid feature after purchase
- show an upgrade offer when a user reaches a limit
- check subscription state before a protected action
- reuse the same upgrade offer across multiple feature gates
Identity
For account-specific gates, call identify(jwt) before evaluating the gate so the checkout and the access check refer to the same customer context.
Related docs
Builder context
Move from SDK setup to the commerce surface.
SDK docs cover install, identity, gates, events, and React integration. The linked product surfaces show what the SDK is presenting or listening for.