Registry / testing / browserstack

browserstack

JSON →
library0.1jsnpmunverified

This client provides a JavaScript interface for integrating Node.js applications with the BrowserStack platform. It offers programmatic access to various BrowserStack APIs, including the general REST API, the Automate API for WebDriver-based testing, the App Automate API for mobile application testing, and the Screenshots API for generating cross-browser screenshots. Developers can use it to manage virtual browsers, define testing workers, administer projects and builds, and query session information directly from their Node.js environment. As of April 2026, the package's current stable version is 1.6.1, last updated in February 2019. This indicates the project is effectively abandoned, lacking any ongoing maintenance, feature development, or security updates. Its primary differentiator was providing a unified Node.js client across multiple BrowserStack services at the time of its last release. However, due to its outdated nature, users are strongly advised to seek more recent and officially maintained BrowserStack SDKs or alternatives for robust and secure integrations. It exclusively supports CommonJS module loading.

npm install browserstack
INSTALL
IMPORT
SIG · BROWSERSTACK
B
browserstack
testingjavascriptv0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BrowserStack
const BrowserStack = require('browserstack');
import BrowserStack from 'browserstack';
The package is CommonJS-only and does not officially support ESM imports.
createClient
const BrowserStack = require('browserstack'); const client = BrowserStack.createClient(credentials);
import { createClient } from 'browserstack';
Client factory methods like 'createClient' are properties of the default BrowserStack export, not named exports.
createAutomateClient
const BrowserStack = require('browserstack'); const automateClient = BrowserStack.createAutomateClient(credentials);
import { createAutomateClient } from 'browserstack';
Specific API clients are accessed via methods on the main BrowserStack object, not directly importable.

This example demonstrates how to initialize clients for BrowserStack's REST and Automate APIs and fetch available browsers using a CommonJS setup. It highlights credential usage and basic API calls.

const BrowserStack = require('browserstack'); // IMPORTANT: Replace with your actual BrowserStack credentials or environment variables const browserStackCredentials = { username: process.env.BROWSERSTACK_USERNAME ?? 'YOUR_USERNAME', password: process.env.BROWSERSTACK_ACCESS_KEY ?? 'YOUR_ACCESS_KEY' }; if (browserStackCredentials.username === 'YOUR_USERNAME' || browserStackCredentials.password === 'YOUR_ACCESS_KEY') { console.warn('WARNING: Please set BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY environment variables, or replace placeholders.'); } // REST API Client const client = BrowserStack.createClient(browserStackCredentials); client.getBrowsers(function(error, browsers) { if (error) { console.error('Error fetching browsers from REST API:', error); return; } console.log('Available browsers for REST API testing (first 5):'); console.log(browsers.slice(0, 5)); }); // Automate API Client const automateClient = BrowserStack.createAutomateClient(browserStackCredentials); automateClient.getBrowsers(function(error, browsers) { if (error) { console.error('Error fetching browsers from Automate API:', error); return; } console.log('Available browsers for Automate API testing (first 5):'); console.log(browsers.slice(0, 5)); });
Debug
Known issues
breakingThis package is effectively abandoned, with its last update in February 2019. It is no longer maintained, meaning there will be no new features, bug fixes, or compatibility updates for newer Node.js versions or BrowserStack API changes. Consider using an officially supported or more recently maintained SDK.
fix
Migrate to the official BrowserStack Node.js SDK (if available) or another actively maintained client library. Review the official BrowserStack documentation for current integration methods.
affects: >=1.6.1
gotchaThe package is CommonJS-only (uses `require()`) and does not natively support ES Modules (`import`). Attempting to use `import` statements will result in a runtime error like 'ERR_REQUIRE_ESM'.
fix
Ensure your project uses CommonJS for files importing this library (`.js` files with `type: commonjs` or no `type` field in `package.json`). If you must use ESM, consider dynamic `import()` or find an alternative library.
affects: >=1.0.0
gotchaDue to its age, this client may rely on older versions of Node.js or internal dependencies. It might not function correctly or might require polyfills in modern Node.js environments (v16+).
fix
Test thoroughly on your target Node.js version. If issues arise, consider pinning an older Node.js version for your project or, preferably, migrating to a modern, supported BrowserStack client.
affects: >=1.6.1
breakingBrowserStack's public APIs may have evolved significantly since this client's last update in 2019. Some functionalities might be deprecated, changed, or require different parameters than what this client exposes, potentially leading to incorrect responses or errors.
fix
Consult the official BrowserStack API documentation to verify current API endpoints, request/response formats, and authentication mechanisms. If discrepancies exist, direct API calls or an updated client will be necessary.
affects: >=1.6.1
Errors
Common errors & fixes
Error: Cannot find module 'browserstack'
The 'browserstack' package has not been installed or is not accessible in the current project.
fix
Run `npm install browserstack` to add the package to your project's dependencies.
Error: Authentication failed, please check your credentials.
The provided username or access key (password) for BrowserStack is incorrect or expired.
fix
Verify your BrowserStack username and access key in your account settings. Ensure they are correctly passed to `BrowserStack.createClient()` and its variants.
TypeError: BrowserStack.createClient is not a function
The `BrowserStack` object was either not correctly imported/required, or the property `createClient` does not exist on it.
fix
Ensure you are using `const BrowserStack = require('browserstack');` for import. Also, double-check that you are calling the method correctly, as case sensitivity matters.
TypeError: Cannot read properties of undefined (reading 'getBrowsers')
This typically occurs if the client object (e.g., `client`, `automateClient`) was not successfully instantiated, often due to an error in `createClient` or its variants.
fix
Add error handling to the client creation calls (e.g., `BrowserStack.createClient(credentials, function(error, client) { ... });`) or ensure `browserStackCredentials` are valid.
Upgrade
Version history
0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
18
OpenAI (training)
1
Resources