VHX API Client – Node.js
JavaScript
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
.jshintrc
CHANGELOG.md
LICENSE
README.md
VERSION
package.json

README.md

VHX Node.js API Client

API applications can be created in the VHX admin or by emailing api@vhx.tv

Note

Looking for an API client that uses Promises or async/await? Try the new vhx-js client library: https://github.com/vhx/vhx-js

We welcome bug reports and pull requests!

Installation

npm install vhx

Documentation

Documentation, including a step-by-step tutorial is available on the VHX Developer Docs site. For Full API reference go here.

Getting Started

Before requesting your first resource, you must setup your instance of the VHX Client:

var vhx = require('vhx')('your VHX API key');

Every resource method has two arguments. The first argument is an options object or identifier and the second, an optional callback:

// example customer create
vhx.customers.create({
  email: 'customer@email.com',
  name: 'First Last'
}, function(err, customer) {
  // err, = error is false if no error occurred
  // customer = the created customer object
});

Headers can be passed in as the last argument, which would either be the second or third argument depending on the method. See each individual method for specifics.

// example video create with header
vhx.videos.create({
  title: 'My Video',
}, { 'VHX-Client-IP': '0.0.0.0' }, function(err, customer) {
});

Resources & methods

products

customers

videos

collections

authorizations

analytics