Axios adapter for miniprogram (WeChat, Alipay, DingTalk, Baidu). Current stable version: 0.3.5. Release cadence: irregular, with last update around 2020. Provides a drop-in adapter so developers can reuse axios code across web and miniprogram platforms. Unlike using raw wx.request, it enables axios features like interceptors, transformRequest/Response, and cancellation. Supports TypeScript. Minimal bundle increase (~2KB). Active but low maintenance.
npm install axios-miniprogram-adapterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up axios adapter for miniprogram and makes a GET request with basic configuration.
Set axios.defaults.adapter = mpAdapter immediately after import.
Upgrade axios to >=0.21.0 and axios-miniprogram-adapter to >=0.3.0.
Use miniprogram native methods for progress events via transformRequestOption.
Consider alternative adapters or maintain a fork if issues arise.
Use webpack or copy the bundled dist file directly (recommended: use npm with webpack).
Change to: axios.defaults.adapter = mpAdapter
Ensure the request URL is in the whitelist in miniprogram admin settings. Use HTTPS URLs.