-
Notifications
You must be signed in to change notification settings - Fork 0
Home
This package provides an easy way to interact with the Aldi Supermarkten API, for instructions, please visit the main page where you can find the most important info.
If you want more detail on specific functions, I'd recommend visiting the wiki page for that object.
You can initialize the client as follows:
import { Aldi } from 'aldi-wrapper';
const aldi = new Aldi();
Once created, you can use the functions as follows:
const products = await aldi.product().getProductsFromName('melk');
Make sure to use async
/await
for the functions!
The Aldi object can be created with some extra options:
{
verbose?: boolean
apiVersion?: number
}
You can log all requests in the console by setting verbose
to true
. You can also specify a custom api versioning number, if you don't provide one, the default will be used.
Every single function can also be provided with additional request options in the form of extra queries or headers. These can be added via the additionalRequestOptions parameter as follows:
const products = await aldi.product().getProductsFromName('melk', {
query: {
key: 'value'
},
headers: {
Connection: 'keep-alive'
}
})
The provided queries and headers will be merged with other queries and headers needed for the request.