Skip to main content
The SDK reads configuration from 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.

Programmatic configuration

Call Tallysight.configure(options) at any point after the SDK initializes to update configuration at runtime. The method returns Tallysight so you can chain additional calls.
You can chain configure() with other SDK methods:

Default and override widget config propagation

The data-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

A data-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

A data-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 from https://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.
If you download and host bundles manually, you must re-download them periodically to pick up new features, bug fixes, and security patches.