Javascript-API-Client which enables you to seamlessly integrate the Bitmovin API into your projects. Using this API client requires an active account. Sign up for a Bitmovin API key.
The full Bitmovin API reference can be found on our website.
npm install bitmovin-javascript
or with yarnpkg
yarn add bitmovin-javascript
With Babel/ES6:
import Bitmovin from 'bitmovin-javascript';
const bitmovin = new Bitmovin({'apiKey': BITMOVIN_API_KEY, debug: false});
With NodeJS:
const Bitmovin = require('bitmovin-javascript').default;
const bitmovin = new Bitmovin({'apiKey': BITMOVIN_API_KEY, debug: false});
The Bitmovin-Javascript API Client is closely modeled after our Bitmovin API Reference Bitmovin API. Each resource in the API Reference has a 1:1 mapping in our API Client.
All methods return a Promise
Object that will return the fetched result values from the API.
So for example the list all inputs call is defined as GET v1/encoding/inputs
in our API-Reference and simply corresponds to:
const limit = 100;
const offset = 0;
bitmovin.encoding.inputs.list(limit, offset).then((inputs) => {
inputs.forEach((input) => {
console.log(input.name);
});
});
An sample DASH & HLS encoding sample can be found in examples/encoding/01_simple_encoding_dash_manifest.js
For more examples visit our example page or look at the integration tests
If you want to contribute feel free to send Pull-Requests. Make sure the tests pass and new functions have ample test coverage.
Running tests:
yarn test
yarn coverage