bitmovin-api-sdk-javascript
bitmovin-api-sdk-javascript copied to clipboard
Running into 'BitmovinApi is not a constructor' error
This might be only if using es6 modules since I see reference to 'default' in the require() flow.
With require instructions:
const BitmovinApi = require('@bitmovin/api-sdk')["default"];
es6 import instructions currently:
import BitmovinApi from '@bitmovin/api-sdk';
Documentation shows the following to create a new instance of the BitmovinApi:
const bitmovinApi = new BitmovinApi({
apiKey: 'API_KEY',
});
But on further inspection, there is a method on the BitmovinApi object itself called 'default' that actually returns the constructor function.
So to create a new instance successfully you must:
const bitmovinApi = new BitmovinApi.default({
apiKey: 'API_KEY',
});