Qovery OpenAPI TypeScript Axios Client
qovery-typescript-axios is an OpenAPI client library specifically generated for interacting with the Qovery API, leveraging the popular Axios HTTP client. The package provides a strongly-typed TypeScript interface, automatically resolving type definitions via `package.json` for TypeScript projects, while also being fully compatible with JavaScript environments. It supports modern module systems like ES6 modules and CommonJS, and is designed for use in Node.js, Webpack, and Browserify environments. The current stable version is 1.1.864, with recent minor releases indicating active development. Its core differentiation lies in being a pre-generated, opinionated client for the Qovery platform, saving developers the effort of manual API integration and schema management by providing ready-to-use API services and models based on the Qovery OpenAPI specification.
Common errors
-
TypeError: Cannot read properties of undefined (reading 'someMethod')
cause The API client (e.g., `applicationsApi`) was not correctly initialized with a `Configuration` object, or the API method called does not exist.fixEnsure `new ApplicationsApi(configuration)` is called with a properly instantiated `Configuration` object. Double-check the method name against the API documentation. -
AxiosError: Request failed with status code 401 Unauthorized
cause The API request was made without proper authentication, or the provided access token is invalid or expired.fixVerify that your `Configuration` object's `accessToken` is correctly set with a valid Qovery API token. Ensure the token has the necessary scopes/permissions for the API endpoint being accessed. Renew the token if expired. -
Module not found: Can't resolve 'qovery-typescript-axios'
cause The package is not installed or the import path is incorrect. This can also happen due to CommonJS/ESM module incompatibility in certain bundler configurations.fixRun `npm install qovery-typescript-axios`. If using CommonJS, try `const { Symbol } = require('qovery-typescript-axios');` but prefer ESM imports where possible. Ensure your bundler is configured to handle both module types if mixing.
Warnings
- breaking The README provided (v1.0.4) is significantly older than the current package version (v1.1.864). Breaking changes are highly probable between these versions due to updates in the underlying Qovery API specification, which directly drives the client generation. Always consult the official Qovery API documentation and the client's changelog on GitHub for specific breaking changes relevant to your version.
- gotcha Authentication is crucial for most API interactions. This client uses a `Configuration` object to pass the `accessToken`. Failing to provide a valid token will result in unauthorized (401) or forbidden (403) errors.
- breaking A supply chain attack was reported for the underlying `axios` library, affecting versions `1.14.1` and `0.30.4`. While these specific versions of `axios` were removed from npm, it's critical to ensure your `package-lock.json` or `yarn.lock` does not contain these malicious versions if your project's `qovery-typescript-axios` dependency resolves to them.
Install
-
npm install qovery-typescript-axios -
yarn add qovery-typescript-axios -
pnpm add qovery-typescript-axios
Imports
- Configuration
const Configuration = require('qovery-typescript-axios').Configuration;import { Configuration } from 'qovery-typescript-axios'; - ApplicationsApi
import ApplicationsApi from 'qovery-typescript-axios'; // Incorrect default import const ApplicationsApi = require('qovery-typescript-axios').ApplicationsApi;import { ApplicationsApi } from 'qovery-typescript-axios'; - Application
import { Application } from 'qovery-typescript-axios';
Quickstart
import { Configuration, ApplicationsApi } from 'qovery-typescript-axios';
const API_TOKEN = process.env.QOVERY_API_TOKEN ?? 'YOUR_QOVERY_API_TOKEN';
if (!API_TOKEN || API_TOKEN === 'YOUR_QOVERY_API_TOKEN') {
console.error('Please set the QOVERY_API_TOKEN environment variable or replace the placeholder.');
process.exit(1);
}
const configuration = new Configuration({
basePath: 'https://api.qovery.com',
accessToken: API_TOKEN,
});
const applicationsApi = new ApplicationsApi(configuration);
async function listMyApplications() {
try {
// Assuming a method like 'listApplication' exists and takes optional parameters.
// The actual method name and parameters depend on the Qovery OpenAPI spec.
const response = await applicationsApi.listApplication(
'organization_id_example',
'project_id_example',
'environment_id_example',
0, // offset
10 // limit
);
console.log('Successfully fetched applications:', response.data);
} catch (error) {
if (error.isAxiosError) {
console.error('API Error:', error.response?.data || error.message);
} else {
console.error('An unexpected error occurred:', error);
}
}
}
listMyApplications();