clover-client
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

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,
  },
});

/clover-client/

    Package Sidebar

    Install

    npm i clover-client

    Weekly Downloads

    0

    Version

    1.1.1

    License

    MIT

    Unpacked Size

    13.8 kB

    Total Files

    11

    Last publish

    Collaborators

    • infuse