Import Error: importing Bitmovin API

I’ve installed the NPM package and have imported the package as instructed in the readme but I get an error.

This is how I have imported:

import BitmovinApi from '@bitmovin/api-sdk';

and this is the error:

Uncaught TypeError: Failed to resolve module specifier "@bitmovin/api-sdk". Relative references must start with either "/", "./", or "../".

this is where it is on my HTML page:

<script type="module" lang="javascript">
 import BitmovinApi from '@bitmovin/api-sdk';

What am I doing wrong?

You would need to use the brwowser version in order to run our API client in the browser. @bitmovin/api-sdk/dist/bitmovin-api-sdk.browser.js or bitmovin-api-sdk.browser.min.js

import BitmovinApi from '@bitmovin/api-sdk'; is meant for server-side apps.
I hope this helps. please let me know in case you have further questions.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.