Next Commerce
UtilitiesFOMO

Get Started

Start the FOMO rotation with one method call after the SDK has finished initializing.


Minimal Setup

<script>
  window.addEventListener('next:initialized', () => {
    next.fomo();
  });
</script>

That is the complete setup. With no arguments, FOMO uses:

  • The first 5 packages from your active campaign (those with images)
  • Default customer names from US (auto-detected per timezone)
  • 0 ms initial delay, 5 s display, 12 s between popups, 2 mobile shows max

Verify It Is Working

After the page loads you should see:

  • A small popup card slide in from the corner showing a customer name, product image, and product name
  • It hides after 5 s, then a new one appears 12 s later
  • Console: [FomoPopupEnhancer] FOMO popup configured: { ... } and FOMO popup started

If nothing appears, check:

  • The campaign has at least one package with an image value
  • The page is calling next.fomo() after next:initialized fires (calling it earlier silently does nothing)
  • You are not on a mobile viewport with maxMobileShows already exhausted (refresh)

Stop the Rotation

Call next.stopFomo() to stop showing popups and clear any pending timers. The currently visible popup is hidden immediately.

next.stopFomo();

This is useful on checkout and confirmation pages where social proof becomes a distraction.

window.addEventListener('next:initialized', () => {
  if (window.location.pathname.includes('checkout')) return;
  next.fomo();
});

Next Steps

On this page