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
| Field | Type | Description |
|---|---|---|
sku | string (required) | Product SKU identifier |
title | string | Primary title shown in the product cell |
subtitle | string | Subtitle / description line |
imageURL | string | URL of the product image |
price | string | Current product price |
oldPrice | string | Previous/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.