DeskHoot on window for your own code.
Your install code
</body> on every page.
Attributes
Your public project ID, shown on your Install page. It only works on the websites you allow, so it is safe to publish.
The Install ID of the widget to show, such as
billing. Leave it out to show your default widget.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 isasync, 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.comis a different website. - Public websites must use
https://. http://is accepted only forlocalhostand127.0.0.1, such ashttp://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. Nounsafe-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 indata-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.
Related
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.