Registry / devops / configcat-publicapi-node-client

configcat-publicapi-node-client

JSON →
library3.2.1jsnpmunverified

The `configcat-publicapi-node-client` is a Node.js client library designed for programmatic interaction with the ConfigCat Public Management API. Unlike ConfigCat SDKs which are used for evaluating feature flags, this client enables comprehensive Create, Read, Update, and Delete (CRUD) operations on entities such as Feature Flags, Configurations, Environments, and Products within the ConfigCat platform. It is a Swagger-generated client, currently at stable version 3.2.1, and receives frequent updates, often driven by security enhancements and regenerations based on the latest Public Management API models and endpoints. This frequent release cycle ensures compatibility with the evolving ConfigCat API and incorporates important security patches.

npm install configcat-publicapi-node-client
INSTALL
IMPORT
SIG · CONFIGCAT-PUBLICAP
C
configcat-publicapi-node-client
devopsjavascriptv3.2.1
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.

ConfigCatPublicApi
import { ConfigCatPublicApi } from 'configcat-publicapi-node-client';
const ConfigCatPublicApi = require('configcat-publicapi-node-client').ConfigCatPublicApi;
Primary client class for interacting with the ConfigCat Public API. ESM import is preferred.
Configuration
import { Configuration } from 'configcat-publicapi-node-client';
import { Config } from 'configcat-publicapi-node-client'; // Incorrect class name
Used to provide client configuration, including API credentials and base path.
ProductModel
import { ProductModel } from 'configcat-publicapi-node-client';
Example of a type definition (DTO) for API responses or request bodies, typically used with TypeScript.

Initializes the ConfigCat Public API client with Basic Authentication and lists all available products. Requires `CONFIGCAT_API_USERNAME` and `CONFIGCAT_API_PASSWORD` environment variables.

import { ConfigCatPublicApi, Configuration } from 'configcat-publicapi-node-client'; const CONFIGCAT_API_USERNAME = process.env.CONFIGCAT_API_USERNAME ?? ''; const CONFIGCAT_API_PASSWORD = process.env.CONFIGCAT_API_PASSWORD ?? ''; const CONFIGCAT_BASE_URL = 'https://api.configcat.com'; if (!CONFIGCAT_API_USERNAME || !CONFIGCAT_API_PASSWORD) { console.error('Environment variables CONFIGCAT_API_USERNAME and CONFIGCAT_API_PASSWORD must be set.'); process.exit(1); } async function listProducts() { try { const config = new Configuration({ username: CONFIGCAT_API_USERNAME, password: CONFIGCAT_API_PASSWORD, basePath: CONFIGCAT_BASE_URL }); const publicApi = new ConfigCatPublicApi(config); console.log('Fetching products from ConfigCat Public API...'); const products = await publicApi.products.getProducts(); if (products.length > 0) { console.log(`Successfully fetched ${products.length} products.`); products.forEach(product => { console.log(`- Product ID: ${product.productId}, Name: ${product.name}`); }); } else { console.log('No products found.'); } } catch (error) { if (error instanceof Error) { console.error('Error fetching products:', error.message); if (error.message.includes('401')) { console.error('Please check your API credentials (username/password) and ensure they are correct.'); } } else { console.error('An unknown error occurred:', error); } } } listProducts();
Debug
Known issues
breakingMultiple v3.x.x releases (e.g., v3.2.0, v3.1.1, v3.1.0, v3.0.0) include changes due to 'regenerated the client based on the latest Public Management API models and endpoints'. These regenerations can introduce breaking changes to method signatures, request/response DTOs, or available endpoints. Users should review release notes carefully when upgrading between minor versions of v3 to avoid unexpected runtime errors.
fix
Review the specific release notes for the version you are upgrading to. Update client instantiation, method calls, and data models in your code to align with the new API structure.
affects: >=3.0.0
gotchaThe client receives frequent security updates. While not always breaking, it's crucial to regularly update the package to the latest version to ensure your application benefits from critical security patches and vulnerability fixes. Neglecting updates can expose your application to known security risks.
fix
Regularly run `npm update configcat-publicapi-node-client` and integrate updates into your CI/CD pipeline to maintain a secure environment.
affects: >=2.0.0
gotchaThis package is the *Public Management API client* for programmatic control of ConfigCat resources (e.g., feature flags). It is distinct from the *ConfigCat SDKs* (like `@configcat/sdk/node` or the legacy `configcat-node`), which are used for *evaluating* feature flags within your application. Do not confuse their purposes or attempt to use this client for feature flag evaluation, as it is explicitly designed for management operations.
fix
Ensure you are using the correct ConfigCat package for your use case: `configcat-publicapi-node-client` for management, and `@configcat/sdk/node` for feature flag evaluation.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Request failed with status code 401
Invalid or missing Public API credentials (username and/or password).
fix
Verify that the `username` and `password` provided to the `Configuration` object are correct Public API credentials, not SDK keys. Ensure they are properly loaded from environment variables or a secure configuration.
Error: Request failed with status code 404
The requested API endpoint or resource (e.g., a specific product ID, feature flag ID) was not found.
fix
Check the `basePath` in your `Configuration` object. Confirm that the IDs or keys used in your API calls (`productId`, `configId`, `featureFlagKey`, etc.) actually exist within your ConfigCat account.
TypeError: Cannot read properties of undefined (reading 'getProducts')
The `ConfigCatPublicApi` client was not initialized correctly, or the API structure has changed after a client regeneration, leading to a non-existent method call.
fix
Ensure the `ConfigCatPublicApi` is properly instantiated with a `Configuration` object. If upgrading, refer to the release notes for any API model changes that might have renamed or reorganized methods (e.g., `api.products.getProducts()` might have become `api.productOperations.list()`).
Upgrade
Version history
3.2.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
configcat-publicapi-node-client — npm install configcat-publicapi-node-client · libregistry