Legacy Dev Forum Posts

 View Only

Sign Up

Using JavaScript SDK with React

  • 1.  Using JavaScript SDK with React

    Posted 06-05-2025 18:01

    lehelg | 2018-03-01 00:33:17 UTC | #1

    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 purecloudapisdk_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 ./nodemodules/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/nodemodules/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


    lehelg | 2018-03-01 21:09:25 UTC | #2

    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.


    system | 2018-04-01 21:09:29 UTC | #3

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


    This post was migrated from the old Developer Forum.

    ref: 2552