Hi,
I'm trying to build a angular application. I installed and import purecloud-platform-client-v2 package with version 191.0.0
However, I got the an error on:
ERROR TypeError: Cannot read properties of undefined (reading 'instance')
I create a function
private loginClient() {
const clientConfig = {
clientId: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
clientSecret: 'yyyyyyyyyyyyyyyyyyyyyyyy',
redirectUri: 'http://localhost:4200/'
}
const client = platformClient.ApiClient.instance;
client.loginClientCredentialsGrant(clientConfig.clientId, clientConfig.clientSecret)
.then(() => {
// Do authenticated things
})
.catch((err) => {
// Handle failure response
console.log(err);
});
}
where the import is
import * as platformClient from 'purecloud-platform-client-v2';
I have noticed that platformClient is an empty object and therefore platformClient.ApiClient is null.