Skip to main content

Talview Session Playback SDK

The Talview Session Playback SDK publishes a lightweight JavaScript wrapper that wires your application to Talview’s hosted player experience. It exposes a single factory, sessionPlayback(), and registers that factory on window.TalviewSDK.sessionPlayback after the loader script runs. The wrapper takes care of initializing the embedded iframe and proxying lifecycle events back to your app. Review the main Talview SDK getting started guide for details on loading the core bundle once per page.

Accessing sessionPlayback

When the Talview SDK loader finishes, it attaches a global called TalviewSDK. The sessionPlayback property on this object is the factory exported by this package:
  • window.TalviewSDK.sessionPlayback for script-tag consumers.

Quick Start (Script Tag)

<div id="playback-root"></div>
<script
  src="https://sdk.tlv.cx"
  async
  crossorigin="anonymous"
></script>
<script>
  window.addEventListener('DOMContentLoaded', () => {
    const playback = window.TalviewSDK.sessionPlayback({
      dsn: 'dsn',
      uuid: 'uuid',
      container_id: 'playback-root',
    });

    playback.onReady(() => {
      console.log('Playback ready');
    });
  });
</script>

sessionPlayback Options

Pass a configuration object when invoking sessionPlayback(). Each field is required unless noted otherwise.
  • dsn – Talview Data Source Name that links the player to your Talview account or environment.
  • uuid – Identifier of the session (for example, session-123) you want to play back.
  • container_id – DOM element id where the player iframe should mount; the element must exist before you initialize playback.

Ready Callback

The factory exposes an onReady helper so you can attach logic once the iframe player is bootstrapped:
const playback = TalviewSDK.sessionPlayback(options);

playback.onReady(() => {
  console.log('Playback ready');
});
Handle errors through the global TalviewSDK.onError hook described in the main getting-started guide.