vhx-promise

Async/promisified Vimeo OTT Node.js API Client.

Usage no npm install needed!

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

README

Async/promisified Vimeo OTT Node.js API Client

Use the Vimeo OTT (vhx) API client with async/await or promises.

Installation

npm install vhx-promise

Getting Started

The first step is setting up your instance of the Client:

const vhxPromise = require('vhx-promise');

const vhx = new vhxPromise('YOUR_API_KEY_HERE');

Async/await:

async () => {
    // Customer creation example
    const customer = await vhx.customers.create({
      email: 'customer@email.com',
      name: 'First Last'
    });
    console.log(customer);
    return customer;
};

Promises:

() => {
    // Customer creation example
    return vhx.customers.create({
      email: 'customer@email.com',
      name: 'First Last'
    })
      .then((customer) => {
        console.log(customer);
        return customer;
      });
};