Skip to main content

getRewardsVipTiers

Retrieves the list of VIP tiers. The locale parameter is optional and can be used to customize the response based on the desired language.

Usage example​

Before call a request, ensure the SDK and the Rewards module are ready:

function onSdkReady() {
const moduleName = window.gw.sdk.common.constants.modules.REWARDS;

window.gw.sdk.runIfModuleReady(moduleName, () => {
window.gw.sdk.rewards.methods
.getRewardsVipTiers()
.then(console.log)
.catch(console.error);
});
}

if (window.gw && window.gw.sdk) {
onSdkReady();
} else {
document.addEventListener("gwSdkReady", onSdkReady);
}

This code ensures that the SDK and the Rewards module are ready before attempting to call a request. The method will either succeed, returning a success result, or fail, returning an error with details about what went wrong.