On this page

Node and Python SDKs

The shipped SDKs are @roveapi/browser 1.4.0 and roveapi 1.4.0. Use Node.js 20+ (with built-in fetch) or Python 3.9+ (package minimum). Python depends on httpx 0.27+. The quickstart contains equivalent, complete navigate/read/close examples.

Installation and environment

bash
npm install @roveapi/[email protected]
export ROVE_API_KEY='your-live-key'

Read ROVE_API_KEY from the environment. Both SDKs default to https://api.roveapi.com. For a local deployment, set baseUrl in Node or base_url in Python. Viewer grants bind to that API origin. An rvp_test_ key provides mocks; supervised browsers need rvp_live_ and credits.

Session lifecycle and errors

typescript
import { BrowserClient, RoveError } from '@roveapi/browser'

const rove = new BrowserClient({ apiKey: process.env.ROVE_API_KEY!, retries: 0 })
const session = await rove.session({ supervised: true })
try {
  await session.navigate('https://example.com', { timeoutMs: 30000 })
  console.log((await session.getA11yTree()).result.tree)
} catch (error) {
  if (error instanceof RoveError) console.error(error.status, error.code, error.detail)
  throw error
} finally {
  await session.close()
}

Closing a Python client releases its HTTP resources; the nested session context closes the remote browser. In Node, explicitly close every session in finally. The client itself has no close method. If both task and cleanup fail, retain both errors in your application logs.

Timeouts and retries

BehaviorNode.jsPython
General retriesDefault 3 retries after the first attempt, exponential jitter from retryDelay=1000 millisecondsDefault 3 retries, exponential jitter from retry_delay=1.0 seconds
HTTP timeoutNo SDK-level request timeout option; fetch controls transporthttpx client uses a 60-second timeout
Action timeoutnavigate timeoutMs; waitFor timeoutMsnavigate timeout_ms defaults to 30000; wait_for defaults to 10000
Retry exclusionsPermission, navigation-refused, egress-unavailable, credit, expired-session and invalid-params errors fail immediatelyNon-retryable 4xx fail immediately; 429 and idempotency-in-progress can retry
Retry-AfterGeneral requests use backoff; purchaseCredits honors Retry-After429/503 honor Retry-After; waits above 60 seconds are surfaced to the caller

Node's general request loop can retry generic errors including authentication errors. Neither SDK provides exactly-once browser actions. Set retries: 0 / retries=0 for workflows where a repeated click or request could cause an unwanted mutation, then recover from observed state. Do not add an unbounded outer retry loop. A timed-out action may have completed; inspect the page before repeating it.

Credit purchases have a separate maximum of three attempts and reuse the same idempotency key. Preserve the returned idempotencyKey / idempotency_key, including on errors, across your own retries. Honor waits and recovery instructions in the billing API.

Operational next steps

Read errors for typed problem details, troubleshooting for bounded recovery, and recipes for handoff and form workflows. Changelog and migrations records version-specific compatibility notes.

Node keyboard input

Use session.type({ selector: '[role=combobox]', text: 'Sentry', delayMs: 20 }) for per-key events in rich editors and search suggestions. Then session.press({ key: 'ArrowDown' }) and session.press({ key: 'Enter' }) choose a suggestion. Both accept ref, pageId and frame; press can focus an optional selector or ref first. type appends text and uses fill permissions; press uses click permissions. Both require agent control in supervised sessions. Action responses and activity never echo typed text.

Help improve this page: Report a correction.

Blocked on a task? Contact support. Include the error type and session ID; omit keys and viewer credentials.

Rove — the supervised browser for agents