Installation

Install listingsapi-js from npm, choose ESM or CJS, and verify your setup.

Requirements

  • Node.js 18 or later
  • npm, pnpm, or yarn

The SDK uses native fetch (built into Node 18+) and has zero runtime dependencies.

Install

bash
npm install listingsapi-js
bash
# pnpm
pnpm add listingsapi-js
 
# yarn
yarn add listingsapi-js

ESM and CJS

listingsapi-js ships both an ESM build and a CommonJS build. The correct entry point is chosen automatically based on your project's type setting.

ESM ("type": "module" in package.json or .mts/.mjs extension):

TypeScript
import { ListingsAPI, APIError } from 'listingsapi-js';

CJS (default Node module resolution or .cts/.cjs extension):

JavaScript
const { ListingsAPI, APIError } = require('listingsapi-js');

TypeScript

Type definitions are bundled in the package, so no separate @types/listingsapi-js is needed. The SDK is written in TypeScript and the dist/ folder ships .d.ts files (and .d.cts for the CommonJS build) for all exports.

bash
# No extra step needed: types come with the package
npm install listingsapi-js

Pin the version

bash
npm install listingsapi-js@0.3.0

Or in package.json:

json
{
"dependencies": {
"listingsapi-js": "^0.3.0"
}
}

Verify

verify.ts
import { ListingsAPI } from 'listingsapi-js';
 
const client = new ListingsAPI({ apiKey: 'your-api-key' });
console.log('listingsapi-js ready', typeof client.fetchAllLocations);
bash
npx tsx verify.ts

Next steps