Bytebot Node Library

The Bytebot Node.js library provides access to the Bytebot API from JavaScript/TypeScript.
Requirements
Bytebot requires Puppeteer version 21.9.0 or greater.
API Docs
You can find Bytebot's complete API docs at docs.bytebot.ai.
Installation
npm install --save @bytebot/sdk
# or
yarn add @bytebot/sdk
Usage
import puppeteer from "puppeteer";
import { BytebotClient, Table, Column, Text } from "@bytebot/sdk";
const bytebot = new BytebotClient({
apiKey: "YOUR_API_KEY",
});
async function run() {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto("https://www.ycombinator.com/companies", {
waitUntil: "networkidle0",
});
console.log("Acting on the page");
const actActions = await bytebot.act("Click on the W23 filter", page);
console.log("actActions", actActions);
await bytebot.execute(actActions, page);
console.log("Extracting table data");
const extractActions = await bytebot.extract(
Table([
Column("Company Name", Text("The name of the company")),
Column("Company Description", Text("The description of the company")),
]),
page
);
console.log("extractActions", JSON.stringify(extractActions, null, 2));
const result = await bytebot.execute(extractActions, page);
console.log("Extracted table data", result);
await browser.close();
}
run().catch(console.error);
Beta status
This SDK is in beta, and there will be breaking changes between versions without a major version update.