Returns the current chat availability for an organization
If your organization has Business Schedules or Holidays enabled, the
Kustomer.isChatAvailable() method will return the availability based on those dates and times.
First, initialize chat fully
Kustomer Chat must finish initializing fully with
Kustomer.start()before you can execute any additional Web SDK methods.
Tip: Call other methods inside the callback of
Kustomer.start()to ensure Kustomer Chat always completes initialization before the code tries to run other methods.
To learn more, see Troubleshooting: Kustomer method calls won't execute.
We're provided some examples of how you can call
const response = Kustomer.isChatAvailable(); const availability = response.availability;
The response is an object containing the following properties:
|availability||String||The current availability for the organization. Can be one of the following:|
|Disabled||Chat is disabled in Chat settings. Chat will not display by default.|
|Offline||Chat is enabled in Chat settings and the current date and time are outside of business hours. You have set your chat widget to appear offline when outside of business hours.|
|Online||Chat is enabled in Chat settings and the date and time are currently within business hours.|
|Hidden||Chat is enabled in Chat settings and the current date and time are outside of business hours. You have set your chat widget to be hidden when outside of business hours.|
|None||Chat is enabled in Chat settings and the current date and time are outside of business hours. You have set your chat widget to appear available when outside of business hours.|
Updated about 2 years ago