The Session Replay API streams session replays as HLS for embedded playback. Each tab’s recording gets its own playlist; play them back with hls.js or any HLS-capable player. The same recordings power the Dashboard’s Session Inspector.
Quickstart
Given asessionId from Create a Session, fetch a replay in two calls: list the pages, then fetch the playlist for any page.
- Node.js
- Python
- cURL
.m3u8 document: a plain-text manifest that points at a sequence of fragmented-MP4 (.m4s) segments served from the Browserbase CDN. Any HLS player fetches the manifest and streams the segments in order. For background on the format, see the HTTP Live Streaming overview on Wikipedia or the spec in RFC 8216.
Embedding a player
Any HLS-capable player works. Pick whichever fits your stack; the playlist URL is the same in all cases.- hls.js
- Shaka Player
- video.js
- Native HLS
hls.js is the most common choice for cross-browser HLS playback, and the recommended path for Firefox desktop, which has no native HLS support.
muted attribute is required even for short replays. Drop autoplay and muted if you want a click-to-play UX.
The playlist body references signed segment URLs on the Browserbase CDN. The browser fetches those segments directly, so your backend does not need to proxy them.
Multitab
Each recorded tab appears as its own page in the metadata response, with its own playlist URL.urlis a relative path againsthttps://api.browserbase.com.startTimeMsandendTimeMsare milliseconds from session start, not Unix epoch.- The API returns pages ordered by
pageIdascending.
Recommended integration pattern
Backend fetches the playlist
Your backend calls Your frontend then points its HLS player at
GET /v1/sessions/{id}/replays/{pageId} with x-bb-api-key and forwards the .m3u8 body to your frontend unchanged.- Express (Node.js)
- FastAPI (Python)
/replays/<sessionId>/<pageId> on your own origin.Frontend loads the playlist
Point your HLS player at the route on your backend that returns the playlist. The player parses the manifest and starts requesting segments.
Alternative: skip the proxy. If your backend renders the playback page server-side, you can fetch the playlist there, embed the
.m3u8 body in the page (or hand it to the player as a Blob URL), and skip the proxy route entirely. Segment URLs in the body are signed and work directly from the browser regardless of how the body got there.Segment URL expiration
Browserbase signs each playlist’s segment URLs, and they expire six hours after the API issues the playlist. Most playback sessions finish well before that. To resume playback beyond the expiry window, re-request the playlist; the API mints fresh segment URLs on every call.Rate limits
Browserbase rate limits the playlist endpoint (GET /v1/sessions/{id}/replays/{pageId}) to 120 requests per minute per project (sustained 2 RPS). Bursts above 2 RPS still succeed as long as your project stays under 120 requests per minute. Going over returns a 429 status code with standard rate-limit response headers; see Concurrency & Rate Limits for the retry pattern.
Disabling recordings
The Session Replay API serves the same recordings the Dashboard plays. To skip recording for a session entirely, setrecordSession to false when you create it; see Session Recording.
Sessions you create with
recordSession: false produce no replay. Both endpoints return 404 Not Found with {"message": "Replay not found"}. Live View remains available for real-time debugging.Troubleshooting
Player loads the playlist but no video plays:- Some HLS players don’t auto-play after
loadedmetadata. Callvideo.play()manually. - Most browsers block autoplay unless the video is muted; set
mutedon the<video>element if you want playback to start without a click.
- Browserbase signs segment URLs, and they expire six hours after the API issues the playlist. Re-fetch the playlist to get fresh segment URLs.
- Chromium browsers (Chrome, Edge) ship native HLS, which can fall through your
canPlayTypechecks. Prefer your library’s support detection (e.g.Hls.isSupported()) before the native fallback so segments go through the library’s CORS-aware fetch path.
Questions? Email support@browserbase.com