Skip to content
RinseV edited this page Mar 25, 2022 · 1 revision

Welcome to the plus-wrapper wiki!

This package provides an easy way to interact with the PLUS API, for instructions, please visit the main page where you can find the most important info.

Example usage

You can initialize the client as follows:

import { Plus } from 'plus-wrapper';

const plus = new Plus();

Once created, you can use the functions as follows:

const products = await plus.product().getProductsFromName('melk');

Make sure to use async/await for the functions!

Advanced usage

The Plus object can be created with some extra options:

{
  verbose?: boolean
  apiVersion?: boolean
}

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 plus.product().getProductsFromName('melk', undefined, {
    query: {
        key: 'value'
    },
    headers: {
        Connection: 'keep-alive'
    }
})

The provided queries and headers will be merged with other queries and headers needed for the request.

Clone this wiki locally