Skip to main content

Goods

The Goods widget displays product cards inside story slides. When a story slide requests goods data, the SDK queries your app for product details by SKU.

Providing goods data

Register a goods callback using storyManager.getGoods(...). The callback receives an array of requested SKU strings and should return an array of product objects:

storyManager.getGoods(async (skus: string[]) => {
return skus.map((sku) => ({
sku: sku,
title: `Product ${sku}`,
subtitle: 'In stock',
imageURL: `https://example.com/images/${sku}.jpg`,
price: '99.99',
oldPrice: '129.99',
}));
});

Product Item Fields

FieldTypeDescription
skustring (required)Product SKU identifier
titlestringPrimary title shown in the product cell
subtitlestringSubtitle / description line
imageURLstringURL of the product image
pricestringCurrent product price
oldPricestringPrevious/discounted price (optional)

Product selection event

When the user taps a product card in the widget, onGoodItemSelected fires with the selected SKU in event.body.sku:

storyManager.onGoodItemSelected((event: any) => {
const { sku } = event.body;
console.log('User selected product SKU:', sku);
// Navigate to product details screen
});

Interactive Shopping Cart

If your stories allow users to add items directly to a cart or manage quantities, see the Product Cart guide.