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
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
AccountsApi
✓ import { AccountsApi } from 'yellowgrid-api-ts'
✗ const AccountsApi = require('yellowgrid-api-ts').AccountsApi
CommonJS require also works, but ESM import is preferred.
DefaultApi
✓ import { DefaultApi } from 'yellowgrid-api-ts'
May not exist in all versions; check API documentation for available classes.
Configuration
✓ import { Configuration } from 'yellowgrid-api-ts'
✗ import { Configuration } from 'yellowgrid-api-ts/dist'
Configuration is used to set API keys and base path. Direct import from dist is an internal path.
ApiClient
✓ import { ApiClient } from 'yellowgrid-api-ts'
Some older versions use ApiClient; check your generated code.
Demonstrates creating a Configuration with an API key and fetching account data using AccountsApi.
import { AccountsApi, Configuration } from 'yellowgrid-api-ts';
const config = new Configuration({
basePath: 'https://api.yellowgrid.com',
apiKey: process.env.YELLOWGRID_API_KEY ?? ''
});
const api = new AccountsApi(config);
async function getAccount() {
try {
const response = await api.getGetAccount();
console.log('Account data:', response.data);
} catch (error) {
console.error('Error fetching account:', error);
}
}
getAccount();
Errors
Common errors & fixes
Cannot find module 'yellowgrid-api-ts'
Package not installed or version mismatch
fixRun 'npm install yellowgrid-api-ts' and ensure it's in package.json dependencies.
TypeError: yellowgrid_api_ts_1.AccountsApi is not a constructor
Using wrong import style (default vs named import)
fixUse correct import: import { AccountsApi } from 'yellowgrid-api-ts' ERROR: Configuration is not exported from 'yellowgrid-api-ts'
Outdated version of the package
fixUpgrade to the latest version: npm install yellowgrid-api-ts@latest
Audit
Dependencies
axiosrequiredRuntime dependency for HTTP requests