Skip to main content
One script tag adds the chat to a page. It loads after your page, shows the chat button, and puts DeskHoot on window for your own code.
Your install code
Paste it before </body> on every page.

Attributes

string
required
https
The address of DeskHoot’s script: https://widget.deskhoot.com/widget/v1.js.
string
required
prefix: prj_
Your public project ID, shown on your Install page. It only works on the websites you allow, so it is safe to publish.
string
a-z 0-9 -
len ≤ 40
The Install ID of the widget to show, such as billing. Leave it out to show your default widget.
string
default:"default"
A-Z a-z 0-9 _ -
len ≤ 64
A name for this chat, for pages that load more than one. The chat named default is window.DeskHoot; reach any other with DeskHootClients.get(name).

React and single-page apps

Add the script once, in your root component. The chat stays in place as your routes change.
App.jsx

Call DeskHoot before it loads

The script is async, so DeskHoot may not exist yet when your code runs. Make it a queue first: each entry is a method name followed by its arguments. DeskHoot runs the queued calls, up to 100, in order as soon as it loads.

Allowed websites

The chat only works on websites you allow, so nobody can put your chat on their own site. On any other website the button shows in a plain default look, and opening it says “Chat is unavailable.” Add each address under Install, in Allow your websites.
  • An address is the scheme and host, such as https://www.example.com. https://example.com is a different website.
  • Public websites must use https://.
  • http:// is accepted only for localhost and 127.0.0.1, such as http://localhost:3000. LAN addresses are refused.
  • A different port is a different website. Paths are ignored, and there are no wildcards.
  • A widget allows up to 20 websites.

What it loads

The script stores one flag in your site’s localStorage, to remember that the visitor has chatted. Everything else, including the session cookie, is stored on DeskHoot’s own address. Having the script on a page twice still gives one chat.

Content Security Policy

If your website sends a Content Security Policy, allow DeskHoot in these four directives. No unsafe-inline and no img-src entry are needed.

A second widget

Every widget has its own code on its Install page. A widget that is not your default one carries its Install ID in data-inbox. An ID that matches no widget does not fall back to your default: the chat says “This support widget is unavailable.” To show two widgets on one page, give each script its own data-client name.

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.

Methods

What DeskHoot can do.