Skip to main content

Overview

BrowserSessionInfo contains runtime details about a browser session, including the CDP endpoint URL, the live-view URL, and the debug port. You typically access this through the info property on a running BrowserSession.

Import

from smolvm import BrowserSessionInfo

Fields

session_id
str
Unique identifier for the browser session.
vm_id
str
ID of the underlying SmolVM sandbox.
cdp_url
str | None
Chrome DevTools Protocol WebSocket URL. Connect Playwright or any CDP client to this endpoint. Available after the session starts.
live_url
str | None
noVNC live-view URL. Open this in a browser to watch the session in real time. Only available when the session is started in headed mode.
debug_port
int | None
Localhost port exposing the CDP endpoint on the host.
state
BrowserSessionState
Current session lifecycle state.

BrowserSessionState

Enum representing the lifecycle state of a browser session.
ValueDescription
CREATEDSession object exists but has not been started
STARTINGSession is booting the sandbox and launching the browser
RUNNINGBrowser is running and ready for connections
STOPPINGSession is shutting down
STOPPEDSession has been stopped
ERRORSession encountered an error

Example

from smolvm import BrowserSession

session = BrowserSession()
session.start()

info = session.info
print(f"Session: {info.session_id}")
print(f"CDP URL: {info.cdp_url}")
print(f"State: {info.state}")

session.stop()
session.delete()
Last modified on April 6, 2026