{"id":14843,"library":"qaseio","title":"Qase API JavaScript Client","description":"The `qaseio` package provides a JavaScript client for interacting directly with the Qase Test Management System (TMS) API. It offers a comprehensive set of functionalities to programmatically manage various entities within Qase, including projects, test cases, test suites, milestones, shared steps, test plans, test runs, test run results, defects, custom fields, and attachments. The current npm version is 2.4.3, though the project's monorepo includes more recently updated sub-packages like `qase-javascript-commons` (v2.6.4) and various framework-specific reporters (e.g., `qase-jest` v2.3.0). This package is primarily intended for developers who need to build custom integrations with the Qase API or create bespoke test reporters for niche testing frameworks. A key differentiator and warning is that for common testing frameworks like Jest, Cypress, Playwright, TestCafe, or Mocha, the project strongly recommends using their dedicated, framework-specific reporter packages (e.g., `@qase-tms/qase-jest`) instead of this generic `qaseio` client, which is geared towards lower-level API interactions.","status":"deprecated","version":"2.4.3","language":"javascript","source_language":"en","source_url":"https://github.com/qase-tms/qase-javascript","tags":["javascript","typescript"],"install":[{"cmd":"npm install qaseio","lang":"bash","label":"npm"},{"cmd":"yarn add qaseio","lang":"bash","label":"yarn"},{"cmd":"pnpm add qaseio","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"HTTP client for API requests, frequently updated for security and features.","package":"axios","optional":false}],"imports":[{"note":"While CommonJS `require` might work, ESM `import` is the preferred modern syntax and provides better TypeScript support.","wrong":"const { QaseApi } = require('qaseio');","symbol":"QaseApi","correct":"import { QaseApi } from 'qaseio';"},{"note":"Models like `ProjectCreate` are exposed via a specific subpath `qaseio.models` rather than the root package entry.","wrong":"import { ProjectCreate } from 'qaseio';","symbol":"ProjectCreate","correct":"import { ProjectCreate } from 'qaseio.models';"},{"note":"For CommonJS environments, the library exports QaseApi directly on the root object. Avoid destructuring directly from `require('qaseio')` as shown in the wrong example for ESM.","symbol":"QaseApi","correct":"const qaseio = require('qaseio'); const qase = new qaseio.QaseApi({ ... });"}],"quickstart":{"code":"import { QaseApi, ProjectCreate } from 'qaseio';\n\nconst QASE_API_TOKEN = process.env.QASE_API_TOKEN ?? '';\nconst PROJECT_CODE = process.env.QASE_PROJECT_CODE ?? 'PRJCODE';\n\nconst qase = new QaseApi({\n    token: QASE_API_TOKEN,\n});\n\nasync function manageQaseProjects() {\n  if (!QASE_API_TOKEN) {\n    console.error('QASE_API_TOKEN environment variable is not set.');\n    return;\n  }\n\n  try {\n    console.log('Fetching all projects...');\n    const allProjects = await qase.projects.getAll();\n    console.log('All Projects Data:', allProjects.data);\n\n    const newProjectTitle = `My New Project ${Date.now()}`;\n    const newProjectCode = `NPRJ${Date.now().toString().slice(-4)}`;\n    console.log(`Creating a new project: ${newProjectTitle} (${newProjectCode})...`);\n    const prj = new ProjectCreate(newProjectTitle, newProjectCode);\n    const createdProject = await qase.projects.create(prj);\n    console.log('Created Project:', createdProject.data);\n\n    console.log(`Checking if project ${newProjectCode} exists...`);\n    const projectExists = await qase.projects.exists(newProjectCode);\n    console.log(`Project ${newProjectCode} exists:`, projectExists);\n\n  } catch (error) {\n    console.error('An error occurred:', error.response ? error.response.data : error.message);\n  }\n}\n\nmanageQaseProjects();","lang":"typescript","description":"This example demonstrates how to initialize the Qase API client, fetch all available projects, create a new project, and check for its existence using environment variables for authentication."},"warnings":[{"fix":"Review Qase TMS official documentation for the recommended API client or reporter for new projects. For existing projects, evaluate the impact of deprecation.","message":"The `qaseio` package itself is explicitly marked as deprecated within the Qase JavaScript monorepo (e.g., in `qase-javascript-commons-v2.6.2` changelog). Users should consider migrating to specific reporter packages or newer API clients if available.","severity":"deprecated","affected_versions":">=2.6.2 (of qase-javascript-commons, indicating deprecation of this base package)"},{"fix":"Install the appropriate Qase reporter package for your testing framework (e.g., `npm install @qase-tms/qase-jest`) and follow its specific configuration instructions.","message":"For integrating with common testing frameworks (e.g., Jest, Cypress, Playwright, Mocha), Qase recommends using their dedicated framework-specific reporter packages (e.g., `@qase-tms/qase-jest`, `@qase-tms/qase-cypress`) instead of the generic `qaseio` client. This package is intended for custom integrations and specialized reporters.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Upgrade your Node.js environment to version 14 or later. Use a Node.js version manager like `nvm` to easily switch versions.","message":"The package requires Node.js version 14 or higher. Running in older Node.js environments may lead to unexpected errors or unsupported features.","severity":"gotcha","affected_versions":"<14.0.0 (Node.js)"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure the `token` passed to `new QaseApi()` is a valid API token obtained from your Qase TMS account (personal API tokens page or app integrations page) and that it has the necessary permissions. Use environment variables like `process.env.QASE_API_TOKEN` to manage tokens securely.","cause":"The Qase API token provided is missing or invalid, leading to an authentication failure.","error":"Error: Request failed with status code 401"},{"fix":"Wrap API calls in `try...catch` blocks. Inspect the `error.response` object in the catch block to get details like status code and error messages from the API (`error.response.data`). This helps in debugging unexpected API responses.","cause":"This often occurs when an API call fails, and the `res` object (AxiosResponse) does not contain the expected `data` property, or the `res.data` itself is not the expected structure.","error":"Cannot read properties of undefined (reading 'data')"},{"fix":"Ensure you are importing models from the specific `qaseio.models` subpath: `import { ProjectCreate } from 'qaseio.models';`","cause":"Attempting to use `ProjectCreate` (or similar models) without importing it from the correct subpath.","error":"TypeError: ProjectCreate is not a constructor"}],"ecosystem":"npm"}