Skip to main content
Every method is on window.DeskHoot once the script has loaded. To call one earlier, queue it.

Loading

Promise<void>
timeout: 20 s
Loads the chat now, without opening it. Resolves when the chat is ready and rejects if it cannot load. Without this call, the chat loads the first time it opens.
void
Removes the chat from the page and stops every listener.

Showing and hiding

void
Opens the chat and moves focus into it.
void
Closes the chat and returns focus to where it was.
void
Hides the chat button, and closes the chat if it is open.
void
Shows the chat button again.
See Open and close.

Theme

Promise<{ theme }>
Sets the chat to "light", "dark" or "system".
See Light or dark.

Customers

Promise<{ identified, ignored? }>
Signs in a customer your server has signed.
Promise<{ reset: true }>
Signs the customer out and starts a fresh guest. Call it when the customer signs out of your product.
Promise<object>
Returns the IDs of the current customer and conversation session. It holds no messages.
Promise<object>
Saves details the browser reports about the customer or the current session. Your team does not see these, because a visitor can change anything their browser sends. For details your team should see, use Verify users.
See Verify users.

Events

() => void
Calls handler each time event happens. Returns a function that stops listening.
void
Removes a handler added with on(). Pass the same function.
See Events.

More than one chat

DeskHoot | undefined
Returns the chat loaded with data-client="name". Each one has all the methods above.

Open and close

Control the chat from your own code.

Verify users

Show signed-in customers to your team.

Events

Run your code when something happens.

Light or dark

Match your website’s theme.