Skip to main content

Constructor

Parameters

BrowserTestConfig

Example

Instance Properties

screenshot

ScreenshotAPI - Methods for capturing website screenshots Type: ScreenshotAPI

testing

TestingAPI - Methods for agentic testing and job management Type: TestingAPI

template

TemplateAPI - Methods for managing test templates Type: TemplateAPI

batch

BatchAPI - Methods for batch operations Type: BatchAPI

Instance Methods

testConnection()

Tests if the API connection is working and the API key is valid.

Returns

Promise<boolean> - true if connection is successful, false otherwise

Example

getUsage()

Retrieves current API usage and quota information.

Returns

Promise<QuotaInfo> - Usage statistics and quota limits

QuotaInfo

Example

Error Types

The SDK throws specific error types for different scenarios:

BrowserTestAuthError

Thrown when API key is invalid or authentication fails.

BrowserTestQuotaError

Thrown when API quota is exceeded.

BrowserTestAPIError

Thrown for general API errors.

BrowserTestTimeoutError

Thrown when requests timeout.

Configuration Examples

Basic Configuration

Advanced Configuration

Environment-Based Configuration

Best Practices

API Key Security

Error Handling

Connection Testing

Resource Cleanup