Skip to main content

Widget SDK Reference

Technical reference for all widget data attributes, configuration options, and advanced usage.

SDK setup

Include the SDK script once per page:

<script src="https://embedded.autopod.xyz/sdk/autopod-widgets.js"
data-autopod-api="https://player.autopod.xyz"
data-autopod-rss="https://rss.autopod.xyz"></script>

The SDK automatically scans the page for elements with data-autopod-widget and renders the appropriate component.

Global data attributes

These attributes go on the <script> tag:

AttributePurposeDefault
data-autopod-apiBase URL for the player APIhttps://player.autopod.xyz
data-autopod-rssBase URL for RSS feedshttps://rss.autopod.xyz

Widget element attributes

These attributes go on each widget <div>:

Required

AttributeTypeDescription
data-autopod-widgetStringWidget type (see table below)
data-stationStringStation slug (from your stream's RSS filename)

Content filtering

AttributeTypeDescription
data-showNumberFilter to a specific show ID
data-episodeNumberDisplay a specific episode ID
data-limitNumberMaximum items to display (default: 10)

Appearance

AttributeTypeOptionsDefault
data-themeStringlight, dark, systemsystem
data-accent-colorStringHex colour (e.g., #ff0000)Station colour
data-bg-colorStringHex colourTheme default
data-border-colorStringHex colour or noneTheme default
data-variantStringdefault, minimal, borderlessdefault
data-border-radiusStringnone, sm, md, lg, xl, fullmd
data-shadowStringnone, sm, md, lgsm
data-paddingStringnone, sm, md, lgmd
data-fontStringFont family nameSystem font

Behaviour

AttributeTypeDescription
data-positionStringMini Bar position: top or bottom
data-labelStringCustom text for Launch Button
data-densityStringSchedule density: compact, default, comfortable
data-hide-pastBooleanSchedule: hide past shows (true/false)
data-player-urlStringCustom player URL for "Open in Player" links
data-rss-base-urlStringCustom RSS base URL

Widget types

data-autopod-widget valueComponent
episodesEpisode list
scheduleSchedule grid (7-day)
schedule-agendaSchedule agenda (vertical list)
schedule-stripSchedule strip (horizontal timeline)
schedule-compactSchedule compact
showsShows grid
show-carouselShows carousel
show-cardSingle show card
show-playerShow-focused player
episode-cardSingle episode card
playerInline player
mini-barCompact sticky player
featuredFeatured episode
listen-liveLive stream player
on-airOn-air badge
launch-buttonListen Now button
player-buttonPlay button
now-nextNow/next schedule
searchEpisode search
podcast-subscribePodcast subscription links
station-heroStation hero section

Colour cascade

Widgets resolve colours in this priority order:

  1. HTML data attributes (highest priority — e.g., data-accent-color)
  2. Player settings (configured in the dashboard)
  3. Stream defaults (your station's base colour)
  4. SDK defaults (neutral fallback)

This means you can set colours once in the dashboard and all widgets pick them up, or override per-widget with data attributes.

Dynamic content (SPA support)

The SDK uses a MutationObserver to detect widgets added to the page after initial load. This means widgets work in single-page applications (React, Vue, Angular, etc.) — just add the element to the DOM and the SDK initialises it automatically.

Audio engine

All playback widgets on a page share a single audio engine instance. This means:

  • Starting playback in one widget pauses any other playing widget
  • Playback state (current time, playing/paused) is synced across all widgets
  • Queue management works across widget boundaries

Examples

Episode list with custom styling

<div data-autopod-widget="episodes"
data-station="my-station"
data-limit="5"
data-theme="dark"
data-accent-color="#22c55e"
data-variant="borderless"
data-border-radius="lg"></div>

Live player with schedule strip

<div data-autopod-widget="listen-live"
data-station="my-station"
data-theme="dark"></div>

<div data-autopod-widget="schedule-strip"
data-station="my-station"
data-hide-past="true"></div>

Minimal show-specific player

<div data-autopod-widget="show-player"
data-station="my-station"
data-show="42"
data-variant="minimal"
data-shadow="none"></div>