Recording

View as Markdown

Recordings capture everything that happened in a browser runtime — every page navigation, tab switch, and visual frame. Embed the recording player to replay sessions after they complete.

Access via runtime.recording().

Getting the embed URL

1const { iframeUrl } = await runtime.recording();

The returned iframeUrl is a fully authenticated, time-limited URL for the recording player.

1<iframe src={iframeUrl} style="width: 100%; height: 600px; border: none;" />

Response

1const { iframeUrl, token, expiresAt, status, durationMs, tabIds } =
2 await runtime.recording();
FieldTypeDescription
iframeUrlstringAuthenticated URL for the recording player
tokenstringEmbed token
expiresAtstringToken expiry (ISO 8601)
statusstringRecording status — encoding, ready, expired
durationMsnumberTotal recording duration in milliseconds (when ready)
tabIdsstring[]List of tab IDs captured in the recording

Recording status

StatusDescription
encodingThe recording is still being processed. The player will show a loading state and poll for updates.
readyThe recording is ready to play.
expiredThe recording has been deleted after the retention period.

Recordings are available while the runtime is still running (for live sessions) and after it stops. Encoding starts automatically when the runtime stops.

Player features

The recording player includes:

  • Tab strip — Switch between tabs that were open during the session
  • Timeline scrubber — Seek to any point in the recording
  • Play/pause — Standard playback controls
  • Speed control — 0.5x, 1x, 1.5x, 2x playback speed
  • URL bar — Shows which page was active at the current playback time
  • Navigation buttons — Displays the navigation state at each point in time

Listening for playback events

The recording iframe posts messages to the parent window as playback progresses:

1window.addEventListener("message", (event) => {
2 if (event.data?.type === "bctrl:recording-time") {
3 console.log("Current time:", event.data.timeMs);
4 }
5});

Retention

Recordings are retained for 7 days after the runtime stops. After that, the recording embed returns an expired state.

HTTP equivalent

POST /v1/workspaces/{workspaceId}/runtimes/{alias}/embed/recording

Response:

1{
2 "iframeUrl": "https://...",
3 "token": "eyJ...",
4 "expiresAt": "2025-01-15T12:00:00Z",
5 "status": "ready",
6 "durationMs": 45200,
7 "tabIds": ["tab_1", "tab_2"]
8}