Getting Started

Installation

Integrating Bytebot into your TypeScript project is straightforward, whether you’re starting a new project or integrating it into an existing one. Follow these steps to get Bytebot up and running in your development environment.

Prerequisites

  • Node.js version 18.x.x or higher
  • Puppeteer version 21.9.0

Install Bytebot

Open your terminal and navigate to your project’s root directory.

Run the following command to install the Bytebot SDK using npm:

$npm install @bytebot/sdk

Configure Your .env File

In the root of your project, create or update your .env file to include your Bytebot API key:

1BYTEBOT_API_KEY=your_bytebot_api_key_here

Initialize BytebotClient

In your TypeScript application, import and initialize BytebotClient as follows:

1import { BytebotClient } from '@bytebot/sdk';
2
3const bytebot = new BytebotClient({
4apiKey: process.env.BYTEBOT_API_KEY,
5});

This snippet assumes you are using a package like dotenv to load environment variables from your .env file. If you haven’t already, you can install dotenv and load the variables at the entry point of your application:

$npm install dotenv

Then, at the top of your main file (e.g., index.ts):

1import 'dotenv/config';

Next Steps

With Bytebot installed and configured, you’re ready to start leveraging its capabilities in your TypeScript project. Refer to the Bytebot SDK documentation for info on using Bytebot to automate web tasks, including best practices for efficient development.