Skip to main content
The TypeScript SDK gives you full programmatic control over BAP servers. Use it to build agent backends, custom automation tools, or integrate browser control into your application.

Installation

Quick Start

Use createClient() as a shorthand that creates and connects in one call:

Semantic Selector Helpers

The SDK exports factory functions for all selector types:

API Reference

Connection

Browser Lifecycle

Page Management

Actions

Observations

AI Agent Methods

Events

WebMCP Discovery

Connection Options

The BAPClient constructor accepts an options object:
The transport uses exponential backoff for reconnection: delay * 2^attempt.

Starting the Server

The TypeScript SDK requires a running BAP server. Start one with:

Requirements

  • Node.js >= 20.0.0
  • A running BAP Playwright server