{"id":17178,"library":"browserstack","title":"BrowserStack Node.js Client","description":"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.","status":"abandoned","version":"1.6.1","language":"javascript","source_language":"en","source_url":"git://github.com/scottgonzalez/node-browserstack","tags":["javascript","automation","browser","browserstack","screenshot","testing"],"install":[{"cmd":"npm install browserstack","lang":"bash","label":"npm"},{"cmd":"yarn add browserstack","lang":"bash","label":"yarn"},{"cmd":"pnpm add browserstack","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package is CommonJS-only and does not officially support ESM imports.","wrong":"import BrowserStack from 'browserstack';","symbol":"BrowserStack","correct":"const BrowserStack = require('browserstack');"},{"note":"Client factory methods like 'createClient' are properties of the default BrowserStack export, not named exports.","wrong":"import { createClient } from 'browserstack';","symbol":"createClient","correct":"const BrowserStack = require('browserstack');\nconst client = BrowserStack.createClient(credentials);"},{"note":"Specific API clients are accessed via methods on the main BrowserStack object, not directly importable.","wrong":"import { createAutomateClient } from 'browserstack';","symbol":"createAutomateClient","correct":"const BrowserStack = require('browserstack');\nconst automateClient = BrowserStack.createAutomateClient(credentials);"}],"quickstart":{"code":"const BrowserStack = require('browserstack');\n\n// IMPORTANT: Replace with your actual BrowserStack credentials or environment variables\nconst browserStackCredentials = {\n  username: process.env.BROWSERSTACK_USERNAME ?? 'YOUR_USERNAME',\n  password: process.env.BROWSERSTACK_ACCESS_KEY ?? 'YOUR_ACCESS_KEY'\n};\n\nif (browserStackCredentials.username === 'YOUR_USERNAME' || browserStackCredentials.password === 'YOUR_ACCESS_KEY') {\n  console.warn('WARNING: Please set BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY environment variables, or replace placeholders.');\n}\n\n// REST API Client\nconst client = BrowserStack.createClient(browserStackCredentials);\n\nclient.getBrowsers(function(error, browsers) {\n  if (error) {\n    console.error('Error fetching browsers from REST API:', error);\n    return;\n  }\n  console.log('Available browsers for REST API testing (first 5):');\n  console.log(browsers.slice(0, 5));\n});\n\n// Automate API Client\nconst automateClient = BrowserStack.createAutomateClient(browserStackCredentials);\n\nautomateClient.getBrowsers(function(error, browsers) {\n  if (error) {\n    console.error('Error fetching browsers from Automate API:', error);\n    return;\n  }\n  console.log('Available browsers for Automate API testing (first 5):');\n  console.log(browsers.slice(0, 5));\n});","lang":"javascript","description":"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."},"warnings":[{"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.","message":"This 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.","severity":"breaking","affected_versions":">=1.6.1"},{"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.","message":"The 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'.","severity":"gotcha","affected_versions":">=1.0.0"},{"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.","message":"Due 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+).","severity":"gotcha","affected_versions":">=1.6.1"},{"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.","message":"BrowserStack'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.","severity":"breaking","affected_versions":">=1.6.1"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Run `npm install browserstack` to add the package to your project's dependencies.","cause":"The 'browserstack' package has not been installed or is not accessible in the current project.","error":"Error: Cannot find module 'browserstack'"},{"fix":"Verify your BrowserStack username and access key in your account settings. Ensure they are correctly passed to `BrowserStack.createClient()` and its variants.","cause":"The provided username or access key (password) for BrowserStack is incorrect or expired.","error":"Error: Authentication failed, please check your credentials."},{"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.","cause":"The `BrowserStack` object was either not correctly imported/required, or the property `createClient` does not exist on it.","error":"TypeError: BrowserStack.createClient is not a function"},{"fix":"Add error handling to the client creation calls (e.g., `BrowserStack.createClient(credentials, function(error, client) { ... });`) or ensure `browserStackCredentials` are valid.","cause":"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.","error":"TypeError: Cannot read properties of undefined (reading 'getBrowsers')"}],"ecosystem":"npm","meta_description":null}