Registry / http-networking / taskcluster-client

taskcluster-client

JSON →
library87.1.3jsnpmunverified

taskcluster-client is the official JavaScript client library for interfacing with Taskcluster components, providing a comprehensive asynchronous interface for all Taskcluster API methods. Primarily designed for server-side Node.js applications, it is deeply integrated into the Taskcluster ecosystem for inter-service communication. The current stable version, as per recent releases, is v99.1.1. The package maintains an active release cadence, frequently incorporating patch and minor updates that include critical Node.js (currently requiring v24.15.0 or later) and Go security upgrades, along with enhancements to worker deployment and monitoring. Key differentiators include robust retry mechanisms for transient network errors and flexible authentication options supporting both environment variables and direct credential provision, ensuring secure and reliable interaction with Taskcluster services.

npm install taskcluster-client
INSTALL
IMPORT
SIG · TASKCLUSTER-CLIENT
T
taskcluster-client
http-networkingjavascriptv87.1.3
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.

taskcluster
import taskcluster from 'taskcluster-client';
const taskcluster = require('taskcluster-client');
The primary entry point, providing access to all client classes like `Queue`, `Auth`, etc., as properties of the default export. ES module import is preferred.
QueueClient
import taskcluster from 'taskcluster-client'; const queue = new taskcluster.Queue(...);
import { Queue } from 'taskcluster-client';
Client classes like `Queue` and `Auth` are accessed as properties of the `taskcluster` default export, not as named exports from the root module.
fromEnvVars
import taskcluster from 'taskcluster-client'; const config = taskcluster.fromEnvVars();
import { fromEnvVars } from 'taskcluster-client';
`fromEnvVars` is a utility function available on the `taskcluster` default export for convenient credential and root URL loading from standard Taskcluster environment variables.

This quickstart demonstrates how to instantiate a Taskcluster client, configure it with credentials (from env vars or directly), and use the Queue service to list recent tasks. It highlights error handling for common authentication issues.

import taskcluster from 'taskcluster-client'; import { URL } from 'url'; // Load credentials from environment variables, or specify directly const clientOptions = { ...taskcluster.fromEnvVars(), // Override rootUrl if TASKCLUSTER_PROXY_URL is desired in a task rootUrl: process.env.TASKCLUSTER_PROXY_URL || 'https://taskcluster.net', credentials: { clientId: process.env.TASKCLUSTER_CLIENT_ID || '', accessToken: process.env.TASKCLUSTER_ACCESS_TOKEN || '', certificate: process.env.TASKCLUSTER_CERTIFICATE ? JSON.parse(process.env.TASKCLUSTER_CERTIFICATE) : undefined }, timeout: 60 * 1000, // 60-second timeout per request retries: 3 }; // Instantiate the Queue Client class const queue = new taskcluster.Queue(clientOptions); async function listTasks() { try { console.log(`Attempting to list tasks from ${clientOptions.rootUrl}...`); // For this example, we'll try to get the latest 10 tasks. // Note: 'listTasks' often requires appropriate scopes and context. const { tasks } = await queue.listLatestTasks({ limit: 10 }); console.log(`Successfully retrieved ${tasks.length} tasks.`); for (const task of tasks) { console.log(` Task ID: ${task.taskId}, State: ${task.state}`); } } catch (error) { console.error('Failed to list tasks:', error.message); if (error.statusCode === 401 || error.statusCode === 403) { console.error('Check your Taskcluster credentials and scopes.'); } } } listTasks();
Debug
Known issues
breakingThe `taskcluster/websocktunnel` Docker image tags underwent a breaking change. Users relying on specific tags for this image may need to update their configurations.
fix
Consult the Taskcluster documentation for the new `taskcluster/websocktunnel` Docker image tagging scheme and update your Dockerfile or deployment configurations accordingly.
affects: >=99.0.0
breakingGeneric Worker now correctly evaluates absolute paths within `mounts` (properties `directory` and `file`) and artifacts (property `path`). Previously, Generic Worker effectively stripped these absolute paths, leading to incorrect file resolution.
fix
Review any Taskcluster task definitions that use absolute paths in `mounts` or artifact `path` properties. Ensure they are compatible with the corrected path evaluation behavior. Adjust paths if they were inadvertently relying on the previous incorrect behavior.
affects: >=98.0.0
gotchaThe `taskcluster.fromEnvVars()` utility function does not respect the `TASKCLUSTER_PROXY_URL` environment variable. If you are running client code within a Taskcluster task that needs to communicate via the proxy, manually set `rootUrl`.
fix
When using `taskcluster.fromEnvVars()` inside a Taskcluster task that should use the proxy, explicitly set the `rootUrl` option to `process.env.TASKCLUSTER_PROXY_URL` in your client instantiation, e.g., `new taskcluster.Auth({ ...taskcluster.fromEnvVars(), rootUrl: process.env.TASKCLUSTER_PROXY_URL })`.
affects: >=87.0.0
gotchaThis library frequently updates its required Node.js version, often including security updates. Running with an older Node.js version can lead to compatibility issues or missed security patches.
fix
Regularly check the latest changelogs and `engines` field in `package.json` for the required Node.js version. Upgrade your Node.js runtime environment to meet the latest requirements (currently Node.js v24.15.0 for v99.1.1).
affects: >=87.0.0
breakingAzure provider workers were previously getting stuck in `STOPPING` indefinitely if their backing Azure resources were deleted out-of-band. While fixed in v99.1.1, older versions will exhibit this behavior, causing resource leaks or stalled deployments.
fix
Upgrade to `taskcluster-client` v99.1.1 or newer. For affected deployments, manually verify and deprovision any Azure resources that correspond to stuck workers.
affects: <99.1.1
Errors
Common errors & fixes
Error: Failed to list tasks: Unauthorized (401)
Missing or incorrect `clientId` or `accessToken`, or insufficient scopes assigned to the credentials.
fix
Ensure `credentials.clientId` and `credentials.accessToken` are correctly provided and the associated client has the necessary scopes for the API calls being made. For temporary credentials, also verify `credentials.certificate`.
Failed to list tasks: connect ECONNREFUSED <host>:<port>
The `rootUrl` provided is incorrect or the Taskcluster instance is unreachable/down.
fix
Verify that the `rootUrl` is correct and the Taskcluster instance it points to is accessible from where your client code is running. Check network connectivity or firewall rules.
Error: OutOfMemoryError: JavaScript heap out of memory
Processing very large log artifacts or other large data streams entirely in memory without streaming.
fix
For operations involving large artifacts (e.g., GitHub service log streaming), ensure your `taskcluster-client` version is up-to-date (>=98.0.1) as recent versions include fixes to stream artifacts rather than downloading them entirely into memory. For custom logic, implement streaming where possible.
Upgrade
Version history
87.1.3latest on npm
Audit
Dependencies
noderequiredRuntime environment for server-side JS operations.
Agent activity
21 hits · last 30 days
node
16
OpenAI (training)
1
Resources