Session recording
Record what happens in a session and watch it back later. Replay any session in the console, or pull the recording down in your own code.
Enable recording
const browser = await client.launch({
recording: true,
})
const page = await browser.newPage()
await page.goto("https://example.com")
const sessionId = browser.id
await browser.close()Read replays back
// Get a temporary link to the replay you can open or share.
const { url, expiresInSeconds } =
await client.sessions.getReplayUrl(sessionId)
// Or download the raw recording to keep or process yourself.
const ndjson = await client.sessions.downloadReplay(sessionId)The download is a line-by-line log of everything that happened on the page, ready to feed into a replay player. You can also watch replays in the console: click any session row and hit Replay.
Sensitive form data
Recording captures input values by default. Handle replays of sessions that touch passwords, payment data, or other sensitive input with care: restrict who can read them and purge them on the cadence your compliance posture requires.
