Multi-Product Support
Unified access to Automate, App Automate, Screenshots, Local Testing, Accessibility, Test Management, Test Reporting, and Website Scanner.
Type-safe, fast, and generated from OpenAPI
npm install @dot-slash/browserstack-clientNode.js 22 or higher required. A BrowserStack account with the relevant product subscriptions is needed for each API.
Credentials are read from environment variables by default:
export BROWSERSTACK_USERNAME=<your-username>
export BROWSERSTACK_ACCESS_KEY=<your-access-key>Or pass them explicitly to any client constructor:
const client = new AutomateClient({ username: "me", accessKey: "key" });Import from the root (all clients) or from a product subpath (tree-shakeable):
// All clients from one import
import { AutomateClient, ScreenshotsClient } from "@dot-slash/browserstack-client";
// Or by product subpath
import { AutomateClient } from "@dot-slash/browserstack-client/automate";import { AutomateClient } from "@dot-slash/browserstack-client/automate";
const client = new AutomateClient();
const plan = await client.getPlan();
const builds = await client.getBuilds();
const sessions = await client.getSessions(builds[0].automation_build.hashed_id);import { AppAutomateClient } from "@dot-slash/browserstack-client/app-automate";
const client = new AppAutomateClient();
const projects = await client.getProjects();
const builds = await client.getBuilds(projects[0].id);import { LocalTestingBinary } from "@dot-slash/browserstack-client/local-testing";
const tunnel = new LocalTestingBinary({ accessKey: process.env.BROWSERSTACK_ACCESS_KEY });
await tunnel.start();
// ... run tests against localhost ...
await tunnel.stop();import { ScreenshotsClient } from "@dot-slash/browserstack-client/screenshots";
const client = new ScreenshotsClient();
await client.launch(
{
url: "https://example.com",
browsers: [{ browser: "chrome", browser_version: "latest", os: "Windows", os_version: "11" }],
},
(screenshot) => console.log("captured:", screenshot.imageUrl)
);import { AccessibilityClient } from "@dot-slash/browserstack-client/accessibility";
const client = new AccessibilityClient();
const reports = await client.getWorkflowAnalyzerReports();import { TestManagementClient } from "@dot-slash/browserstack-client/test-management";
const client = new TestManagementClient();
const projects = await client.getProjects();import { TestReportingClient } from "@dot-slash/browserstack-client/test-reporting";
const client = new TestReportingClient();
const build = await client.startBuild({
projectName: "my-project",
buildName: "my-build",
framework: "playwright",
});
// ... run tests ...
await client.finishBuild(build.buildHashedId, { status: "passed" });import { WebsiteScannerClient } from "@dot-slash/browserstack-client/website-scanner";
const client = new WebsiteScannerClient();
const scans = await client.listWebsiteScannerScans();Two CLIs are available. The Go CLI is the recommended option — it has no runtime dependency and is the most complete.
A single self-contained binary. No Node.js, no npm.
Download:
| Platform | Architecture | Link |
|---|---|---|
| Linux | x64 | browserstack-client-linux-amd64 |
| Linux | ARM64 | browserstack-client-linux-arm64 |
| macOS | Apple Silicon | browserstack-client-darwin-arm64 |
| macOS | Intel | browserstack-client-darwin-amd64 |
| Windows | x64 | browserstack-client-windows-amd64.exe |
See the CLI installation guide for download commands.
# Local Testing tunnel
browserstack-client local start
browserstack-client local run-with my-tunnel -- npm test
browserstack-client local stop
# Upload a JUnit XML report
browserstack-client test-reporting upload-report ./results.xml \
--project-name "My Project" --build-name "Build #42"
# Upload an Allure report
browserstack-client test-reporting upload-report ./allure-results.zip \
--project-name "My Project" --build-name "Build #42" --format allure
# Automate
browserstack-client automate list-projects
browserstack-client automate get-project <project-id>
# App Automate
browserstack-client app-automate upload-flutter-android-app ./my-app.apk
browserstack-client app-automate list-appsRequires Node.js 22+. Install via npm:
npx @dot-slash/browserstack-cli local start
npx @dot-slash/browserstack-cli test-reporting upload-report ./results.xml \
--project-name "My Project" --build-name "Build #42"
npx @dot-slash/browserstack-cli local run-with -- npm test
npx @dot-slash/browserstack-cli local stopSee CLI docs for the full command reference.
| Import | Client | Product |
|---|---|---|
.../automate | AutomateClient | Browser automation |
.../app-automate | AppAutomateClient | Mobile app automation |
.../local-testing | LocalTestingBinary, LocalTestingClient | Local tunnel |
.../screenshots | ScreenshotsClient | Screenshot automation |
.../accessibility | AccessibilityClient | Accessibility testing |
.../test-management | TestManagementClient | Test case management |
.../test-reporting | TestReportingClient | Test analytics |
.../website-scanner | WebsiteScannerClient | Website Scanner |
.../core | APIClient, error types | Shared runtime |
Only need one product? Install the focused package directly:
| Package | Product |
|---|---|
@dot-slash/browserstack-automate | Browser automation |
@dot-slash/browserstack-app-automate | Mobile app automation |
@dot-slash/browserstack-local-testing | Local tunnel binary |
@dot-slash/browserstack-accessibility | Accessibility testing |
@dot-slash/browserstack-test-management | Test case management |
@dot-slash/browserstack-test-reporting | Test analytics |
@dot-slash/browserstack-screenshots | Screenshot automation |
@dot-slash/browserstack-website-scanner | Website Scanner |