I'm trying to use the ConvertAPI JavaScript SDK in a Vue project. First, I used npm to install it:
npm install --save convertapi-js
Then, I tried to import and invoke it like so:
<script>
import ConvertApi from 'convertapi-js'
export default {
created() {
console.log(ConvertApi.auth({secret: 'secret'})
}
}
</script>
However, when I try to use it I get this error:
Error in created hook: "TypeError: convertapi_js__WEBPACK_IMPORTED_MODULE_1___default.a.auth is not a function"
Do I need to import it in a different way? Here's the structure of the node_module:
convertapi-js
│ README.md
│ package.json
│ LICENSE
│
└───lib
│ │ convertapi.d.ts
│ │ convertapi.d.ts.map
│ │ convertapi.js
│ │ convertapi.js.map
│ │
└───src
│ convertapi.ts
│ file-param.ts
│ ...