Skip to main content

API

API (@ekz/api) provides a typed HTTP client and WebSocket hook for React apps, built on Axios and Bluebird promises.

Features

  • ApiClientProvider — inject a configured client via React context
  • HTTP verbsget, post, put, patch, delete returning Bluebird promises
  • Retries & auth redirect — configurable retry backoff and unauthorized handling
  • useWebSocket — reconnecting WebSocket with queued outbound messages
  • useRequestQueue — limit parallel in-flight requests

Dependencies

Works with other @ekz packages:

Install

npm install @ekz/api @ekz/react-utils immutable react

Peer dependencies: react, react-dom, immutable.

Next steps