Key Concepts
Session
What it is?
A Session represents a running instance of a remote browser controlled by you or the LAM API. Sessions are primarily used with the Fleet API.
Lifecycle
- Creation: You initiate a session using the
/sessions/create
API endpoint (or the equivalent method in the SDKs). - Running: During the session’s active state, you can interact with it through a WebSocket connection. This is typically done using browser automation frameworks like Playwright, Puppeteer, or Selenium.
- Termination: You can terminate a session in a few ways:
- Explicitly: Using the
fleet.terminate()
endpoint. - Implicitly: By closing the playwright connection.
- Timeout: Sessions might have a predefined timeout, after which they automatically terminate.
Relationship to Tasks
A session can be associated with a Task (from the LAM API). This association allows you to observe and even control the browser as it carries out the task defined in the LAM API request.
Websocket URL
The Websocket URL provides the connection point for driving a remote browser in a session using a framework of your choice.
Livestream URL
The Livestream URL allows you to observe and interact with a running session. This is useful for debugging, monitoring, and providing real-time feedback to users.