Rewards Front End Integration
This page explains the integration requirements for being able to integrate Fast Track Rewards. This guide is for brands that have not integrated Fast Track Front End Javascript SDK earlier (and that does not intend to integrate Fast Track Rewards together with Fast Track Javascript SDK for On Site Notifications and Rich Inbox).
If you intend to integrate Fast Track Rewards Front End together with Fast Track Javascript SDK for On Site Notifications and Rich Inbox, read this article instead »
Step 1: Auth mechanism (JWT)
In your backend, you need to generate a JWT Token that conforms to Official JWT Specifications. This JWT Token should contain the currently logged in user's id and the JWT Token should be encoded with a secret that you'll you share with your Fast Track Partner Manager or Integration Manager.
Example JWT payload
Step 2: Set up the configuration object
Add this javascript code in your front end, preferably as early as possible.
Step 3: Load the Javascript SDK
Copy this snippet exactly as it is and paste it into your front end code, directly after where you pasted the configuration object (section above).
Step 4: Hook click event to open "My Rewards"
Below outlines how you can use Fast Track Rewards Web Components to show the "My Rewards Modal".
HTML:
You can put any HTML element inside the Fast Track element ft-my-rewards-toggle. The visibility of this HTML element and its content is controlled from FT CRM.
CSS:
In order to make the ft-my-rewards-toggle element hidden by default you can add below CSS.