Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running into 'BitmovinApi is not a constructor' error #6

Open
internetdrew opened this issue Jan 3, 2023 · 0 comments
Open

Running into 'BitmovinApi is not a constructor' error #6

internetdrew opened this issue Jan 3, 2023 · 0 comments

Comments

@internetdrew
Copy link

internetdrew commented Jan 3, 2023

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',
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant