PlandalfDocsSign inStart free

Deadline timers

Free countdown timer SDK

The free countdown timer script at https://plandalf.com/embed/countdown.js renders any of Plandalf's 17 countdown themes entirely in the browser. It requires no account, makes no server calls and sets no cookies. Use the visual countdown builder to configure one and copy the snippet, or write the JavaScript config directly below.

Quick install with JavaScript

Load the script and call PlandalfTimer.mount() with your config:

<div id="plandalf-timer"></div>
<script src="https://plandalf.com/embed/countdown.js"></script>
<script>
  PlandalfTimer.mount({
    target: '#plandalf-timer',
    mode: 'fixed',
    until: '2026-12-31T23:59:59Z',
    variant: 'ocean',
    placement: 'inline',
    label: 'Offer ends in',
    expiredText: 'This offer has ended',
  });
</script>

Quick install with HTML attributes

Any element with data-pf-free-timer mounts automatically when the script loads:

<div
  data-pf-free-timer
  data-mode="evergreen"
  data-duration="172800"
  data-storage-key="launch-offer"
  data-variant="midnight"
  data-placement="bar-top"
  data-label="Early-bird pricing ends in"
  data-cta-label="Claim 20% off"
  data-cta-url="https://yoursite.com/offer"
></div>
<script src="https://plandalf.com/embed/countdown.js" async></script>

Configuration options

OptionDefaultWhat it does
targetnullCSS selector or DOM element for inline placement (ignored for sticky bars).
mode'fixed''fixed' counts down to until; 'evergreen' uses durationSeconds in localStorage.
until24h aheadISO 8601 timestamp for fixed mode, shown in the visitor's local clock.
durationSeconds172800Countdown length in seconds for evergreen mode (48 hours default).
storageKey'default'Saved in localStorage under plandalf_free_timer_<key> so refreshes keep the deadline.
variant'boxed'Any of Plandalf's 15 built-in SDK presets (PlandalfTimer.variants).
separatorpreset defaultDivider between units: 'colon', 'line', 'dot' or 'none'.
placement'inline''inline', 'bar-top' or 'bar-bottom'.
label'Offer ends in'Headline text shown above or beside the clock.
onExpire'message''message' (shows expiredText), 'hide' or 'redirect' (uses redirectUrl).
ctaLabel / ctaUrlemptyOptional call-to-action button rendered inside the timer or sticky bar.
showSublabelstheme defaultShows or hides DAYS, HRS, MIN, SEC labels under each unit.
borderRadius16Corner radius in pixels for inline placement (0 to 32).
overrides{}Override any theme token: bg, digitColor, labelColor, separatorColor, digitBoxBg, digitBoxBorder, ctaBg, ctaColor.

Plug in your own tracking

If you want to control deadlines from your own backend, CRM or session store, pass resolveDeadline and react to onTick or onExpired:

const instance = PlandalfTimer.mount({
  target: '#my-timer',
  variant: 'boxed',
  overrides: { bg: '#0b1b3e', digitColor: '#8ceee8' },
  resolveDeadline: () => fetchDeadlineFromYourCookieOrApi(),
  onTick: ({ remainingSeconds }) => {
    if (remainingSeconds === 300) showLastChanceNotice();
  },
  onExpired: ({ deadlineMs }) => {
    window.analytics?.track('timer_expired', { deadlineMs });
  },
});

// Read live state or remove the widget later
instance.getRemaining(); // seconds left
instance.getDeadline();  // unix timestamp in ms
instance.destroy();

Isolation and paid Deadline timers

The free script renders inside Shadow DOM so your page styles cannot break the layout, and stores local evergreen timestamps under plandalf_free_timer_* keys. It never touches the paid SDK's plandalf_promo_* state.

When you need server-enforced per-buyer deadlines across devices, animated countdown GIFs inside emails, or automatic checkout price switches, see Deadline timers.