Use this file to discover all available pages before exploring further.
To get started, you first need to create a Grasp container. This will provision a cloud environment with a browser instance ready for you to connect to.
import { Grasp } from '@getgrasp/sdk';// Make sure your GRASP_API_KEY is set as an environment variableconst grasp = new Grasp();const container = await grasp.create();console.log('Container created with ID:', container.id);
Once the container is created, you can access its CDP endpoint to connect programmatically.
For powerful, programmatic control over the browser, Grasp exposes a Chrome DevTools Protocol (CDP) WebSocket endpoint. This allows you to connect with popular automation libraries like Playwright or Puppeteer.