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
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
{
"expiresInSeconds": 60,
"tokenPrefix": "v1.eyJvcmdJZ..."
}