A modern, type-safe TypeScript library for WooCommerce REST API. Current stable version is 7.1.2 (released 2025). Provides full TypeScript support with comprehensive type definitions, supports both CommonJS and ES modules, built-in OAuth 1.0a authentication, custom error classes, and convenience methods. Compared to the official JavaScript client, it offers enhanced error handling, better response typing with WooCommerceApiResponse<T>, and tree-shaking support. Released under the MIT license.
npm install woocommerce-rest-ts-apiNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Instantiates the WooCommerceRestApi client and fetches products using the getAsync convenience method.
Replace synchronous methods with async versions. Example: api.getAsync('/products')Use 'import WooCommerceRestApi from 'woocommerce-rest-ts-api'' instead of 'import { default as WooCommerceRestApi } from ...'Add .default when using require()
Ensure both credentials are provided and correct. Generate keys from WooCommerce settings > Advanced > REST API.
Set queryStringAuth: true if you need Basic Auth in query string; this option may be removed in future.
Use WooCommerceApiResponse<T> for response data types. Access response.data as before, but now typed.
Run 'npm install woocommerce-rest-ts-api' and ensure your tsconfig has 'moduleResolution': 'node' or 'node16'.
Use 'const WooCommerceRestApi = require('woocommerce-rest-ts-api').default'Upgrade to version 7.1.2 or use deprecated 'get' method: api.get('/products')Verify consumerKey and consumerSecret from WooCommerce. Ensure URL is correct and includes protocol (https://).