@getgrasp/sdk
v0.1.0
Published
Official Node.js SDK for Grasp
Readme
@getgrasp/sdk
Node.js SDK for interacting with the Grasp API.
Usage
Install the package via pnpm:
pnpm add @getgrasp/sdkCreate a client and call methods:
import { Grasp } from '@getgrasp/sdk';
const grasp = new Grasp({
apiKey: process.env.GRASP_API_KEY,
// baseUrl: 'http://localhost:3000' // Optional override for local development
});
const container = await grasp.create({
// containerId: 'existing-container-id', // Optional: resume an existing container
// metadata: { key: 'value' }
});
console.log(`Container ${container.id} started at ${container.createdAt}`);
console.log(`CDP endpoint: ${container.browser.wsEndpoint}`);
await container.shutdown();If you omit apiKey, the SDK reads the GRASP_API_KEY environment variable. The call
rejects immediately when no API key is available.
Development
pnpm --filter @getgrasp/sdk dev– Rebuild on changes.pnpm --filter @getgrasp/sdk build– Emit production bundles todist/.
Extend src/index.ts with the real API surface as endpoints become available.
