Skip to main content
Logo
Explore APIsContact Us
  • Home
  • Match Preview
  • Tournament Preview
  • Virtual Stadium
  1. Resources
  2. Widgets
  3. LMT Golf

LMT Golf

This page describes the client integration instructions for the Live Match Tracker widget for golf. The same match.lmtPlus widget is used for golf, but with different behaviour and configuration. Only a small subset of regular LMT properties is supported for golf.

This guide covers only what is needed for golf integration.

LMT Golf

Default widget display

LMT Golf Hole View

Golf Course Hole Overview

See the LMT Golf widget demo.

#API Reference

#Required Parameters

  • widget-name: match.lmtPlus
  • entityId: The unique identifier for the golf event is the only required parameter. It should be formatted as a full entity string (e.g.sr:stage:<id>).

Environment Requirements

Supported Browsers

BrowserVersionMobile Support
Chrome60+✅ Chrome Mobile 60+
Firefox55+✅ Firefox Mobile 55+
Safari12+✅ iOS Safari 12+
Edge79+✅ Edge Mobile 79+
Internet ExplorerAll versions❌ Not Supported

Technical Requirements:

  • JavaScript enabled
  • XMLHttpRequest support for data fetching
  • CSS3 support for styling and animations
PropertyTypeDefaultDescription
entityIdstringRequiredUnique golf event identifier in full entity format
scoreboardstring"compact"Scoreboard display variant.
  • "compact": Minimal scoreboard with essential info
  • "disable": Hide scoreboard
tabsPositionstring"bottom"Position of tab navigation.
  • "top": Tabs above content
  • "bottom": Tabs below content
  • "disable": Hide tab navigation
tabsobjectSee LMT Tabs identifiersCustom tab configuration per sport. Object with sport IDs as keys and arrays of tab names as values
pitchCustomBgColorstring-Custom course background color (hex/rgb). Example: "#1a5f3e"
streamAuthfunction-See Stream Auth example.

#Theming

Theming for the golf widget is more limited than for the full LMT.

Tabs use the same theming and branding options as the regular LMT, while the main widget components are more limited and only the rules below apply to the main widget area.

Existing widget theming can be used for the regular LMT to have the same font and background-color rules applied to the golf widget — no extra setup needed. LMT Golf automatically sets light or dark theme based on background-color used.

info

If you are setting up theming for the first time, follow the Styling Widgets guide to set up default theming, then apply golf-specific overrides (if needed) as shown below.

Only font-family, background-color and color values can be changed. Other properties should be left as-is.

css
/* MIAN BACKGROUND COLOR */
.sr-bb {
    background-color: #fff;
}

/* DEFAULT TEXT COLOR */
.sr-bb .srt-base-1 {
    color: #333;
}

/* PRIMARY TEXT COLOR */
.sr-bb .srt-base-1-primary {
    color: red;
}

/* SURFACE BACKGROUND COLOR */
.sr-bb .srt-golf-surface {
    background-color: gray;
}
note

No other srt-* classes are used in LMT Golf widget and changing their values won't make any difference in appearance of LMT Golf widget.

#Streaming

Streaming for Golf is available only with Premium LMT Feature.

To enable video playback authorization, a callback function needs to be passed to the widget config using streamAuth prop. The widget calls this function on each playback auth request, so your implementation must generate a fresh token on every call.

The callback must resolve to: { auth: string, timestamp: number, operatorId: number }:

  • operatorId identifies your operator. Both the operatorId and the secret token will be provided during client setup process.
  • auth (generated with secret token and timestamp) and timestamp are auth payload values

Check example below for some pseudo code on how to generate the payload.

warning

Keep the streaming secret on your server only. Never expose it in browser code.

#Stream Auth Example

Premium streaming auth function. Must return Promise<{ auth: string, timestamp: number, operatorId: number }>. It is invoked on each playback auth request and should generate a new token. Generated token is valid for 5 minutes.

Server-side token generation example

js
// The token must be generated on your backend. Never expose the secret in browser code.
// Call this from a protected server endpoint and return the result to the client.
import crypto from 'crypto';

export function generateTokenDetails() {
    const secret = process.env.STREAMING_SECRET;
    const operatorId = Number(process.env.STREAMING_OPERATOR_ID);

    if (!secret) {
        throw new Error(`Missing or env variable "STREAMING_SECRET" is not set.`);
    }

    const timestamp = Date.now();
    const tokenString = `${secret}:${timestamp}`;
    const hmac = crypto.createHmac('md5', secret);

    return {
        auth: hmac.update(tokenString).digest('hex'),
        timestamp,
        operatorId,
    };
}

#Integration Examples

#Property Name Transformations

Properties do not always transfer from the above table directly into integration code. Properties must be transformed differently for each integration method:

JavaScript/Programmatic Integration

  • Property names remain unchanged in camelCase
  • Properties become members of the 4th parameter object in SIR() call
  • Example: cardVariant: "compact"
info

In javascript integration, the properties go into an object which is passed as the 4th argument of the call ti SIR() function. Please see Global SIR API

HTML/Declarative Integration

  • Convert camelCase to lowercase with dashes, e.g. cardVariant becomes card-variant
  • Add data-sr- prefix
  • Example: cardVariant → data-sr-card-variant
  • Example: filters.sport.hidden → Complex objects must be passed as JSON strings
info

In HTML integration, the properties go into the parent HTML object as object properties, prefixed with data-sr- as explained above.

Only base property support

This method supports only simple (base) properties and does not support properties that require functions.

info

In all examples replace sportradar in the widgetloader URL path with your clientId.

Example if your clientId is client1:

  • This URL: https://widgets.sir.sportradar.com/sportradar/widgetloader
  • becomes: https://widgets.sir.sportradar.com/client1/widgetloader

JavaScript (Programmatic)

Initialize the widget programmatically using the JavaScript API. The widget renders in the specified container element.

js
(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'
});

SIR('addWidget', '#sr-widget', 'match.lmtPlus', {
    entityId: 'sr:stage:123'
});
html
<div id="sr-widget"></div>

HTML (Declarative)

Insert the following HTML code at the target widget location. Complex object properties must be passed as JSON-encoded strings.

html
<div id="sr-widget"
        data-sr-widget="match.lmtPlus"
        data-sr-entity-id="sr:stage:123">
</div>
<script type="application/javascript"
        src="https://widgets.sir.sportradar.com/sportradar/widgetloader"
        async>
</script>
Last updated 4 days ago
Is this site helpful?
Widgets, Engagement Tools
LMT PlusLMT Compact
On this page
  • API Reference
  • Required Parameters
  • Theming
  • Streaming
  • Stream Auth Example
  • Integration Examples
  • Property Name Transformations