Browse SDK

plandalf.promo()

Open a live promo handle.

Implemented by the browser object; parameter and return types follow the delegated class declaration.

Call this after plandalf.ready(). The browser wrapper can return undefined before initialization.

Signature

plandalf.promo(slug: string): PromoHandle

Arguments

NameTypeMeaning
slugstringPromo slug to monitor.

Example

promo.js
plandalf.ready(async () => {
  const handle = plandalf.promo('early-bird')
  const state = await handle
  console.log(state?.remaining)
})

Returns

PromoHandle

Behaviour

The browser object forwards only the slug. The ES module class accepts additional PromoHandleOptions, which are not forwarded here.

All plandalf methods

Feature detail