JavaScript SDK
Widget methods

Widget methods

Open widget

You can manually trigger the opening of the Joy floating widget with this method:

joyInstance.openWidget()

Close widget

You can manually trigger the close of the Joy floating widget with this method:

joyInstance.closeWidget()

Reload customer data

If you issue or redeem points using the API or Joy SDK and want other widgets or the loyalty page to refresh the customer’s balance and tier in real time, you can trigger a reload by calling:

window.joyInstance.updateCustomerState()

Open page

You can use this method to open a targeted page on the floating widget.

joyInstance.openPage(page)
//View below for possible values

All possible values for the page would be:

Page valuePage description
homeThe home page the widget
howToEarnThe earning program list of the widget
howToRedeemThe redeeming program list of the widget
milestoneV2The milestone rewards page of the widget
activitiesThe point history page of the widget
rewardsThe coupon list page of the widget

Open to a redeeming program

You can get the list of the redeeming programs available and then use the program ID to open:

joyInstance.openRedeemProgram(programId)

Register a custom handler for redirecting guests to the login

Register a custom callback to control how guests are redirected when they try to access loyalty actions. This lets you override the default redirect and send guests to your own login or signup flow.

window.addEventListener('joy:ready', () => {
    // Register the callback to handle guest redirects
    window.joyInstance.registerRedirectGuest((type, redirectUrl) => {
      // Your own code your simple to test: return alert('Need to login');
    });
 
    console.log('Guest redirect callback registered successfully');
  });

Product
Install AppWebsiteBook a Demo
Developers
JavaScript SDKREST API v2Webhook API
Company
Avada GroupHelp CenterContact
© 2026 Joy Loyalty by Avada Group. All rights reserved.