apisauce is a lightweight wrapper around axios (^1.7) that standardizes API responses and error handling. Version 3.2.2 is current, with moderate release cadence. Key differentiators: all responses follow a single flow with a `problem` property for error classification, built-in request/response transforms, connection detection on React Native, and full TypeScript support. It simplifies client code by always resolving promises, avoiding try/catch for network errors.
npm install apisauceNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an API instance with base URL and headers, makes a GET request, and handles both success and failure using the ok property.
Replace `import apisauce from 'apisauce'` with `import { create } from 'apisauce'`.Upgrade axios to ^1.7. Version 2.0.0 of apisauce used axios ^0.21.
Replace `monitor: fn` with `onRequest: fn` and `transformRequest: fn` with `requestTransform: fn`.
Check response.problem against these string values.
Set baseURL and headers on the axios instance before passing it to create().
Use `import { create } from 'apisauce'` instead of `import apisauce from 'apisauce'`.Run `npm install axios` or `yarn add axios`.
Use `if (response.ok)` not `if (response.ok())`.
Ensure no external axios interceptors are rejecting promises. apisauce catches errors internally.