@ideal-postcodes/core-axios is the Axios backed client for api.ideal-postcodes.co.uk. Axios is a promise based HTTP client for the browser and node.js and so is ideal for:
- Frameworks that utilise server side rendering (Angular, Next.js, React, etc)
- Isomorphic code (runs on browser and server)
High level client documentation can be found at core-interface.
In depth client documentation can be found at core-interface.ideal-postcodes.dev.
- Configuration & Usage
- Client Documentation
- In Depth Client Documentation
- npm Module
- GitHub Repository
Configuration & Usage
npm install @ideal-postcodes/core-axios
const Client = ;// or, if applicable,const client = api_key: "iddqd" ;
const addresses = await client;
const IdpcRequestFailedError = Clienterrors;tryawait client;catch errorif error instanceof IdpcRequestFailedError// IdpcRequestFailedError indicates a 402 response code// Possibly the key balance has been depleted