Player API reference
Events
Listed below are all the events emitted by the LiSA player. Use .on() to register event listeners to each of these events.
library.player.Event.CART_VIEW
User clicks the shopping cart CTA.
Parameters:
url — The shopping cart URL.
Usage example:
library.player.Event.CLOSE
The player has been closed.
Usage example:
library.player.Event.ERROR
The player threw an error.
Parameters:
type — An error type indicator. message — The error message.
Usage example:
library.player.Event.OPEN
The player has been opened.
Parameters:
showId — The identifier of the show that has been loaded.
Usage example:
library.player.Event.READY
LiSA player is ready for communication.
Usage example:
library.player.Event.PRODUCT_ADD_TO_CART
User adds a product to the shopping cart
Parameters:
data — An object providing the products identifier (id) and action. action can either be a product URL (to open its PDP) or a serialized JSON structure required for executing the desired event action. Type definition at the end of this document.
first — Indicator, whether it is the first time this event is triggered for the respective product.
product — The Product data.
Usage example:
library.player.Event.PRODUCT_GRANT_REACTION
User "likes" a product.
Parameters:
data — An object providing the products identifier (id) and action. action can either be a product URL (to open its PDP) or a serialized JSON structure required for executing the desired event action. Type definition at the end of this document.
first — Indicator, whether it is the first time this event is triggered for the respective product.
product — The Product data.
Usage example:
library.player.Event.PRODUCT_REVOKE_REACTION
User "unlikes" a product.
Parameters:
data — An object providing the products identifier (id) and action. action can either be a product URL (to open its PDP) or a serialized JSON structure required for executing the desired event action. Type definition at the end of this document.
first — Indicator, whether it is the first time this event is triggered for the respective product.
product — The Product data.
Usage example:
library.player.Event.PRODUCT_VIEW
User clicks a product card to see its details.
Parameters:
data — An object providing the products identifier (id) and action. action can either be a product URL (to open its PDP) or a serialized JSON structure required for executing the desired event action. Type definition at the end of this document. first — Indicator, whether it is the first time this event is triggered for the respective product. product — The Product data.
Usage example:
library.player.Event.SHOW_READY
The show has finished initialisation.
Parameters:
data — An object providing show related data and a map of products featured in the show. Type definition at the end of this document.
Usage example:
Methods
This section lists the public methods the LiSA player object exposes.
grantLike(input: CarouselItemInput)
Pre-fill the heart (or any other reaction icon) on a product carousel item. This can be useful, if you integrate the carousel item reaction feature with your wish list or favorites. LiSA does not store user data including product likes granted during a show. In order for you to reflect the current users wish list or favorites with the products featured in a show, grantLike helps pre-filling the reaction icon.
joinUser(input: UserJoinInput)
In case your storefront or website context provides access to profile data of authenticated users, you can pass a user's profile data to the LiSA player. This enables you to re-use the user's data for a more seamless user experience, e.g. displaying a user's avatar in the chat or using his name as chat handle. joinUser(input: UserJoinInput)
In case your storefront or website context provides access to profile data of authenticated users, you can pass a user's profile data to the LiSA player. This enables you to re-use the user's data for a more seamless user experience, e.g. displaying a user's avatar in the chat or using his name as chat handle.
maximize()
When the LiSA player is minimized, invoke this method to maximize it again.
Usage example:
minimize()
Minimizes the LiSA player.
Usage example:
off(event: string, handler: () => void)
Removes a previously registered event listener from receiving any more events.
Parameters
event — A string which specifies the type of event for which to remove an event listener.
handler — The event listener function of the event handler to remove from the LiSA player.
The event listener function of the event handler must be the same as at the time of registration. Using .bind() changes the function reference.
Calling off() with arguments that do not identify any currently registered event listener on the LiSA player has no effect.
Usage example:
on(event: string, handler)
Registeres an event handler for any of the events listed above.
Usage example:
removeAllListeners(event: string)
Remove all event listeners previously registered to the LiSA player.
Usage example:
revokeLike(input: CarouselItemInput)
Oppsite of grantLike.
Type definitions
Product event data
Show event data
Last updated