Skip to main content

Product highlights

Product highlights allow the host of a live show to pin a product in the player overlay, drawing viewer attention to it. Your app is notified whenever the highlighted product changes, and can react by updating custom UI elements.

Handle Highlight Updates

Listen for the should-update-product-highlight event in your onEvent callback to receive the currently highlighted product.

import { Platform } from 'react-native';

function handleEvent(e) {
const { type, data } = e.nativeEvent;

if (type === 'should-update-product-highlight') {
const eventData = Platform.OS === 'ios' ? data?.event : data;
const productId = eventData?.id;
const sku = eventData?.ref;
const title = eventData?.title;

// Fetch your own product data and update your custom UI
}
}

Handle Product View (Custom Navigation)

When the product button is configured as 'none', tapping a highlighted product fires should-show-product-view instead of opening the player's built-in product modal. Use this to navigate to your native product detail screen.

if (type === 'should-show-product-view') {
const eventData = Platform.OS === 'ios' ? data?.event : data;
const sku = eventData?.ref;

navigateToProduct(sku);
}

To enable this behavior, set the product button to 'none' in your player configuration:

configuration={{
buttons: {
product: 'none',
},
}}

Handle Product List

When a user opens the product list in the player with product set to 'none', the should-show-product-list and should-hide-product-list events fire. Use these to coordinate your own product list overlay with the player.

if (type === 'should-show-product-list') {
showProductListOverlay();
}

if (type === 'should-hide-product-list') {
hideProductListOverlay();
}

ℹ️ Product data for highlights is provided to the player through product hydration. See Product hydration for how to supply product details using invoke('updateProductWithData', ...).