WebSocket endpoint returned by agent-browser. Frames and user input travel over this connection.
Browser
A composable React viewport for agent-browser. Stream a real session, visualize agent actions and hand control to a person without changing transports.
pnpm add @browser-ui/reactDemo
Find Mac mini, configure the desktop and a Studio Display, then hand the live session back at Apple’s final review.
Usage
Pass the stream URL from your agent-browser session and the small amount of state your application already owns.
import { AgentBrowser } from "@browser-ui/react";
type SessionBrowserProps = {
streamUrl: string;
operating: boolean;
action?: string;
onTakeControl: () => void;
onEndSession: () => Promise<void> | void;
};
export function SessionBrowser({
streamUrl,
operating,
action,
onTakeControl,
onEndSession,
}: SessionBrowserProps) {
return (
<AgentBrowser
streamUrl={streamUrl}
viewportSize={{ width: 1440, height: 900 }}
operating={operating}
operatingLabel={action}
operatingShader={{
variant: "tide",
direction: "top-left-to-bottom-right",
speed: "fast",
}}
showPictureInPicture
showFullscreen
onTakeControl={onTakeControl}
onEndSession={onEndSession}
/>
);
}
Props
The composed API stays controlled where product behavior matters and provides sensible defaults for presentation.
Stream
Remote browser resolution, independent from the rendered component. Keep it fixed to preserve desktop breakpoints in PiP.
Shape of the rendered component only. It never changes the remote viewport.
Controls Browser UI chrome independently from the streamed page. System follows the host device preference.
Reports navigation messages emitted by the remote browser.
Reports the requested remote viewport dimensions to the session owner.
Reports connecting, connected, disconnected and error states.
Agent activity
Shows the activity shader and pauses direct viewport input while the agent owns the session.
Current action displayed in the compact status control.
Selects the active-agent shader and configures its movement across the viewport.
Normalized cursor position and pressed or typing state for visualizing live or recorded agent actions.
Controls the rendered cursor width in CSS pixels.
Controls the soft radial glow beneath the cursor.
Reports structured agent activity, including labels and live cursor state.
Copy shown while the WebSocket is connecting or reconnecting.
Display
Use the standalone glass frame or an unstyled edge-to-edge surface.
Adds the optional address and reload controls.
Adds the floating picture-in-picture control.
Adds application fullscreen without changing the remote viewport size.
Constrains fullscreen to a host element and tracks its bounds and border radius.
Controls the display mode from your application.
Initial display mode when Browser manages its own state.
Reports transitions between inline, PiP and fullscreen.
Adds host-owned actions to Browser UI's display-control strip.
Class name applied to the package-owned display-control strip.
Session control
Projects the viewer's capabilities and active control lease into the browser surface.
Enables local input intent; projected access still decides whether commands are authorized.
Called when the person stops the workflow and takes ownership of browser input.
Renders the terminal action and delegates destruction of the underlying browser to the host.
Overrides the accessible label for the package-owned terminal action.
Navigation
Current URL shown by the optional controls.
Receives address submissions so the session owner can navigate agent-browser.
Receives reload requests from the optional browser controls.
Accessible name for the interactive remote viewport.
Class name applied directly to AgentBrowserViewport.