Registry / testing / testingbot-api

testingbot-api

JSON →
library1.2.0jsnpmunverified

Official Node.js client for the TestingBot REST API, version 1.2.0. Provides full coverage of TestingBot cloud-based cross-browser testing infrastructure: session management, test artifacts, screenshots, tunnels, builds, team management, and codeless tests. Supports both callback and async/await patterns, includes TypeScript types, typed error classes, and built-in workflow helpers (auto-pagination, polling, batch operations, statistics). Releases are periodic via npm.

npm install testingbot-api
INSTALL
IMPORT
SIG · TESTINGBOT-API
T
testingbot-api
testingjavascriptv1.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

TestingBot
✓ import TestingBot from 'testingbot-api'
✗ const TestingBot = require('testingbot-api').TestingBot
Default export; CommonJS require gives the class directly. Named export TestingBot does not exist.
AuthenticationError
✓ import { AuthenticationError } from 'testingbot-api'
✗ const AuthenticationError = require('testingbot-api').AuthenticationError
Named exports available for error classes. Can also be destructured from require.
RateLimitError
✓ import { RateLimitError } from 'testingbot-api'
One of the typed error classes exported as named export.

Initializes the client with environment variables, fetches browser list, and lists tests with pagination handling.

import TestingBot from 'testingbot-api'; const tb = new TestingBot({ api_key: process.env.TESTINGBOT_KEY ?? '', api_secret: process.env.TESTINGBOT_SECRET ?? '' }); // Get browser list (returns plain array) tb.getBrowsers() .then((browsers) => { console.log(`Available browsers: ${browsers.length}`); }) .catch((err) => { console.error('Error:', err.message); }); // Get sessions (paginated) using async/await async function listSessions() { try { const { data, meta } = await tb.getTests({ limit: 10 }); console.log(`Page ${meta.offset} of ${Math.ceil(meta.total / 10)}, showing ${data.length} tests`); } catch (err) { console.error('Error:', err.message); } } listSessions();
Debug
Known issues
breakingNode.js >= 18 required. Earlier versions are not supported.
fix
Upgrade Node.js to 18 or later.
affects: >=1.0.0
gotchaList endpoints (getTests, getBuilds, getStorageFiles, getScreenshotList, getCodelessTests, getUsersInTeam) return an object with data and meta, not a plain array. Access the array via .data.
fix
Use response.data to get the array, response.meta for pagination info.
affects: >=1.0.0
gotchaErrors are typed, so catch should handle specific error classes like AuthenticationError, RateLimitError, ValidationError, etc.
fix
Import and catch specific error types: import { AuthenticationError } from 'testingbot-api'.
affects: >=1.0.0
deprecatedCallback style support may be removed in future major versions.
fix
Use async/await instead of callbacks.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'testingbot-api'
Package not installed or imported incorrectly.
fix
Run `npm install testingbot-api` and ensure import path is correct: `import TestingBot from 'testingbot-api'`.
TypeError: TestingBot is not a constructor
Using wrong import pattern, e.g., destructuring from default export.
fix
Use `import TestingBot from 'testingbot-api'` or `const TestingBot = require('testingbot-api')`.
AuthenticationError: Invalid API credentials
Missing or incorrect api_key / api_secret.
fix
Set TESTINGBOT_KEY and TESTINGBOT_SECRET environment variables, or pass them in constructor options.
Upgrade
Version history
1.2.0latest on npm
Audit
Dependencies
commanderoptionalUsed for CLI commands
axiosrequiredHTTP client for API requests
Agent activity
14 hits · last 30 days
node
14
Resources
testingbot-api — npm install testingbot-api · libregistry