Error importing javascript SDK

Hello,

I'm trying to import the javascript SDK like in https://developer.mypurecloud.ie/api/rest/client-libraries/javascript-noborder/index.html tutorial, but without success.
After included the html import and triggered the function with the code in section "Web Implicit Grant", the console browser retrieves the following error:

Uncaught Error: Cannot find module 'purecloud-platform-client-v2'
** at s (purecloud-platform-client-v2.min.js:1)**
** at s (purecloud-platform-client-v2.min.js:1)**

Thank you in advance.

Hm, that's certainly not good. I've created API-2761 and will look into this ASAP.

Ok, i wait for it.

Thank you and best regards.

Turns out it was just a documentation issue. Instead of:

const platformClient = require('purecloud-platform-client-v2');

use the module name platformClient. The module name above is for node, the one below is for the web module.

const platformClient = require('platformClient');

Additionally, I found a bug that was just recently introduced due to adding a custom header to the SDK. I've fixed that as of v. 6.1.5. Here's the link to the CDN; the documentation is currently in the process of deploying to the dev center.

<script src="https://sdk-cdn.mypurecloud.com/javascript/6.1.5/purecloud-platform-client-v2.js"></script>

That was it

Thank you and regards

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