I’m facing error while validation of Freshchat domain for a verify button in my installation page, I attached the screenshot of error in console page, network logs for referances
function verify() {
try {
var response = client.request.invokeTemplate('verify', {
context: {
freshChatUrl: freshchat_domain.value,
freshChatKey: freshChat_key.value,
},
})
console.log('response', response)
if (response.status == 200) {
alert('Verified Successfully')
verified = true
} else if (response.status == 401) {
console.error('Error: Domain or API key is invalid')
verified = false
}
} catch (error) {
console.error('Error while verify', error)
verified = false
}
}
// Call verify function when needed
function validate() {
return verified
}