Betting Entertainment Tools

Chat Widget

Chat widget is an inline element that can be placed on any page. It allows users to chat with each other, share and copy open bets and place bets via the Flash Bet feature.


Parameters
Name Type Attributes Default Description
jwt string <required>

A signed JSON Web Token

channelId string <required>

Id of channel to open

matchId number

Sportradar match id, if provided and match is covered by Sportradar it will enable match events.

onAction function

Function/action handler. Is executed when a specific action occurs. Example:

onAction: function(action) {
     switch (action.type) {
         case 'CopyBet': {
             const { data } = action; // handle CopyBet action accordingly, `data` will be of `BetSlip` type.
             ...
         }
         case 'BetSuggestionOutcome': {
             const { data } = action; // handle BetSuggestionOutcome action accordingly, `data` will be of `ExternalOutcome` type.
             ...
         }
         case 'ContactSupport': {
             const { data } = action; // handle ContactSupport action accordingly, `data` will be of `ContactSupport` type.
             ...
         }
         case 'SwitchChannel': {
             const { data } = action; // handle SwitchChannel action accordingly, `data` will be of `ChannelSettings.tags` type.
             ...
         }
         case 'NavigateToPreviousChanel': {
             const { data } = action; // handle NavigateToPreviousChanel action accordingly, `data` will be of `NavigateToPreviousChanel` type.
             ...
         }
         ...
     }
 }

Click on Copy Bet executes onItemClick function with action object containing CopyBet type. You can then use data to add provided bet slip combination to bet slip on your site. Click on Outcome in bet suggestion executes onItemClick function with action object containing BetSuggestionOutcome type You can then use data to add provided event, market and outcome to bet slip on your site. Click on Contact Support executes contactSupport function with action object containing ContactSupport type You can then use this function to open your contact support page/form.

isRelativeTimeFormat bool true

Switch between regular timestamp of posted message (13:56) and relative time format (4m ago) for chat bubbles. Messages under 1min have the "now" timestamp.

shareNewBetButtonPosition 'top' | 'bottom' 'top'

Change 'Share a new bet' button position with 'top' and 'bottom' values.

Example

#1

```html
<script>
   (function(a,b,c,d,e,f,g,h,i){a[e]||(i=a[e]=function(){(a[e].q=a[e].q||[]).push(arguments)},i.l=1*new Date,i.o=f,
   g=b.createElement(c),h=b.getElementsByTagName(c)[0],g.async=1,g.src=d,g.setAttribute("n",e),h.parentNode.insertBefore(g,h)
   )})(window,document,"script","https://widgets.sir.sportradar.com/sportradar/widgetloader","SIR", {
       language: 'en'
   });
   // Virtual Stadium Chat Widget
   SIR('addWidget', '.sr-vs-widget', 'virtualStadium.chat', {matchId: {MATCH_ID}, channelId: "{CHANNEL_ID}", jwt: "{JWT}"});
</script>
<div class="vs-wrapper">
   <div class="sr-vs-widget"></div>
</div>