Initialize the SDK
You can interact with the LoyaltyLion SDK using its JavaScript API. You can use this to initialize and authenticate the SDK, configure various settings, and listen to events emitted when customers take various actions.
The LoyaltyLion SDK adds itself to the window.loyaltylion
variable.
Initialization
loyaltylion.init
is called automatically for Shopify, BigCommerce and Adobe
Commerce installations.
loyaltylion.init
should be called once per page load to initialize the LoyaltyLion SDK and (if applicable) authenticate the current logged in customer. You’ll need your LoyaltyLion site token to identify your store.
Initialize example without customer
loyaltylion.init
should only ever been called once per page load. Calling
this method more than once throws an exception error and result in a slower
user experience.
If a customer is logged in, their information and authentication data should be passed in, using a server-side generated auth token.