Shoppable Videos
The shopping feature enables your audience to browse and purchase products while watching videos. With this feature, users can view product details, explore available options (colors, sizes, etc.), and add items to their cart without leaving the video experience.
Note: The SDK does not provide payment processing. You are responsible for managing the shopping cart and checkout flow through the provided callbacks.
Overview
Firework SDK provides:
Product Display: Built-in UI to display product lists and handle user interactions
Shopping Cart: Callbacks for cart management and checkout flow
Product Details: Integrated product detail pages (PDP) with customizable actions
Purchase Tracking: Analytics integration for conversion tracking
UI Themes
The SDK provides two color themes for the shopping interface:
FireworkSdk.shopping.setShoppingViewOptions(
ShoppingViewOptions(
theme = ShoppingTheme.LIGHT // or ShoppingTheme.DARK
)
)

New Product Cards
Important: New Product Cards are only available when using Player Version 2 (V2). The Version 1 product cards described below are maintained for backward compatibility but will not receive new features.
The Firework SDK provides an enhanced product card experience in Player Version 2 with improved UI, better performance, and new features. To access the new product cards, you must enable V2 for both the video player and livestream player.




Why Use Player Version 2?
✅ All future updates and new features are only available in V2 &#xNAN;⚠️ V1 is in maintenance mode and will not receive new features
Player Version 2 provides:
Enhanced Product Cards: Improved UI with better animations and interactions
Better Performance: Faster rendering and smoother scrolling
Modern Design: Updated visual design aligned with current standards
Active Development: Ongoing improvements and new features
Bug Fixes: Priority bug fixes and updates
How to Enable Player Version 2
To use the new product cards, enable V2 for both video player and livestream player before SDK initialization:
Step 1: Set Player Versions in Application Class
Step 2: Enable Livestream Support (If Needed)
If you're using livestream features, also add the livestream player dependency:
And configure the livestream initializer:
Available Player Versions
Short Video Player:
Livestream Player:
Important Notes
⚠️ Player versions must be set before
FireworkSdk.init()✅ Both players are independent - you can use V2 for one and V1 for the other
✅ However, we strongly recommend using V2 for both players
✅ V1 will continue to work but will not receive new features
✅ New product cards are automatically enabled when using V2 players
Verification
After enabling V2, you can verify the product cards are using the new version by observing:
Improved animations when scrolling through products
Enhanced visual design with updated spacing and typography
Better touch feedback on product card interactions
Smoother transitions when opening product details
Product Card Click Handler
By default, clicking a product card opens the product detail page (PDP). You can override this behavior:
Version 1 Product Cards Configuration
Product cards display a list of available products in the video. Each card represents a product with its image, title, price, and action button.
Configurable Properties
Corner Radius: Rounded corners of product cards
CTA Button Label: "Shop now" or "Buy now"
CTA Button Visibility: Show or hide the action button
Click Action: Custom handler for card clicks
Corner Radius
The default corner radius is 4dp. You can customize it:
Visual Comparison:


CTA Button Label
The default label is "Shop now". You can change it to "Buy now":

CTA Button Visibility
Control whether the CTA button is shown on product cards:
Visual Comparison:


Custom Product Cards
Important: Custom product cards require enablement by your Firework account manager.
The SDK allows you to provide a fully custom view for product cards:
Implementing Custom Product Card View
Create a custom view by extending FwProductCardView:
Important Notes
Size Requirements: Width and height must be in pixels. The SDK may limit card size to respect the safe zone specifications.
Click Handling: Custom product cards cannot have clickable elements. All clicks are intercepted by the SDK.
Shopping CTA Button
The shopping CTA button appears on the product detail page and triggers the add-to-cart or shop-now action.

CTA Button Click Listener
Handle clicks on the shopping CTA button:
CTA Button Status
For long-running operations (e.g., adding to cart via API), notify the SDK of the operation status:
Status Types:
CtaButtonStatus.Loading- Operation in progressCtaButtonStatus.Success- Operation completed successfullyCtaButtonStatus.Error- Operation failed
Note: If status is not provided within 10 seconds, the SDK assumes the operation failed.
CTA Button Text
Choose between "Add to cart" and "Shop now" labels:
Usage Guidelines:
Add to cart: Use when shopping cart is enabled
Shop now: Use for direct navigation to product pages without cart
Customize Shopping CTA Button
You can customize the "Add to Cart" button appearance by overriding the FwShoppingCtaButtonStyle in your app's theme:
Basic Styling
Shape Customization
To customize button shape (rounded corners, etc.):
Shopping Cart
The SDK does not manage the shopping cart internally. You are responsible for:
Maintaining cart state
Managing cart items
Handling checkout flow
The SDK provides callbacks and configuration options for cart integration.
Cart Behavior
Configure how the shopping cart behaves using CartBehaviour:
Available Behaviors:
CartBehaviour.NoCart (Default)
Shopping cart icon is hidden
Suitable for "Shop now" mode without cart
CartBehaviour.Callback
Cart icon is shown
OnCartActionListener.onCartClickedis triggered when clickedUse when opening cart as a separate activity
CartBehaviour.Embedded
Cart icon is shown
Fragment from
EmbeddedCartFactoryis displayed when clickedRequires calling
setEmbeddedCartFactoryfirst
Embedded Cart Example
Cart Click Listener
Important: This listener only works with
CartBehaviour.Callback.

Product Detail Page (PDP)
PDP Link Button Click Listener

Handle clicks on the PDP link button:
Return Value:
true- Your app handles the navigationfalse- SDK opens the product page
PDP Link Button Visibility
Control whether the PDP link button is shown:
Product Hydration
Product hydration allows you to provide real-time product data from your backend. See Product Hydration for detailed information.
"Shop Now" Mode
Configure the SDK for direct product page navigation without a shopping cart:
Error Handling
Implement OnShoppingErrorListener to receive shopping error events:
Error Types
Programmatic Control
Dismiss Shopping UI
Close the shopping interface programmatically:
Open Shopping Cart
Open the shopping cart programmatically:
Purchase Tracking
Track completed purchases for analytics and conversion tracking.
Function Signature
Parameters
orderId
String
✅
Unique identifier for the order/transaction
value
Double?
❌
Total transaction value (defaults to 0.0 if null)
currencyCode
String?
❌
Currency code (defaults to "USD" if null)
countryCode
String?
❌
Country code (defaults to device locale if null)
additionalInfo
Map<String, String>
✅
Additional custom tracking information
products
List<ProductItem>?
❌
List of purchased products
shippingPrice
Double?
❌
Shipping cost for the order
subtotal
Double?
❌
Subtotal before shipping and taxes
ProductItem Structure
Usage Examples
Basic Purchase Tracking
Complete Purchase with Products
Minimal Configuration
Related Documentation
Product Hydration - Real-time product data integration
Analytics - Event tracking and analytics
Last updated
Was this helpful?