@vhx/vhxjs

2.1.2 • Public • Published

Vimeo OTT/VHX Javascript API Client

Ready for use server-side, using Node. Not ready for use client-side, as we currently do not offer public API keys.

Installation

npm install @vhx/vhxjs

Documentation

For Full API reference go here.

Getting Started

Before requesting your first resource, you must setup your instance of the Vimeo OTT/VHX Client. This can be done with either:

Node:

const VhxApi = require('@vhx/vhxjs/dist/index.js');

const vhx = new VhxApi('YOUR_API_KEY_HERE');

Client (using a module bundler like Webpack/Rollup/etc.)

import VhxApi from '@vhx/vhxjs';

const vhx = new VhxApi('YOUR_API_KEY_HERE');

or through a standard script tag, (use client.js in the dist folder)

<script src="your_path/client.js"></script>
var vhx = new VhxApi('YOUR_API_KEY_HERE');

Depending on the endpoint, the resource will take either:

  • two arguments - an id, then an optional object with options
  • one argument - only an options object

The id can either be in the form of a numeric ID or an HREF (see example below).

This library uses Promises instead of callbacks. You can either use then/catch or async/await:

vhx.customers.retrieve('1234').then(res => console.log(res));

or

async getCustomers() => {
  const customers = await vhx.customers.retrieve('https://api.vhx.tv/customers/1234');
  console.log(customers);  // logs the object once the promise is resolved
}

Resources & Methods

products

customers

videos

collections

browse

analytics

Readme

Keywords

none

Package Sidebar

Install

npm i @vhx/vhxjs

Weekly Downloads

8

Version

2.1.2

License

MIT

Unpacked Size

118 kB

Total Files

25

Last publish

Collaborators

  • daveyeu
  • evanhammer
  • yay4yae
  • jaygoss
  • nar_mean