Skip to content
developers
Open TestCollab

Configure the SDK

Install the public SDK and create a shared configuration for your integration:

Terminal window
npm install @testcollab/[email protected]
client.ts
import { createConfiguration, TestCasesApi } from '@testcollab/sdk';
const config = createConfiguration(process.env.TESTCOLLAB_TOKEN!, {
basePath: 'https://api-eu.testcollab.io',
});
const api = new TestCasesApi(config);
const testCase = await api.getTestCase({ id: 456, project: 123 });
console.log(testCase.title);

The package groups methods by resource. Construct clients such as TestCasesApi, TestPlansApi, and ReportTemplatesApi with the same configuration.

import { createConfiguration, TestCasesApi, TestPlansApi } from '@testcollab/sdk';
const config = createConfiguration(process.env.TESTCOLLAB_TOKEN!);
const cases = new TestCasesApi(config);
const plans = new TestPlansApi(config);

SDK request objects use JavaScript names such as testCasePayload, expectedResult, and customFields. The SDK serializes them to the HTTP field names.

When copying an HTTP payload into SDK code, use the SDK’s parameter and property names. For example, an HTTP _limit query parameter is the SDK’s limit argument.

Run these examples in Node.js 22 or newer. The examples use environment variables, fetch, and top-level await; they are intended for server, script and CI use.

The reference examples are checked against SDK 3.35.0. Pin your version and read the compatibility notes before upgrading an existing integration.

Start with creating cases, preparing a plan, or fetching a saved report.