vhx

VHX Node.js API Client

Usage no npm install needed!

<script type="module">
  import vhx from 'https://cdn.skypack.dev/vhx';
</script>

README

VHX Node.js API Client

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

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