Kustomer.isChatAvailable()

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.

Examples

We're provided some examples of how you can call Kustomer.isChatAvailable():

const response = Kustomer.isChatAvailable();
const availability = response.availability;

Syntax

Kustomer.isChatAvailable();

response

The response is an object containing the following properties:

KeyTypeDescription
availabilityStringThe current availability for the organization. Can be one of the following:

['disabled', 'offline', 'online', 'hidden', 'none']

availability types

AvailabilityDescription
DisabledChat is disabled in Chat settings. Chat will not display by default.
OfflineChat 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.
OnlineChat is enabled in Chat settings and the date and time are currently within business hours.
HiddenChat 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.
NoneChat 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.