TypeScript SDK for all BrowserStack REST APIs. One package, every product, full type safety.
npm install @dot-slash/browserstack-client- Node.js 22 or higher
- A BrowserStack account with the relevant product subscriptions
Set credentials in your environment — no constructor arguments needed:
export BROWSERSTACK_USERNAME=<your-username>
export BROWSERSTACK_ACCESS_KEY=<your-access-key>Or pass them explicitly to any client constructor.
import {
AutomateClient,
AppAutomateClient,
LocalTestingBinary,
AccessibilityClient,
TestManagementClient,
TestReportingClient,
ScreenshotsClient,
} from "@dot-slash/browserstack-client";Tree-shaking: If bundle size matters (e.g. Lambda, browser), import from the product subpath instead —
@dot-slash/browserstack-client/automate,/app-automate,/local-testing,/accessibility,/test-management,/test-reporting,/screenshots. Bundlers will then include only that product's code.
import { AutomateClient } from "@dot-slash/browserstack-client";
const client = new AutomateClient();
const plan = await client.getPlan();
const builds = await client.getBuilds();import { AppAutomateClient } from "@dot-slash/browserstack-client";
const client = new AppAutomateClient();
const projects = await client.getProjects();
const builds = await client.getBuilds(projects[0].id);import { LocalTestingBinary } from "@dot-slash/browserstack-client";
const tunnel = new LocalTestingBinary({ accessKey: process.env.BROWSERSTACK_ACCESS_KEY });
await tunnel.start();
// ... run tests against localhost ...
await tunnel.stop();import { AccessibilityClient } from "@dot-slash/browserstack-client";
const client = new AccessibilityClient();
const reports = await client.getWorkflowAnalyzerReports();import { TestManagementClient } from "@dot-slash/browserstack-client";
const client = new TestManagementClient();
const projects = await client.getProjects();import { TestReportingClient } from "@dot-slash/browserstack-client";
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 { ScreenshotsClient } from "@dot-slash/browserstack-client";
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)
);A unified CLI is also available for local testing and product interactions:
npx @dot-slash/browserstack-cli local start
npx @dot-slash/browserstack-cli local run-with -- npm test
npx @dot-slash/browserstack-cli local stopOnly need one product? Install its 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 |
shirish87.github.io/browserstack-client
Sponsored access to BrowserStack, courtesy BrowserStack.