The Tallysight SDK exposes a globalDocumentation Index
Fetch the complete documentation index at: https://docs.tally.site/llms.txt
Use this file to discover all available pages before exploring further.
window.Tallysight object with methods for scanning, loading, and configuring widgets. All methods are available after the SDK finishes initializing.
Before calling SDK methods, confirm the SDK is ready. Use
Tallysight.isReady() for a synchronous check, or await Tallysight.whenReady() to wait for initialization to complete before proceeding.Tallysight.scan([selector])
Scans the DOM for elements with data-tallysight-widget-type and loads the corresponding widget bundles. Call this after adding widget elements to the page dynamically.
Parameters
Optional CSS selector to limit the search scope. If omitted, the entire document is scanned.
Promise<number> — resolves with the number of widget elements found.
Tallysight.loadWidget(params)
Loads a single widget by referencing a specific DOM element or a widget type name. Use this when you need to load a widget directly rather than triggering a full DOM scan.
Parameters
Promise<void> — resolves when the widget bundle is loaded and initialized.
Tallysight.configure(options)
Updates the SDK configuration at runtime. Returns the Tallysight object so you can chain calls.
Parameters
Configuration options to apply.
When
true, enables a MutationObserver that automatically loads widgets added to the DOM after page load.Base URL for widget bundles. The SDK constructs each bundle URL as
${bundleBaseUrl}/${widget-type}.js. Override this to serve bundles from your own domain.Tallysight (chainable)
Tallysight.preloadWidget(type)
Fetches and caches a widget bundle without initializing or rendering it. Use this to warm up a bundle you expect to need soon, so the widget appears instantly when called.
Parameters
The widget type to preload (e.g.,
"odds-text", "tile").Promise<void> — resolves when the bundle is cached.
Tallysight.enableAutoDetection() / Tallysight.disableAutoDetection()
Enables or disables the MutationObserver that watches for widget elements added to the DOM after the initial page load. Both methods return Tallysight for chaining.
Returns: Tallysight (chainable)
Tallysight.enableLazyLoading() / Tallysight.disableLazyLoading()
Enables or disables IntersectionObserver-based lazy loading for widget bundles. When lazy loading is enabled, a widget bundle is fetched only when the widget element approaches the viewport. Both methods return Tallysight for chaining.
Returns: Tallysight (chainable)
Tallysight.enableBetBuilder() / Tallysight.disableBetBuilder()
Enables or disables the bet builder widget at runtime.
When you call enableBetBuilder(), the SDK creates a bet builder widget element, appends it to the document body, and loads the bundle. When you call disableBetBuilder(), all bet builder elements are removed from the DOM and their state is cleaned up.
Returns
enableBetBuilder()—Promise<boolean>: resolves totrueif the bet builder was successfully created,falseotherwise.disableBetBuilder()—boolean:trueif the bet builder was successfully removed,falseotherwise.
Tallysight.trackCustomEvent(name, props?, domain?)
Tracks a custom analytics event. Use this to log interactions that matter to your integration, such as a user clicking a widget or navigating to a sportsbook.
Parameters
The event name to record.
Optional key-value pairs of custom properties attached to the event.
Optional domain override. Defaults to the current page domain.
Promise<void>
Tallysight.isReady() / Tallysight.whenReady()
Check whether the SDK has finished initializing.
isReady()— synchronous check; returnstrueif the SDK is in the"ready"state,falseotherwise.whenReady()— returns aPromise<void>that resolves as soon as the SDK reaches the"ready"state. If the SDK is already ready, the promise resolves immediately.
Tallysight.getSdkState()
Returns the current initialization state of the SDK as a string.
Returns: string — one of "pending", "initializing", "ready", or "error".
| State | Meaning |
|---|---|
"pending" | The SDK script has loaded but initialization has not started yet |
"initializing" | The SDK is actively initializing modules |
"ready" | Initialization is complete; all methods are available |
"error" | Initialization failed; check the browser console for details |