svb-onboarding
Helper library for NodeJS and Silicon Valley Bank's API, which uses
svb-client module to make
HMAC-signed GET, PATCH, POST, and DELETE requests.
Contains helper functions for all of these resources in the API:
- address
- company
- document
- file
- gov ident
- login
- parent company
- person
Dependencies
Usage
const SVBOnboarding = require('svb-onboarding');
const SVBClient = require('svb-client');
let client = new SVBClient({
API_KEY: '',
HMAC_SECRET: ''
});
let Onboarding = new SVBOnboarding(client);
Onboarding.address.create({
street_line1: '221B Baker St',
city: 'London',
country: 'GB'
}, (err, address) => {
Onboarding.person.create({
address: address,
date_of_birth: '1881-01-01',
first_name: 'Sherlock',
last_name: 'Holmes',
title: 'Detective'
}, (err, person) => {
});
});
Onboarding.person.get(101, (err, person) => {
...
});
Onboarding.person.all((err, people) => {
...
});
Updating and Deleting Resources
Onboarding.person.update(person_id, person_json, callbackFn);
Onboarding.person.delete(person_id, callbackFn);
File Uploads
Onboarding.file(__dirname + '/y18.png', (err, data) => {
assert.equal(err, null);
assert.equal(typeof data, 'object');
assert.equal(typeof data.id, 'number');
done();
});
client.upload('/v1/files', fs.createReadStream(...), (err, data) => {
...
});
Install
npm install svb-onboarding --save