Legacy Dev Forum Posts

 View Only

Sign Up

Support ESM for purecloud-platform-client-v2?

  • 1.  Support ESM for purecloud-platform-client-v2?

    Posted 06-05-2025 18:03

    joel_hellman | 2023-09-04 21:41:06 UTC | #1

    Do you have any guides how to set up purecloud-platform-client-v2 for node and typescript using esm instead of e.g. CommonJS?

    E.g. to support node script syntax such as below with the typescript definitions pulled in?

    // script.ts
    import platformsclient from "purecloud-platform-client-v2"
    const client = platformsclient.ApiClient.instance

    I read some posts on this topic like https://developer.genesys.cloud/devapps/sdk/docexplorer/purecloudjavascript/ and other forum posts and as I understood it, I might need compile the source code included in the package myself to get this to work?

    I'm not using a bundler like webpack or rollup right now, since I just want to write a few scripts in Typescript using this package, and I was hoping it would be possible. I don't have much experience with using bundlers in this context, so I'm unsure of the best path forward, and want to ask before I spend more time on it.

    I also read an older post that you are working on getting a setup, to add support for esm imports?


    system | 2023-10-05 21:40:42 UTC | #2

    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: 21841