# testingbot-tunnel-launcher

> A wrapper around TestingBot's Tunnel

Latest version **1.1.20** (published 2026-08-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install testingbot-tunnel-launcher
pnpm add testingbot-tunnel-launcher
yarn add testingbot-tunnel-launcher
bun add testingbot-tunnel-launcher
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.1.20 |
| Published | 2026-08-26 |
| First published | 2015-10-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=18 |
| Dependencies | 0 |
| Unpacked size | 44.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 7 |
| Author | TestingBot |
| Maintainers | jochen-testingbot |
| Keywords | testingbot tunnel, selenium, testingbot, test, automation, cloud |

## Links

- npm: https://www.npmjs.com/package/testingbot-tunnel-launcher
- Repository: https://github.com/testingbot/testingbot-tunnel-launcher
- Issues: https://github.com/testingbot/testingbot-tunnel-launcher/issues
- npm.io page: https://npm.io/package/testingbot-tunnel-launcher

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 1.1.20 (latest) — 2026-08-26
- 1.1.19 — 2026-08-25
- 1.1.18 — 2026-01-26
- 1.1.17 — 2025-12-11
- 1.1.16 — 2025-12-11
- 1.1.15 — 2025-02-17
- 1.1.14 — 2024-12-18
- 1.1.13 — 2024-12-18
- 1.1.12 — 2021-09-21
- 1.1.11 — 2021-02-24
- 1.1.10 — 2020-11-27
- 1.1.9 — 2020-11-26
- 1.1.7 — 2018-11-02
- 1.1.6 — 2017-11-20
- 1.1.5 — 2017-11-13
- … 15 more at https://npm.io/package/testingbot-tunnel-launcher/versions

## README

# testingbot-tunnel-launcher

[![npm](https://img.shields.io/npm/v/testingbot-tunnel-launcher.svg?maxAge=2592000)](https://www.npmjs.com/package/testingbot-tunnel-launcher)
[![Tests](https://github.com/testingbot/testingbot-tunnel-launcher/actions/workflows/test.yml/badge.svg)](https://github.com/testingbot/testingbot-tunnel-launcher/actions/workflows/test.yml)

A library to download and launch [TestingBot Tunnel](https://testingbot.com/support/tunnel).

## Installation

```sh
npm install testingbot-tunnel-launcher
```

## Usage


### Simple Usage (Callback)

```javascript
const testingbotTunnel = require('testingbot-tunnel-launcher');

testingbotTunnel({
  apiKey: process.env.TB_KEY,
  apiSecret: process.env.TB_SECRET,
  verbose: true
}, function (err, tunnel) {
  if (err) {
    console.error(err.message);
    return;
  }
  console.log("Tunnel ready");

  tunnel.close(function () {
    console.log("Tunnel closed completely");
  })
});
```

### Simple Usage (Async/Await)

```javascript
const testingbotTunnel = require('testingbot-tunnel-launcher');

async function runTests() {
  try {
    const tunnel = await testingbotTunnel.downloadAndRunAsync({
      apiKey: process.env.TB_KEY,
      apiSecret: process.env.TB_SECRET,
      verbose: true
    });
    console.log("Tunnel ready");

    // Run your tests here...

    // Close the tunnel when done
    await testingbotTunnel.killAsync();
    console.log("Tunnel closed completely");
  } catch (err) {
    console.error(err.message);
  }
}

runTests();
```

### Options

```javascript
const testingbotTunnel = require('testingbot-tunnel-launcher')
const options = {
  // The TestingBot API key which you can get for free, listed in the TestingBot member area
  apiKey: 'key',

  // The TestingBot API secret which you can get for free, listed in the TestingBot member area
  apiSecret: 'secret',

  // More verbose output from the tunnel
  verbose: true,

  // Port on which the tunnel Selenium relay will listen for
  // requests. Default 4445. (optional)
  'se-port': 4445,

  // Proxy host and port the tunnel can use to connect to an upstream proxy
  // e.g. "localhost:1234" (optional)
  proxy: null,

  // A comma-separated list of domains that
  // will not go through the tunnel. (optional)
  'fast-fail-regexps': null,

  // Write logging output to this logfile (optional)
  logfile: null,

  // Change the tunnel version - see versions on https://testingbot.com/support/other/tunnel/changelog.html
  tunnelVersion: "4.0",

  // Gives this tunnel a unique identifier
  tunnelIdentifier: "myIdentifier",

  // Share this tunnel with other team members on TestingBot
  shared: true,

  // Timeout in seconds for the tunnel to start (default: 90)
  timeout: 120,

  // Disable SSL bumping/rewriting
  noBump: false,

  // Disable caching
  noCache: false
};

testingbotTunnel(options, function(err, tunnel) {
  console.log("Started Tunnel");
  tunnel.close(function () {
    console.log("Closed tunnel");
  });
});
```

### Credentials

You can pass the [TestingBot credentials](https://testingbot.com/members) as `apiKey` and `apiSecret` in the options.

You can also create a `~/.testingbot` file in your `$HOME` directory, with `apiKey:apiSecret` as contents.

The credentials are handed to the tunnel through the `TESTINGBOT_KEY` and `TESTINGBOT_SECRET` environment variables instead of the command line, so they do not show up in the process list. They are also redacted from the output when `verbose` is enabled.

### Running more than one tunnel

Every tunnel keeps its own state, so several tunnels can run next to each other. Give each one its own `tunnelIdentifier` and hold on to the tunnel you get back to close it:

```javascript
const first = await testingbotTunnel.downloadAndRunAsync({ ...options, tunnelIdentifier: 'first' });
const second = await testingbotTunnel.downloadAndRunAsync({ ...options, tunnelIdentifier: 'second' });

first.close();
await testingbotTunnel.killAllAsync();
```

`killAsync` closes the tunnel that was started last, `killAllAsync` closes all of them and `activeTunnels()` returns the ones that are still running.

### Where the tunnel is stored

The tunnel jar is downloaded into the directory of this package. When that directory can not be written to, which is the case for global installs and read-only images, it is stored in the cache directory of the user (`~/.cache/testingbot-tunnel-launcher` on Linux, `~/Library/Caches/testingbot-tunnel-launcher` on macOS and `%LOCALAPPDATA%` on Windows).

Set `TESTINGBOT_TUNNEL_CACHE_DIR` to store the jar somewhere else.


## Testing

```
npm test
```

## MIT license

Copyright (c) TestingBot &lt;info@testingbot.com&gt;

---
_Source: https://npm.io/package/testingbot-tunnel-launcher · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
