TypeScript client for Wildberries API
As part of working on one of the projects, it was necessary to use the Wildberries API.
Since I write in TypeScript, the best way to create types was to generate them from Swagger.
In the end, it all resulted in a library. wildberries-api.
All API methods with request/response types have been generated. The automatic generation script will allow you to effortlessly maintain the current version of the API.
Installation
npm install wildberries-api
Example of use:
import { supplies } from 'wildberries-api';
const api = new supplies.Api({
baseApiParams: {
headers: {
'Authorization': process.env.WB_TOKEN
},
},
baseUrl: 'https://supplies-api.wildberries.ru'
});
const main = async() => {
const result = await api.api.v1WarehousesList();
console.log(result.data);
process.exit();
};
main();