Loyalty & Rewards - Javascript / Events References

Should you require to do further modification to the Rewards widget which involves Javascript, you may have to use Stamped.io's listening event to run the codes after the widget is loaded.

In This Guide

Adding The Listening Event Code

Add this JS function for listening to events fired by Stamped.io

function addEventListenerStamped(el, eventName, handler) {
if (el.addEventListener) { el.addEventListener(eventName, handler); }
else { el.attachEvent('on' + eventName, function () { handler.call(el); }); }

// Listening for event
addEventListenerStamped(document, '##replaceWithEventName##', function(e) {

// Example
// Listening for launcher loaded event
addEventListenerStamped(document, 'stamped:launcher:loaded', function(e) {


Event Name Fired When
stamped:launcher:loaded The launcher loaded
stamped:widget:rewards-earnings:loaded Page Earnings widget loaded

JS Methods

Script Function
StampedFn.toggleRewardsModal(); Open/close the Launcher
Load the "Referrals" card view.
Load the "Sendings" card view.
Load the "Earnings" card view.
Call this method to load the "Your Rewards" card view.