The token is valid for 24 hours. Use the iframeUrl in an iframe to embed the recording player. The SDK session.recording() method combines this with metadata from GET /v1/sessions/{id}/recording into a single response.
Examples
import { Bctrl } from '@bctrl/sdk';
const bctrl = new Bctrl({ apiKey: process.env.BCTRL_API_KEY! });
// The SDK recording() method combines metadata + embed token
const session = await bctrl.session.playwright();
const rec = await session.recording();
console.log(rec.playbackUrl); // embeddable URL
console.log(rec.token); // JWT token
console.log(rec.expiresAt); // token expiry
console.log(rec.status); // recording status
console.log(rec.duration); // duration in ms
Response
Signed JWT for authenticated playback.
Embeddable URL for the recording player.
Token expiration time (ISO datetime).
Token TTL in seconds (86400).
{
"token": "eyJhbGciOiJIUzI1NiIs...",
"iframeUrl": "/embed/recording/sess_abc123?token=eyJhbGci...",
"expiresAt": "2025-01-16T10:00:00Z",
"expiresInSeconds": 86400
}