Web Chat Widget
Web Chat Widget
Section titled “Web Chat Widget”Embed DeskFork live chat on any website. The widget connects directly to your DeskFork inbox via WebSocket for real-time messaging.
Installation
Section titled “Installation”Add the widget script to your site’s <head> or before </body>:
<script src="https://widget.deskfork.com/v1/loader.js" data-inbox="YOUR_INBOX_TOKEN" data-workspace="YOUR_WORKSPACE_SLUG" async></script>Get your INBOX_TOKEN from Settings → Inboxes → [inbox] → Widget.
Spam protection (Turnstile)
Section titled “Spam protection (Turnstile)”The widget uses Cloudflare Turnstile on the visitor’s first message to prevent bot spam. No CAPTCHA is shown to real users — Turnstile runs invisibly in most browsers.
To disable Turnstile (not recommended for public sites):
<script data-inbox="..." data-workspace="..." data-turnstile="false" ...></script>Pre-filling visitor identity
Section titled “Pre-filling visitor identity”If the visitor is logged in to your site, you can pass their identity so DeskFork can link the conversation to a contact record:
<script> window.DeskFork = { visitor: { email: "customer@deskfork.com", name: "Jane Doe", externalId: "cust_12345" } };</script><script src="https://widget.deskfork.com/v1/loader.js" ...></script>Widget customisation
Section titled “Widget customisation”Configure widget appearance under Settings → Inboxes → [inbox] → Widget → Appearance:
| Option | Description |
|---|---|
| Accent colour | Primary colour (hex) |
| Launcher position | Bottom-right (default) or bottom-left |
| Welcome message | Text shown on the welcome screen |
| Offline message | Shown when no agents are available |
| Team name | Displayed in the widget header |
Anonymous visitors
Section titled “Anonymous visitors”Visitors who do not provide an email are tracked with a session token stored in localStorage. They can check their ticket status at https://status.deskfork.com/t/{tracking-token}.
Events API
Section titled “Events API”// Open the widget programmaticallywindow.DeskFork.open();
// Close the widgetwindow.DeskFork.close();
// Listen for new messageswindow.DeskFork.on("message", (msg) => { console.log("New message:", msg);});