Debugging with Replay
How to record
Everything in Replay starts with a recording. A recording captures your application's runtime so you can inspect it after the fact — add console logs, inspect variables, step through code — without having to reproduce the bug again.
There are two ways to make a recording.
| Method | Best for | How it works |
|---|---|---|
| Replay Browser + CLI | Reproducing a bug by hand, or via your agent | Launches Replay Browser on a URL and uploads on close |
| Playwright | CI and automated test suites | The @replayio/playwright reporter runs tests in Replay Browser |
Both record at the browser runtime level, so the recording is an exact capture of what executed.
Replay Browser + CLI
The Replay CLI installs the Replay Browser, launches it on a URL you choose, and uploads recordings to your Replay account.
Install the Replay CLI
Terminalnpm i -g replayio
Record and upload
Terminalreplayio record https://your-app.com
This opens the Replay Browser. Interact with your app to reproduce the issue, then close the browser. You'll be prompted to upload, and you'll get a URL to inspect the recording.
Agent-driven recording: If you're working with an AI coding agent, it can trigger recordings for you using the replay-cli skill. Install it with npx skills add https://github.com/replayio/skills --skill 'replay-cli' and ask your agent to record your app.
Playwright
For automated test suites, configure Playwright to run tests in Replay Browser and upload a recording of each test. When a test fails in CI you get a recording of what happened on that machine instead of having to reproduce it locally.
Install the Replay Playwright plugin
Terminalnpm i -D @replayio/playwrightnpx replayio install
Add the Replay browser to your Playwright config
playwright.config.tsimport { defineConfig } from '@playwright/test'import { devices as replayDevices, replayReporter } from '@replayio/playwright'export default defineConfig({reporter: [replayReporter({apiKey: process.env.REPLAY_API_KEY,upload: true,}),['line'],],projects: [{name: 'replay-chromium',use: { ...replayDevices['Replay Chromium'] },},],})
REPLAY_API_KEY is an app.replay.io API key. Each test run then uploads a recording per test, and the reporter prints the recording URLs.
Agent-driven setup: AI coding agents can configure test recording for you using the replay-playwright skill. Install it with npx skills add https://github.com/replayio/skills --skill 'replay-playwright'.
Chrome extension
The Replay Debugger Chrome extension records from inside your regular Chrome by capturing the page's inputs and re-executing your code against them. It is convenient when you cannot switch browsers, but the re-execution can differ from the original session in timing-sensitive code. Prefer the CLI when you can.
Once you have a recording
Once a recording is uploaded, you can investigate it in several ways:
Investigate with an AI agent
Connect Replay's MCP server to your coding agent and let it inspect the recording — read source code, evaluate expressions, analyze React renders, and more.
Investigate with DevTools
Open the recording in Replay DevTools for manual time-travel debugging — step through code, inspect the DOM, view network requests.
Replay CLI reference
Every replayio command: install and update the browser, record, list and upload recordings, upload source maps.