npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

oddworks-ooyala-provider

v1.9.6

Published

An Oddworks provider plugin for Ooyala APIs

Downloads

62

Readme

Oddworks Ooyala Provider

pipeline status

An Ooyala provider plugin for the Oddworks content server.

Installation

Install the npm package as a Node.js library:

npm install --save oddworks-ooyala-provider

For full Ooyala Backlot API documentation see support.ooyala.com/developers/documentation/concepts/chapter_api_setup.html.

Oddworks Server Integration

The Oddworks-Ooyala provider is designed to be integrated with an Oddworks server catalog, specifically as a provider. To initialize the plugin in your server:

const ooyalaProvider = require('oddworks-ooyala-provider');

// See https://gitlab.com/oddnetworks/oddworks/core/tree/master/lib/services/catalog#patterns
// for more information regarding an Oddcast Bus.
const bus = createMyOddcastBus();

const options = {
    bus: bus,
    apiKey: process.env.OOYALA_API_KEY,
    secretKey: process.env.OOYALA_SECRET_KEY
};

ooyalaProvider.initialize(options).then(provider => {
    console.log('Initialized provider "%s"', provider.name);
}).catch(err => {
    console.error(err.stack || err.message || err);
});

The initialization process will attach Oddcast listeners for the following queries:

  • bus.query({role: 'provider', cmd: 'get', source: 'ooyala-label-provider'})
  • bus.query({role: 'provider', cmd: 'get', source: 'ooyala-asset-provider'})

To use them you send Oddcast commands to save a specification object:

// To create a collection based on a Backlot label:
bus.sendCommand({role: 'catalog', cmd: 'setItemSpec'}, {
    channel: 'abc',
    type: 'collectionSpec',
    source: 'ooyala-label-provider',
    label: {id: '123456'}
});

// To create a video based on a Backlot asset:
bus.sendCommand({role: 'catalog', cmd: 'setItemSpec'}, {
    channel: 'abc',
    type: 'videoSpec',
    source: 'ooyala-asset-provider',
    asset: {external_id: '123456'}
});

Transform Functions

This library provides a default transform function for collections and assets. Usually you don't want to use the default. You'll want to provide your own like this:

const ooyalaProvider = require('oddworks-ooyala-provider');
const bus = createMyOddcastBus();

const options = {
    bus: bus,
    collectionTransform: myCollectionTransform,
    assetTransform: myAssetTransform
};

ooyalaProvider.initialize(options).then(provider => {
    console.log('Initialized provider "%s"', provider.name);
}).catch(err => {
    console.error(err.stack || err.message || err);
});

Your transform functions myCollectionTransform and myAssetTransform will be called when the ooyala-label-provider and ooyala-asset-provider have respectively received a response from the Backlot API. Each transform will be called with 2 arguments: The spec object and the Backlot API response object.

See lib/default-asset-transform and lib/default-collection-transform for more info.

Ooyala API Client

You can create a stand-alone API client outside of the Oddworks provider:

const ooyalaProvider = require('oddworks-ooyala-provider');

const client = ooyalaProvider.createClient({
    bus: bus,
    apiKey: process.env.OOYALA_API_KEY,
    secretKey: process.env.OOYALA_SECRET_KEY
});

The client can also be initialized with the high performance GET API using the baseUrl option (see below).

Client Methods

All methods return a Promise.

  • client.getLabels()
  • client.getLabel({labelId})
  • client.getChildLabels({labelId})
  • client.getAssetsByLabel({labelId})
  • client.getAsset({assetId})
  • client.getAssetMetadata({assetId})
  • client.getAssetStreams({assetId})

Command Line Interface

You can interact with the Backlot client using the CLI tool. To get started, run:

bin/backlot --help

To authenticate the API you'll need to export the following environment variables:

  • BACKLOT_API_KEY The Backlot API key
  • BACKLOT_SECRET_KEY The Backlot secret key

To get help with commands:

bin/backlot list --help
bin/backlot req --help

High Performance API

Ooyala offers a CDN API for serving GET requests only, which may be preferable to the standard Backlot API. To use it, initialize the provider like this:

const ooyalaProvider = require('oddworks-ooyala-provider');

const options = {
    bus: bus,
    apiKey: process.env.OOYALA_API_KEY,
    secretKey: process.env.OOYALA_SECRET_KEY,
    // Use the high performance API
    baseUrl: 'https://cdn-api.ooyala.com'
};

ooyalaProvider.initialize(options).then(provider => {
    console.log('Initialized provider "%s"', provider.name);
}).catch(err => {
    console.error(err.stack || err.message || err);
});

License

Apache 2.0 © Odd Networks