Skip to content

Node.js SDK Reference

import { Rayobrowse } from 'rayobrowse';
const client = new Rayobrowse({
endpoint: 'wss://cloud.rayobrowse.com', // or 'ws://localhost:9222'
apiKey: 'your-api-key', // required for cloud
});
PropertyTypeDescription
endpointstringWebSocket endpoint (local or cloud)
apiKeystringAPI key (required for cloud, can be empty string for local)

Create a browser session and return the CDP WebSocket URL.

OptionTypeDescription
backendstringEngine identifier
osstringTarget OS fingerprint
proxystringProxy URL
headlessbooleanRun headless
maxLifetimenumberSession TTL in seconds
vncbooleanStart noVNC session
browserLanguagestringAccept-Language header
uiLanguagestringUI locale
browserVersionMinnumberMinimum browser version
browserVersionMaxnumberMaximum browser version
screenWidthMinnumberMinimum screen width
screenHeightMinnumberMinimum screen height
forceVisibilitybooleanForce browser visibility
metadataobjectCustom metadata (JSON-stringified)
protectionRecord<string, string>Per-feature protection overrides

Reconnect to an existing session by ID.

Close a session. Defaults to the most recent session. Throws RayobrowseError if no session ID is available.

listBrowsers(): Promise<Record<string, unknown>[]>

Section titled “listBrowsers(): Promise<Record<string, unknown>[]>”

List active browser sessions.

Check service health.

getSessionCount(): Promise<{ limit: number; remaining: number }>

Section titled “getSessionCount(): Promise<{ limit: number; remaining: number }>”

Check concurrent session limit and remaining capacity.

PropertyTypeDescription
sessionIdstring | nullSession ID from the most recent connectUrl() call
vncUrlstring | nullVNC URL when vnc: true was used
interface ConnectOptions {
backend?: string;
os?: string;
proxy?: string;
headless?: boolean;
maxLifetime?: number;
vnc?: boolean;
browserLanguage?: string;
uiLanguage?: string;
browserVersionMin?: number;
browserVersionMax?: number;
screenWidthMin?: number;
screenHeightMin?: number;
forceVisibility?: boolean;
metadata?: Record<string, unknown>;
protection?: Record<string, string>;
}
interface HealthStatus {
status: string;
uptime: number;
}
ErrorStatusPropertiesDescription
RayobrowseErroranystatusCode, bodyBase error class
AuthError401Invalid or missing API key
ConcurrencyLimitError429limit, active, retryAfterConcurrent browser limit reached
RateLimitError429retryAfterRequest rate limit exceeded
BrowserCreateErrorvariesstatusCode, bodyBrowser creation failed