Skip to main content
This is a reference implementation - copy client.js into your project or adapt it. It is not published to npm.

Features

  • KalixoClient.sandbox() / .production() factory helpers
  • placeOrder() with your externalOrderCode idempotency key and per-line country
  • waitForOrder() - waits until estimatedReadyAt, polls every 60s, and gives up after a maximum wait (2 hours by default)
  • Retries 429 (using Retry-After), 5xx and network errors with backoff
  • KalixoError with statusCode and the X-Request-Id to quote to support
  • newExternalOrderCode() helper for stable idempotency keys

Usage

Requires Node 18+ (fetch built in) and ES modules ("type": "module" or a .mjs file). For older Node versions, swap fetch for your HTTP library.
See also the polling example for a minimal inline version without the client class.