Debugging & events
Inspect state and subscribe to session updates.
Watch session state
With an initialized client and a session ID:
for await (const session of client.sessions.watch(sessionId, {
timeoutMs: 60_000,
})) {
console.log(session.status, session.controller, session.releasedAt);
if (session.releasedAt !== null) break;
}The SDK reads authenticated SSE snapshots and resynchronizes after reconnection. Older instances use polling. This is current state, not a durable history of every event.
| Option | Type | Default | Description |
|---|---|---|---|
timeoutMs | number | 300000 | Total subscription deadline, milliseconds |
pollIntervalMs | number | 500 | Polling and reconnect interval |
signal | AbortSignal | None | Cancel a TypeScript subscription |
Python uses sessions.watch(session_id, timeout_ms=60000). Close an early-exit iterator with contextlib.aclosing.
Browser logs
With a connected Playwright page:
page.on("console", (message) => console.log(message.type(), message.text()));
page.on("pageerror", (error) => console.error(error.name));
page.on("requestfailed", (request) => console.error(request.failure()?.errorText));Listeners run in your application. Redact website data and credential-bearing URLs before storing logs. Use Live view to inspect the screen.
Save required evidence before releasing the browser. For API failures, see error codes.