Create a promo
A promo is the campaign record behind timer surfaces and promo-aware checkout.
Setup steps
-
Create the promo
Give the campaign a slug such as
early-bird,black-friday, orlaunch-window. -
Choose the type
Configure fixed dates, evergreen timing, quantity windows, or tiered campaign phases where supported.
-
Define tiers
Add the active windows, labels, prices, coupons, or redirect targets for each phase.
-
Connect the offer
Choose the Plandalf offer and prices the promo should affect.
-
Publish widgets and links
Add countdown widgets, CTA links, hosted landing pages, or embedded checkout buttons.
Apply to checkout
await plandalf.present("summit-ticket", {
promo: "early-bird"
});Read promo state
Use plandalf.promo(slug) to read the current promo state from your storefront code.
The returned handle keeps monitoring after its first result resolves. For a one-time read, disable redirects and close it as below. Otherwise the default monitor can navigate to the active tier’s configured URL. Handle a null result when the promo cannot be resolved.
const handle = plandalf.promo("early-bird", { redirect: false });
try {
const promo = await handle;
console.log(promo?.activeTier?.label, promo?.remaining);
} finally {
handle.close();
}