Gathering detailed insights and metrics for saucelabs
Gathering detailed insights and metrics for saucelabs
Gathering detailed insights and metrics for saucelabs
Gathering detailed insights and metrics for saucelabs
testcafe-browser-provider-saucelabs
saucelabs TestCafe browser provider plugin.
saucelabs-connector
Helps connect the local machine to SauceLabs and start a remote browser.
grunt-saucelabs
Grunt task running tests using Sauce Labs. Supports QUnit, Jasmine, Mocha and YUI tests
@saucelabs/visual
JS client bindings for Sauce Labs Visual
npm install saucelabs
Typescript
Module System
Node Version
NPM Version
JavaScript (98.3%)
Mustache (0.92%)
TypeScript (0.72%)
Shell (0.06%)
Total Downloads
441,248,848
Last Day
39,078
Last Week
874,179
Last Month
3,925,089
Last Year
45,832,583
Apache-2.0 License
95 Stars
442 Commits
45 Forks
15 Watchers
10 Branches
32 Contributors
Updated on May 22, 2025
Minified
Minified + Gzipped
Latest Version
9.0.2
Package Id
saucelabs@9.0.2
Unpacked Size
14.83 MB
Size
14.53 MB
File Count
36
NPM Version
10.9.2
Node Version
22.13.1
Published on
Feb 07, 2025
Cumulative downloads
Total Downloads
Last Day
-9.8%
39,078
Compared to previous day
Last Week
-7.7%
874,179
Compared to previous week
Last Month
-1.8%
3,925,089
Compared to previous month
Last Year
-12.8%
45,832,583
Compared to previous year
Wrapper around all Sauce Labs REST APIs for Node.js (v18 or higher) including support for Sauce Connect Proxy and TypeScript definitions.
To install the package run:
1npm install saucelabs
Your Sauce Labs username.
Type: string
Default: process.env.SAUCE_USERNAME
Your Sauce Labs access key.
Type: string
Default: process.env.SAUCE_ACCESS_KEY
Your Sauce Labs datacenter region. The following regions are available:
us-west-1
(short us
)eu-central-1
(short eu
)us-east-4
(real mobile devices only)Type: string
Default: us
If you want to tunnel your API request through a proxy please provide your proxy URL.
Type: string
Default: null
If you want to set request headers, as example {'User-Agent': 'node-saucelabs'}
Type: object
Default: {'User-Agent': 'saucelabs/<VERSION> (nodejs <PLATFORM>)'}
All accessible API commands with descriptions can be found here.
This package if installed globally can be used as CLI tool to access the API from the command line:
1$ npm install -g saucelabs 2... 3$ sl listJobs $SAUCE_USERNAME 5 --region eu 4{ jobs: 5 [ { id: '19dab74f8fd848518f8d2c2cee3a6fbd' }, 6 { id: 'dc08ca0c7fa14eee909a093d11567328' }, 7 { id: '5bc6f70c777b4ae3bf7909a40f5ee41b' }, 8 { id: 'f40fe7b044754eaaa5f5a130406549b5' }, 9 { id: 'd1553f71f910402893f1e82a4dcb6ca6' } ] }
You can find all available commands and options with description by calling:
1$ sl --help 2# show description for specific command 3$ sl listJobs --help
or update the job status by calling:
1$ sl updateJob cb-onboarding 690c5877710c422d8be4c622b40c747f "{\"passed\":false}"
or download a job asset:
1$ sl downloadJobAsset 690c5877710c422d8be4c622b40c747f video.mp4 --filepath ./video.mp4
or upload a job asset:
1$ sl uploadJobAssets 690c5877710c422d8be4c622b40c747f --files ./video.mp4 --files ./log.json
or start Sauce Connect Proxy in EU datacenter:
1# start Sauce Connect tunnel for eu-central-1 region 2$ sl sc --region eu --tunnel-name "my-tunnel" 3# run a specific Sauce Connect version 4$ sl sc --scVersion 5.2.2 5# see all available Sauce Connect parameters via: 6$ sl sc --help
You can see all available Sauce Connect parameters on the Sauce Labs Docs.
The following example shows how to access details of the last job you were running with your account that is being exposed as environment variables as SAUCE_USERNAME
and SAUCE_ACCESS_KEY
. Alternatively you can pass the credentials via options
to the constructor:
1import SauceLabs from 'saucelabs'; 2// if imports are not supported by your Node.js version, import the package as follows: 3// const SauceLabs = require('saucelabs').default; 4 5(async () => { 6 const myAccount = new SauceLabs(); 7 // using constructor options 8 // const myAccount = new SauceLabs({ user: "YOUR-USER", key: "YOUR-ACCESS-KEY"}); 9 10 // get full webdriver url from the client depending on region: 11 console.log(myAccount.webdriverEndpoint); // outputs "https://ondemand.us-west-1.saucelabs.com/" 12 13 // get job details of last run job 14 const jobs = await myAccount.listJobs(process.env.SAUCE_USERNAME, { 15 limit: 1, 16 full: true, 17 }); 18 19 console.log(jobs); 20 /** 21 * outputs: 22 * { jobs: 23 [ { browser_short_version: '72', 24 video_url: 25 'https://assets.saucelabs.com/jobs/dc08ca0c7fa14eee909a093d11567328/video.flv', 26 creation_time: 1551711453, 27 'custom-data': null, 28 browser_version: '72.0.3626.81', 29 owner: '<username-redacted>', 30 id: 'dc08ca0c7fa14eee909a093d11567328', 31 record_screenshots: true, 32 record_video: true, 33 build: null, 34 passed: null, 35 public: 'team', 36 end_time: 1551711471, 37 status: 'complete', 38 log_url: 39 'https://assets.saucelabs.com/jobs/dc08ca0c7fa14eee909a093d11567328/selenium-server.log', 40 start_time: 1551711454, 41 proxied: false, 42 modification_time: 1551711471, 43 tags: [], 44 name: null, 45 commands_not_successful: 1, 46 consolidated_status: 'complete', 47 manual: false, 48 assigned_tunnel_id: null, 49 error: null, 50 os: 'Windows 2008', 51 breakpointed: null, 52 browser: 'googlechrome' } ] } 53 */ 54 55 /** 56 * start Sauce Connect Proxy 57 */ 58 const sc = await myAccount.startSauceConnect({ 59 /** 60 * you can pass in a `logger` method to print Sauce Connect log messages 61 */ 62 logger: (stdout) => console.log(stdout), 63 /** 64 * see all available parameters here: https://docs.saucelabs.com/dev/cli/sauce-connect-5/run/ 65 * all parameters have to be applied camel cased instead of with hyphens, e.g. 66 * to apply the `--tunnel-name` parameter, set: 67 */ 68 tunnelName: 'my-tunnel', 69 }); 70 71 // run a test 72 // ... 73 74 // close Sauce Connect 75 await sc.close(); 76 77 // upload additional log files and attach it to your Sauce job 78 await myAccount.uploadJobAssets('76e693dbe6ff4910abb0bc3d752a971e', [ 79 // either pass in file names 80 './logs/video.mp4', 81 './logs/log.json', 82 // or file objects 83 { 84 filename: 'myCustomLogFile.json', 85 data: { 86 someLog: 'data', 87 }, 88 }, 89 ]); 90})();
You may wonder why
listJobs
requires ausername
as first parameter since you've already defined the process.env. The reason for this is that Sauce Labs supports a concept of Team Accounts, so-called sub-accounts, grouped together. As such functions like the mentioned could list jobs not only for the requesting account, but also for the individual team account. Learn more about it here
webdriverEndpoint
propertyYou can use the webdriverEndpoint
property of the client to get the full WebDriver endpoint to connect to Sauce Labs, e.g.:
1const myAccount = new SauceLabs({
2 user: 'YOUR-USER',
3 key: 'YOUR-ACCESS-KEY',
4 region: 'eu', // run in EU datacenter
5 tunnelName: 'my-tunnel',
6});
7
8// get full webdriver url from the client depending on `region` option:
9console.log(myAccount.webdriverEndpoint);
10// outputs: "https://ondemand.eu-central-1.saucelabs.com/"
This module was originally created by Dan Jenkins with the help of multiple contributors (Daniel Perez Alvarez, Mathieu Sabourin, Michael J Feher, and many more). We would like to thank Dan and all contributors for their support and this beautiful module.
Copyright 2012 Sauce Labs, Inc. Licensed Apache-2.0
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
Found 15/23 approved changesets -- score normalized to 6
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
10 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More