Configure the SDK
Install the public SDK and create a shared configuration for your integration:
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);One configuration, several API clients
Section titled “One configuration, several API clients”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 names and HTTP names
Section titled “SDK names and HTTP names”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.
Runtime and version
Section titled “Runtime and version”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.
Pick a workflow
Section titled “Pick a workflow”Start with creating cases, preparing a plan, or fetching a saved report.