Diagnoser Object

Methods

checkForIntegration(mode, options = null)
Check state for an integration usage

  • mode String: 'all', 'critical' or 'nonCritical'
  • options Object: optional object with configuration in the form { 'checkName': { propertiesForTheCheck } }

return Promise{Object}: Response for all the checks performed

checkAll(type, options = null)
Perform every check

  • type String: 'integration'
  • options Object: optional object with configuration in the form { 'checkName': { propertiesForTheCheck } }

return Promise{Object}: Response for all the checks performed

checkCritical(type, options = null)
Perform only critical checks that need to be passed for the JS client to work

  • type String: 'integration'
  • options Object: optional object with configuration in the form { 'checkName': { propertiesForTheCheck } }

return Promise{Object}: Response for all the checks performed

checkNonCritical(type, options = null)
Perform only non critical checks that do not require a passing score for the JS client to work

  • type String: 'integration'
  • options Object: optional object with configuration in the form { 'checkName': { propertiesForTheCheck } }

return Promise{Object}: Response for all the checks performed

checkBrowserSupport(type)
Check if the current browser is supported

  • type String: 'integration'

return Promise{Object}

Response object
{
    ok: Boolean,
    errorCode: String, // only if the check did not succeed
    validBrowsers: {} // Every key is a browser and its value is the version. Only if the check did not succeed
}
Error codes
  • BROWSER_NOT_SUPPORTED: The current browser is not supported

checkThirdPartyCookies()
Check if third party cookies are enabled in the browser

return Promise{Object}

Response object
{
    ok: Boolean  
}
Error codes
  • THIRD_PARTY_COOKIES_NOT_ENABLED: Third party cookies are not enabled

checkBrowserConnection()
Check if the browser connection is valid (the browser supports WebSockets and/or third party cookies)

return Promise{Object}

Response object
{
    ok: Boolean,
    errorCode: String, // only if the check did not succeed
    level: String // 'warning', only if WebSockets are not available and the connection is established with long polling
}
Error codes
  • USING_LONG_POLLING: The connection is established with long polling instead of WebSockets
  • INSUFFICIENT_BROWSER_CONNECTION: The connection does not meet the requirements to use HyperChat

checkDomainAccess()
Check accessibility to Inbenta domains

return Promise{Object}

Response object
{
    ok: Boolean,
    errorCode: String, // only if the check did not succeed
}
Error codes
  • SERVICE_INACCESSIBLE: The HyperChat service is inaccessible
  • SERVICE_NOT_WORKING: The HyperChat service is not working correctly

checkTimeSync()
Check if the user time is in sync with the internet time

return Promise{Object}

Response object
{
    ok: Boolean,
    errorCode: String, // only if the check did not succeed
    timeDifferenceWithServer: Integer // The time difference between the HyperChat server in seconds. Only if the check did not succeed
}
Error codes
  • TIME_NOT_IN_SYNC: The client time is not in sync with Hyperchat

checkPing()
Check if the user ping is OK

return Promise{Object}

Response object
{
    ok: Boolean,
    errorCode: String, // only if the check did not succeed
    ping: Integer, // The client ping in ms. Only if the check did not succeed
    maxRecommendedPing: Integer // The maximum recommended ping in ms to have a great chat experience. Only if the check did not succeed
}
Error codes
  • PING_TOO_HIGH: The client ping is higher than recommended

checkWebsockets()
Check if websockets are enabled

return Promise{Object}

Response object
{
    ok: Boolean,
    errorCode: String, // only if the check did not succeed
}
Error codes
  • WEBSOCKETS_NOT_SUPPORTED: The current browser does not support WebSockets
  • WEBSOCKETS_NOT_ENABLED: WebSockets are not enabled for HyperChat