The SDK reads configuration fromDocumentation Index
Fetch the complete documentation index at: https://docs.tally.site/llms.txt
Use this file to discover all available pages before exploring further.
data- attributes on the <script> tag at load time and can also be updated at runtime using Tallysight.configure(). Script tag attributes are applied first; programmatic calls override them at any point after the SDK initializes.
Script tag attributes
Add these attributes directly to the Tallysight<script> tag to configure the SDK before it initializes.
| Attribute | Value | Description |
|---|---|---|
data-tallysight-observer | "true" | Enables a MutationObserver to automatically load widgets added to the DOM after page load |
data-tallysight-widget-loading | "lazy" | Enables IntersectionObserver lazy loading globally for all widgets |
data-tallysight-bet-builder-enabled | "true" | Initializes the bet builder widget on page load |
data-tallysight-base-url | URL string | Custom base URL for widget bundles (e.g., your own CDN or reverse proxy) |
data-tallysight-analytics-enabled | "false" | Disables built-in analytics page view tracking |
data-tallysight-defaults-widget-config-* | Any string | Default configuration applied to all widget elements on the page |
data-tallysight-overrides-widget-config-* | Any string | Override configuration forced onto all widget elements, even if a widget specifies its own value |
Programmatic configuration
CallTallysight.configure(options) at any point after the SDK initializes to update configuration at runtime. The method returns Tallysight so you can chain additional calls.
| Option | Type | Default | Description |
|---|---|---|---|
autoDetect | boolean | false | Automatically detects and loads widgets when the DOM changes |
bundleBaseUrl | string | "https://storage.googleapis.com/tallysight-widgets/dist" | Base URL used to construct widget bundle URLs |
betBuilder.enabled | boolean | false | Initializes the bet builder widget immediately when set to true |
configure() with other SDK methods:
Default and override widget config propagation
Thedata-tallysight-defaults-widget-config-* and data-tallysight-overrides-widget-config-* attributes let you apply configuration to every widget on the page from a single place on the script tag, rather than repeating the same attribute on each widget element.
Defaults
Adata-tallysight-defaults-widget-config-* attribute sets a fallback value for all widgets. Any individual widget that specifies its own value for that config key takes precedence over the default.
For example, data-tallysight-defaults-widget-config-workspace="the-athletic" applies the the-athletic workspace to every widget on the page. A widget element that also sets data-tallysight-widget-config-workspace="sports-interaction" will use sports-interaction instead.
Overrides
Adata-tallysight-overrides-widget-config-* attribute forces a value onto every widget, regardless of what a widget element specifies for itself. Use overrides when you need to enforce a consistent config — for example, locking all widgets to a specific odds format.
Defaults and overrides work for any
data-tallysight-widget-config-* key, not just workspace and format. For example, data-tallysight-defaults-widget-config-odds-by="best-odds" sets a default sportsbook selection for every widget on the page.Self-hosting widget bundles
By default, the SDK loads widget bundles fromhttps://storage.googleapis.com/tallysight-widgets/dist. You can point the SDK at your own domain by setting data-tallysight-base-url or bundleBaseUrl in configure().
Tallysight recommends a reverse proxy over a manual download because a proxy always serves the latest bundles without requiring you to re-download files.