2.6.1 • Published 7 years ago

svb-client v2.6.1

Weekly downloads
211
License
MIT
Repository
-
Last release
7 years ago

svb-client

NodeJS library which helps you make GET and POST requests to the SVB API.

If you received a test API key and no HMAC SECRET, you should use a non-empty ASCII string as a placeholder (for example "HMAC SECRET").

Installation

npm install svb-client --save

Usage

const SVB = require('svb-client');

let client = new SVB({
  API_KEY: '',
  // HMAC_SECRET is optional during API tests
  HMAC_SECRET: '',
  // options below are optional, depending on use-case
  BASE_URL: ''
});

client.get('/v1', 'test=1', (err, data) => {
  ...
});

client.post('/v1', { "data": "foo" }, (err, data) => {
  ...
});

// similar
client.patch(url, jsondata, callback);
client.delete(url, callback);

// uploading a file (png, jpg, or pdf)
const fs = require('fs');
client.upload('/v1/files', fs.createReadStream(__dirname + '/file.png'), 'image/png', (err, data) => {
  ...
});
2.6.1

7 years ago

2.5.1

7 years ago

2.4.6

7 years ago

2.4.5

7 years ago

2.4.4

7 years ago

2.4.3

7 years ago

2.4.2

7 years ago

2.3.2

7 years ago

2.2.2

7 years ago

2.2.1

7 years ago

2.2.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago