Skip to content

JavaScript API

The loyalty widget exposes a small global function, window._asl(...), that lets you control it from your own theme — for example, opening it from a navigation link instead of the built-in launcher button.

The widget must already be installed (via the Appy Stamp app) and eligible to display on the page. If the widget isn’t set to show for the current page or customer, these calls have no visible effect.

window._asl('open');

From a navigation link:

<a href="#" onclick="window._asl('open'); return false;">Rewards</a>
window._asl('close');

There is no single toggle call, so check the current state first:

function toggleRewards() {
var frame = document.querySelector('.stamped-launcher-frame-container');
var isOpen = frame && frame.classList.contains('stamped-launcher-open');
window._asl(isOpen ? 'close' : 'open');
}

Add ?stamp=open to any URL and the widget opens on load (when it’s eligible to display). Useful for “view your rewards” links in emails or from other pages:

https://your-store.com/account?stamp=open