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:

Key

Type

Description

availability

String

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

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

availability types

Availability

Description

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.


Did this page help you?