clover-client
v1.1.1
Published
Node client for making rate-limited requests to the Clover API
Downloads
5
Readme
Clover Client
Usage
import CloverClient, { METHODS } from 'clover-client';
const MERCHANT_ID = 'abc';
const API_TOKEN = 'xyz';
const client = new CloverClient({ isProduction: true });
(async () => {
const response = await client.request({
endpoint: `merchants/${MERCHANT_ID}`,
method: METHODS.POST,
query: {
expand: ['employees'],
},
body: {
name: 'Merchant Name',
owner: {
name: 'Owner Name',
},
},
apiToken: API_TOKEN,
});
console.dir(response);
})();
const customClient = new CloverClient({
isProduction = true,
retryLimit = 5,
timeout = 5000,
rateLimits = {
app: 20,
token: 10,
},
concurrencyLimits = {
app: 20,
token: 10,
},
});