Skip to content

Attributes Reference

All configuration for the <saytv-chat> web component is done through HTML attributes.

Configuration Attributes

AttributeTypeDefaultDescription
app-idstring-App identifier. Used to resolve the API URL automatically.
env'production' | 'staging''production'API environment. Used with app-id to resolve the correct API URL.
apiurlstring-Direct API base URL. Overrides app-id and env resolution.
auth-tokenstring-JWT access token for external authentication. When set, the SDK exchanges it for a SayTV session token.
built-in-auth'true' | 'false''true'Whether to show the built-in login/register UI. Set to 'false' when using external auth.
fanzone'true' | 'false''false'Enable the Fanzone feature.
heightnumber850Widget height in pixels.
widthstring'450px'Widget width. Accepts any CSS value (e.g., '100%', '500px').
mode'page-chat'-Enables page chat mode. The SDK auto-creates an episode tied to the current page.
page-idstringwindow.location.hrefUnique identifier for a page chat. Pages with the same page-id share the same chat. Only used when mode="page-chat".
page-namestringdocument.titleDisplay name shown in the chat header for page chat. Only used when mode="page-chat".
theme'light' | 'dark''light'Color theme.
custom-tab-urlstring-URL to load in a custom iframe tab. The tab only appears when this attribute is set.
custom-tab-labelstring'Custom'Label text for the custom tab in the footer.
custom-tab-iconstringGlobe iconIcon for the custom tab. Accepts a predefined name (home, chat, heart, trophy, search, flag, users, hash, info, lightbulb, mail, fanzone) or an SVG URL (https://...).

Connecting to the API

You have two options for configuring the API connection:

html
<saytv-chat app-id="your-app-id"></saytv-chat>

The SDK resolves the API URL from the app-id and env attributes. This is the recommended approach.

For staging:

html
<saytv-chat app-id="your-app-id" env="staging"></saytv-chat>

Option 2: Direct URL

html
<saytv-chat apiurl="https://your-api.example.com/api/v3"></saytv-chat>

The apiurl attribute takes precedence over app-id/env.

Custom Tab

Add a custom tab to the footer that loads an external URL in an iframe:

html
<saytv-chat
  app-id="your-app-id"
  custom-tab-url="https://example.com/shop"
  custom-tab-label="Shop"
  custom-tab-icon="trophy"
></saytv-chat>

The tab appears in the footer before the Profile tab. If custom-tab-url is not set, no tab is shown.

Icon options

Use a predefined icon name:

html
<saytv-chat custom-tab-url="..." custom-tab-icon="trophy"></saytv-chat>

Available names: home, chat, heart, trophy, search, flag, users, hash, info, lightbulb, mail, fanzone.

Or use a custom SVG URL:

html
<saytv-chat custom-tab-url="..." custom-tab-icon="https://cdn.example.com/icon.svg"></saytv-chat>

If omitted, a default globe icon is used.

Reactive Updates

All observed attributes are reactive. Changing an attribute at runtime updates the widget immediately:

js
const chat = document.querySelector('saytv-chat');

// Switch to dark mode
chat.setAttribute('theme', 'dark');

// Update the auth token
chat.setAttribute('auth-token', newToken);

// Resize the widget
chat.setAttribute('height', '600');
chat.setAttribute('width', '100%');

Debounced Attributes

Rapid changes to auth-token are handled efficiently to prevent unnecessary re-authentication.

Observed Attributes

All attributes listed in the Configuration Attributes table are observed. Changing any of them at runtime updates the widget immediately.

SayTV Chat SDK Documentation