Skip to content

Live view and takeover

Watch any running session in the browser and take the controls when a human step comes up: the takeover lease, its heartbeats and handing control back.

Last updated:

Many viewers, one writer

Session screencast /v1/live/:id CDP /v1/connect/:id one writer at a time Viewer watches, read-only Viewer watches, read-only Owner holds the takeover lease Agent suspended during takeover, resumes on release the lease expires with the holder's heartbeats -- a closed laptop cannot strand a session -- and access rides on short-lived signed tokens, never on the API key
The takeover lease is exclusive and heartbeat-bound: control returns to the agent when it is released or expires.
The live view of a Browserberg session with a person taking over control from the agent
A run that hits a 2FA prompt waits for a human hand, then continues.

How a takeover works

Any session can be watched live, by any number of viewers at once — but there is only ever one writer, and that exclusivity is the takeover lease. While a person holds the lease, the agent is suspended; on release, the agent resumes where it stood. In the dashboard the two buttons are labelled "Steuerung übernehmen" and "Steuerung abgeben".

The lease expires when its heartbeats stop, so a closed laptop cannot strand a session in human hands forever. The pattern this exists for is the 2FA or photoTAN moment: the run pauses, a person completes the step on the live page, hands control back, and the agent carries on.

Mint a viewing token

Requires: api-key dashboard-session

BASE="https://browserberg.com"
AUTH="Authorization: Bearer $BROWSERBERG_API_KEY"
JSON="Content-Type: application/json"

ID=$(curl -s -X POST "$BASE/v1/sessions" -H "$AUTH" -H "$JSON" -d '{"ttlSeconds": 120}' \
  | python3 -c 'import json,sys; print(json.load(sys.stdin)["session"]["id"])')

# Access to the live socket rides on a short-lived signed token, never on the
# API key. Today the dashboard session mints it; only an owner gets the write
# lease, a member watches read-only.
curl -s -X POST "$BASE/v1/dashboard/sessions/$ID/live-token" \
  -H 'x-browserberg-app: 1' -H "Cookie: $BB_DASHBOARD_COOKIE" \
  | python3 -c 'import json,sys; t = json.load(sys.stdin); print(json.dumps({
      "expiresInSeconds": t["expiresInSeconds"], "tokenPrefix": t["token"][:12] + "..."}, indent=2))'

curl -s -X DELETE "$BASE/v1/sessions/$ID" -H "$AUTH" > /dev/null

Nearby pages

  • Connect Playwright The same token, used to attach tooling
  • Audit reference Takeovers are logged, grant and release both
  • Session lifecycle What suspension means for deadlines