Skip to main content

Installation

Install the SDK using your preferred package manager:

Quick Start

API Reference

new Grasp(options)

Create a new Grasp client instance.
object
Returns: Grasp client instance Example:

grasp.create(options)

Create and start a new container.
object
Returns: Promise<GraspContainer> Example:

grasp.connect(containerId)

Connect to an existing container by ID. If the container is sleeping, it will be awakened.
string
required
The ID of the container to connect to
Returns: Promise<GraspContainer> Example:

GraspContainer

The container object returned by grasp.create() and grasp.connect(). Properties:
string
Unique container identifier
string
Container status
string
ISO timestamp of creation
GraspBrowserSession
Browser session details
Methods:

container.shutdown()

Shut down and clean up the container. Returns: Promise<void> Example:

GraspBrowserSession

Browser session details associated with a container. Properties:
string
Chrome DevTools Protocol WebSocket endpoint
string
Live view URL for observing the browser
Example:

Type Definitions

TProxySettings

TBrowserSettings

TTerminalSettings

TFileSystemSettings

Environment Variables

  • GRASP_API_KEY - Default API key (recommended)

Error Handling

TypeScript Support

The SDK is written in TypeScript and includes full type definitions.

Complete Example with Playwright

Reconnecting to Containers

Save the container ID and reconnect later: