Replay Protocol
The Replay Protocol is useful for creating programmatic debugging sessions.

Replay Protocol
-
Authentication. The Authentication domain defines a command for authenticating the current user.
-
Console. The Console domain defines methods for accessing messages reported to the console.
-
CSS. The CSS domain is used to inspect the CSS state at particular execution points.
-
Debugger. The Debugger domain defines methods for accessing sources in the recording and navigating around the recording using breakpoints, stepping, and so forth.
-
DOM. The DOM domain is used to inspect the DOM at particular execution points.
-
Graphics. The Graphics domain defines methods for accessing a recording's graphics data.
-
Network. The Network domain is used to inspect the Network state at particular execution points.
-
Pause. The Pause domain is used to inspect the state of the program when it is paused at particular execution points.
-
Recording. The Recording domain defines methods for managing recordings.
-
Session. The Session domain defines methods for using recording sessions.
-
Target. The Target domain includes commands that are sent by the Record Replay Driver to the target application which it is attached to.
-
Internal. The Internal domain is for use in software that is used to create recordings and for internal/diagnostic use cases.
Protocol examples
import { createSession } from "./create-session";
import { RequestInfo, RequestEventInfo } from "@replayio/protocol";
function fetchNetworkResponseBody(recordingId: string) {
return createSession({ apiKey, recordingId }, async (client, { sessionId }) => {
const requests: RequestInfo[] = [];
const events: RequestEventInfo[] = [];
async function fetchRequests() {
client.addEventListener("Network.requests", resp => {
requests.push(...resp.requests);
events.push(...resp.events);
});
await client.sendCommand("Network.findRequests", {}, sessionId);
}
await fetchRequests();
});
}