Include the below script in your HTML file.
<script src="https://amplify-launcher.dgdcnmnewfrib.amplifyapp.com/assets/scripts/sdk.js"></script>
Create CustomerGlu object right below the script.
<script src="https://amplify-launcher.dgdcnmnewfrib.amplifyapp.com/assets/scripts/sdk.js"></script><script>var clientId = "CLIENT_ID"; // REQUIREDvar userId = null; // OPTIONAL, uses browser session ID to track uservar glu = new CustomerGlu(clientId, userId); // Initilize CustomerGlu</script>
USER_ID is optional if the user has not logged in. A SESSION_ID would be created to track the user.
CodeSandbox - https://codesandbox.io/s/bold-kapitsa-6rejy​
CodePen - https://codepen.io/suhas_is_a_pen/pen/poNdvgr​
A client can specify the following configuration values
export ClientConfig {launcherExcludeList: [], // Paths where launcher is not shownfullPageWalletIncludeList: ["/rewards.html"], // Paths where full page wallet should be shownfullPageWalletHook: "#app", // HTML element that should hold the full page wallet};
launcherExcludeList
- URLs where you don't want CustomerGlu launcher to show up.
fullPageWalletIncludeList
- URLs where you want CustomerGlu to embed its rewards wallet.
fullPageWalletHook
- HTML element identifier, place on the page where the CustomerGlu rewards wallet will be shown.
CodeSandBox - https://codesandbox.io/s/bold-kapitsa-6rejy?file=/rewards.html​
1.1 Constructor - CustomerGlu(clientId: string, userId?: string);
1.2 Method: setUserId(userId: string) -
In Single Page Application, if userId is available after initializing the SDK, use this method to reset the userId.