Available Javascript Methods
The Fast Track Front End Javascript Library has a set of public methods available. Below you find a list of them.
All of below functions are avaiable at window.FasttrackCrm
like window.FasttrackCrm.toggleInbox()
.
toggleInbox()
toggleInbox()
Toggles the Inbox modal to be shown or hidden. Inbox functionality must be enabled for this to work.
togglePendingBonusesV2()
togglePendingBonusesV2()
Toggles the Pending Bonuses model to be shown or hidden. Pending Bonuses must be enabled for this to work.
init()
init()
If the flag autoInit
is set to false, you can manually or by code initialise the javascript library using this method. Also, a good usage of this method if your SID
would expire and you want to re-authenticate, then you can do the following:
window.sid = 'new-sid-here';
and then you run this method.
logout()
logout()
This method logs the front end user out from the javascript library. If you have the possibility, it is good practice to log the user out from the javascript library if the user logs out from your site.
demoMessage()
demoMessage()
After the script has been initialised you can send a Demo Message / Debug Message locally. This can be useful when adjusting Front End designs.
// Event property can either be 'message' or 'shoutout'
window.FasttrackCrm.demoMessage({
Event: 'message',
Title: 'Title',
Message: 'Message body',
CTAButtonLink: 'https://www.google.com',
CTAButtonText: 'Primary button',
ImageUrl: 'https://via.placeholder.com/900x380',
CTAButton2Link: 'https://www.google.com',
CTAButton2Text: 'Secondary button',
Expires: '2020-05-05 10:00:00',
DisplayType: 'push', /* Can be 'silent' or 'push'. Only used when Event is 'inbox'. */
PreviewText: 'Preview text',
FooterText: 'Footer text',
});
Last updated
Was this helpful?