SHA-1
hash of the following concatenated items, in order:
id
ISO 8601
timestamployaltylion.init
or loyaltylion.authenticateCustomer
to authenticate the customer.
loyaltylion.init
call. This ensures the customer is authenticated as soon as the LoyaltyLion SDK is ready.
You should call loyaltylion.init
conditionally on the customer’s logged in state, that is, passing just the site token (initialize example without customer) if a customer isn’t logged in, or passing the customer information and authentication data (initialize example with customer) if a customer is logged in.
The date passed in the auth
object must be the same timestamp used to generate the auth token.
loyaltylion.init
at the same time as loading the snippet, with just the site token and no customer information. You can later pass the customer information and authentication data in the loyaltylion.authenticateCustomer
method.
This method accepts the same customer
and auth
properties as loyaltylion.init
. It needs a server-side generated auth token.
The date passed in the auth
object must be the same timestamp used to generate the auth token.
logoutCustomer
method. This removes the signed-in customer’s data and refreshes the LoyaltyLion UI without requiring a full page reload. This can be particularly useful for single page applications (SPA) that support customers logging in / out without full page reloads.
Note that this is an asynchronous method. If no customer is currently signed in you will see a warning message in the console.