payload Definition
In the Bridge Guide, when a case is added, the parameter object payload can be received via communication.
You can apply it by adding the required values per case to the addEventListener.
sauceflexEnter
Join Broadcast – Called automatically upon entering the page; sends an empty payload.
Payload | Type |
---|---|
null | Void |
sauceflexBroadcastStatus
Broadcast Status Change – Sends the configured value when the broadcast status changes (automatically called upon status change).
Payload | Type | description |
---|---|---|
broadcastStateCode | BroadcastStateCode | Broadcast Status |
sauceflexMoveBanner
Banner Click – Sends the configured value when a banner is clicked.
Payload | Type | description |
---|---|---|
linkUrl | String | Banner link infromation |
broadcastIdx | String | Broadcast ID |
bannerId | String | Banner ID |
sauceflexMoveExit
Leave Broadcast – Called when the leave button is clicked; sends an empty payload.
Payload | Type |
---|---|
null | Void |
Login Button Click – Called when the login button is clicked; sends an empty payload.
Payload | Type |
---|---|
null | Void |
Product Click – Sends the configured value when a product is clicked.
Payload | Type | description |
---|---|---|
linkUrl | String | Product link information |
broadcastIdx | String | Broadcast ID |
price | String | Number | Product price |
externalProductId | String | null | Product code |
isSoldout | Boolean | Sold Out Status |
sauceflexOnShare
Share Broadcast Click – Sends the configured value when the share button is clicked.
Payload | Type | description |
---|---|---|
linkUrl | String | Broadcast Link |
shortUrl | String | Null | Broadcast short Link |
sauceflexPictureInPicture
PIP Button Click (WebView only) – Hides the player’s button UI when the PIP button is clicked. (Note: PIP functionality requires separate development.)
Payload | Type |
---|---|
null | Void |
sauceflexSendPlayTime
Live/VOD Switching – Continuously sends values when the broadcast switches between live and VOD segments.
Payload | Type | description |
---|---|---|
position | Number | Current Playback Position |
Reward Button Click – Sends the configured value when a button appears after a reward is achieved.
Payload | Type | description |
---|---|---|
broadcastIdx | String | Broadcast ID |
linkUrl | String | Reward set URL |
Coupon Button Click – Sends the configured value when a coupon button is clicked.
Payload | Type | description |
---|---|---|
broadcastIdx | String | Broadcast ID |
couponCode | String | Null | Coupon code |
couponId | String | Null | Registered Coupon ID |
couponName | String | Null | Registered Coupon Name |
couponType | 'link' | 'newWindow' | 'download' | 'custom' | Coupon Type |
linkUrl | String | Null | Redirect URL |
metadata | String | Null | Custom Data Passed on Click Event |
Usage Example
(You can insert your code snippet or reference to an example here.)
window.addEventListener("message", (e) => {
if (typeof e.data !== "string") return;
let jsonData = JSON.parse(e.data);
switch (jsonData.key) {
case "sauceflexEnter":
console.log("Join Broadcast", jsonData.params);
break;
case "sauceflexBroadcastStatus":
console.log("Broadcast Status ", jsonData.params.broadcastStateCode);
break;
case "sauceflexMoveExit":
console.log("Close Broadcast");
break;
case "sauceflexMoveBanner":
console.log("Banner Data – Link Reference", jsonData.params.linkUrl);
console.log("Banner Data – Broadcast Reference", jsonData.params.broadcastIdx);
console.log("Banner Data – Banner ID", jsonData.params.bannerId);
break;
case "sauceflexMoveLogin":
console.log("Broadcast Login");
break;
case "sauceflexMoveProduct":
console.log("Product Data – Link Reference", jsonData.params.linkUrl);
console.log("Product Data – Broadcast Reference", jsonData.params.broadcastIdx);
break;
case "sauceflexOnShare":
console.log("Share Link", jsonData.params.linkUrl);
console.log("Share ShortLink", jsonData.params.shortUrl);
break;
case "sauceflexPictureInPicture":
console.log("PIP");
break;
case "sauceflexSendPlayTime":
console.log("Current Broadcast Position", jsonData.params.position);
break;
case "sauceflexMoveReward":
console.log("Reward Achievement Link Data", jsonData.params.linkUrl);
break;
case "sauceflexMoveCoupon":
console.log("Coupon Link Data", jsonData.params.linkUrl);
break;
}
});
Updated 14 days ago