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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@eyevinn/enigma.io

v1.5.2

Published

NPM library for integration with Red Bee Media Managed OTT APIs

Downloads

22

Readme

An NPM library for integration with Red Bee Media Managed OTT platform.

Installation

npm install @eyevinn/enigma.io

Authentication

Provide API key ID and secret with the environment variables API_KEY_ID and API_KEY_SECRET.

Your key and secret can also be set when initiating the ManagementApi, like so:

const managementApi = new EnigmaIO.ManagementAPI("Customer", "BusinessUnit", { 
  API_KEY_ID: "Your API KEY ID",
  API_KEY_SECRET: "Your API KEY SECRET"
});

If omitted when created a new class, the managementAPI will look for environment variables.

Management API

const EnigmaIO = require("@eyevinn/enigma.io");
const managementApi = new EnigmaIO.ManagementAPI("Customer", "BusinessUnit");

// using red bee's stage environment

const managementApi = new EnigmaIO.ManagementAPI("Customer", "BusinessUnit", { environment: "stage"});

Methods

Users

Products & Product Offerings

Purchases

  • getPurchases Retrieve active purchases for an account.
  • performPurchase Performs a purchase of a given productOffering for a given account.
  • removePurchase Remove a purchased productOffering and its access from a given account.

Assets

Where the metadata object should be constructed in the following format

{
  "languages": [ "en" ],
  "en": {
    "description": "Walt rejects everyone who tries to help him with the cancer. Jesse tries his best to create Walt's meth, with the help of an old friend."
  },
  "studio": "Sony Pictures Television",
  "productionYear": "2019"
}
  • linkAssets Create a link from srcAssetId to destAssetId.
  • ingestVideo Ingest a video file to an asset. The URL to the video file must be accessible by the platform.
  • publishAsset Add a product publication to an asset.
  • unpublishAsset Remove one single publication, or all publications, on an asset.
  • createProduct Create a product in the platform
  • getProducts Get all products in the platform
  • getProduct Get a specific product in the platform

Exposure API

const EnigmaIO = require("@eyevinn/enigma.io");
const exposureApi = new EnigmaIO.ExposureAPI("Customer", "BusinessUnit");

// using red bee's stage environment

const exposureApi = new EnigmaIO.ExposureAPI("Customer", "BusinessUnit", { environment: "stage"});

Methods

Authorization

const authResponse = await exposureApi.authenticate(username, password);
const sessionToken = authResponse.sessionToken;

Assets

  • play Get a medialocator, i.e. a manifest, to play the file
const authResponse = await exposureApi.authenticate(username, password);
const sessionToken = authResponse.sessionToken;
const playResponse = await exposureApi.play(sessionToken, assetId);
const hlsFormat = playResponse.formats.find(a => a.format === "HLS");
if (hlsFormat) {
  const mediaLocator = hlsFormat.mediaLocator;
}
  • getAssets Get all assets of a specific asset type.
  • getAsset Get a specific asset by its asset ID.
  • resolveSerie Get all assets for a serie and structured in a series/seasons/episodes structure.

Run the tests

  • create a .env file in the root of the project
  • add API_KEY_ID and API_KEY_SECRET for the Management API
  • add your USERNAME and PASSWORD to obtain session for the Exposure API
  • run npm test