0.0.11 • Published 6 months ago

vendus-sdk v0.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Vendus API Unofficial JavaScript API

"Buy Me A Coffee"

The documentation for the Vendus API is available here. Not all endpoints are available but feel free to contribute!

Installation

First, install the module with npm (or yarn):

npm install vendus-sdk

Then, depending upon your usage context, add a reference to it:

CommonJS / Node

const vendus = require("vendus-sdk");

ESM / TypeScript

import VendusClient from "vendus-sdk";

Usage

To use this client you must have an API Key from Vendus.

import VendusClient from "vendus-sdk";

const vendus = new VendusClient({
  apiKey: process.env.VENDUS_API_KEY,
});

const client = await vendus.clients.createClient({
  externalUserId: "test-user",
  market: "GB",
  locale: "en_US",
});

Error Handling

If a response is returned with a code >= 300, instead of returning the response, the response will be thrown as an error to be caught. The error has the following fields:

{
  name: "Request failed",
  message: "Request failed with status 404: Not found",
  status: 404,
  statusText: "Not found",
  request: {
    url: `https://www.vendus.pt/ws/v1.1/notFound`,
    options: fetchOptions,
  }
  response: "Fetch response object"
}
0.0.11

6 months ago

0.0.10

6 months ago

0.0.9

6 months ago

0.0.8

6 months ago

0.0.7

6 months ago

0.0.6

6 months ago

0.0.5

6 months ago

0.0.4

6 months ago

0.0.3

6 months ago

0.0.2

6 months ago

0.0.1

6 months ago