I recently came across the ConvertAPI JavaScript SDK and decided to incorporate it into my Vue project. Following the installation process using npm
:
npm install --save convertapi-js
I then proceeded to import and invoke it in this manner:
<script>
import ConvertApi from 'convertapi-js'
export default {
created() {
console.log(ConvertApi.auth({secret: 'secret'})
}
}
</script>
Unfortunately, upon attempting to utilize the tool, I encountered the following error message:
Error in created hook: "TypeError: convertapi_js__WEBPACK_IMPORTED_MODULE_1___default.a.auth is not a function"
This issue led me to question whether there is an alternative method for importing it correctly. The structure of the node_module
is as follows:
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
│ ...