Error In genesys Packages: NPM Packages (purecloud-platform-client-v2)

Attention Needed :
Dear Team, We are currently encountering an issue with the "purecloud-platform-client-v2" package when using implicit grant. The error message we are receiving is as follows:
"..\node_modules\purecloud-platform-client-v2\dist\node\purecloud-platform-client-v2.js:654 window.location.replace(url); ^ ReferenceError: window is not defined" ...\node_modules\purecloud-platform-client-v2\dist\node\purecloud-platform-client-v2.js:654:6 at processTicksAndRejections (node:internal/process/task_queues:96:5)

We understand that implicit grant is typically used for redirecting the URL in a browser. However, in our case, we are implementing OAuth in the backend using Node.js. If our understanding is incorrect, please provide us with the correct approach. Otherwise, we kindly request your assistance in resolving this issue. Below are the details for the client ID, client secret, and redirect URL: Client ID: 'XXXXXXXXXX' Client Secret: 'XXXXXXXXX' Redirect URL: http://localhost:4201 We appreciate your professional assistance and prompt resolution of this matter. Thank you for your attention. Best regards,

@vinayakv16 Please regenerate your client secret immediately. I edited your credentials out of your post, but they were exposed to the open internet for some time. Your client secret must be handled like a password.

Hello Jerome,

Thanks for the info.
Is there anything we can get anything on my issue? as we are struck with this our Implementation.

Hello,

If you are trying to invoke the Platform API, from your backend, using an authorization token that is associated with a user context/credentials, then the approach would be to use an Oauth Authorization Code Grant flow.
See Grant - Authorization Code for more info, and OAuth Authorization Code Grant Flow for a sample code.

If you are If you are trying to invoke the Platform API, from your backend, using an authorization token that is not associated with a user account, you would then use an OAuth Client Credentials Grant flow.

Regards,

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