YellowGrid API TypeScript Client
raw JSON → 3.2.116 verified Sat Apr 25 auth: no javascript
OpenAPI-generated TypeScript/JavaScript client library for the YellowGrid API (version 3.2.116, latest stable). Uses Axios for HTTP requests. Supports Node.js, Webpack, and Browserify environments. Ships TypeScript type definitions. Compatible with ES5+ and CommonJS/ES6 module systems. Generated via OpenAPI Generator, providing comprehensive API coverage including accounts, credentials, contacts, and reseller operations.
Common errors
error Cannot find module 'yellowgrid-api-ts' ↓
cause Package not installed or version mismatch
fix
Run 'npm install yellowgrid-api-ts' and ensure it's in package.json dependencies.
error TypeError: yellowgrid_api_ts_1.AccountsApi is not a constructor ↓
cause Using wrong import style (default vs named import)
fix
Use correct import: import { AccountsApi } from 'yellowgrid-api-ts'
error ERROR: Configuration is not exported from 'yellowgrid-api-ts' ↓
cause Outdated version of the package
fix
Upgrade to the latest version: npm install yellowgrid-api-ts@latest
Warnings
breaking The package was generated from an OpenAPI spec; changing the spec may introduce breaking changes in method signatures. ↓
fix Always generate client against the exact API version you are targeting.
deprecated ES5 support is deprecated; Promises/A+ library may be required in older environments. ↓
fix Upgrade to ES6+ environment or use a promise polyfill.
gotcha Base path defaults to 'https://bitbucket.org' which is incorrect for production; must be overridden. ↓
fix Always set basePath in Configuration to your API server URL.
gotcha API key authentication may require the 'apiKey' parameter in Configuration, not 'accessToken'. ↓
fix Check the auth scheme defined in your OpenAPI spec.
Install
npm install yellowgrid-api-ts yarn add yellowgrid-api-ts pnpm add yellowgrid-api-ts Imports
- AccountsApi wrong
const AccountsApi = require('yellowgrid-api-ts').AccountsApicorrectimport { AccountsApi } from 'yellowgrid-api-ts' - DefaultApi
import { DefaultApi } from 'yellowgrid-api-ts' - Configuration wrong
import { Configuration } from 'yellowgrid-api-ts/dist'correctimport { Configuration } from 'yellowgrid-api-ts' - ApiClient
import { ApiClient } from 'yellowgrid-api-ts'
Quickstart
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();