Using JavaScript SDK with React

A long time ago, I wrote a small application which used React. At the time, the SDK was in version 0.88 and it was referenced as purecloud_api_sdk_javascript.

Today, I wanted to work on a new app. I started a fresh React app, used yarn to install the purecloud sdk and imported using import { platformClient } from 'purecloud-platform-client-v2'; which is similar to what I followed on the previous app. When I try to run the app, here's what I get:

Failed to compile
./node_modules/purecloud-platform-client-v2/src/purecloud-platform-client-v2/index.js
Module not found: Can't resolve 'purecloud-platform-client-v2/ApiClient' in '/Users/xxxxxx/node_modules/purecloud-platform-client-v2/src/purecloud-platform-client-v2'
This error occurred during the build time and cannot be dismissed.

Any ideas on what is causing it?

--Lehel

I was able to figure it out, and looking back, this was a rather silly question. I wish I had the option to delete my original post.

I was trying to import the Purecloud SDK into a JS file which ends up getting executed in the browser as opposed to server-side which where I want to be making PureCloud API calls from.

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