Skip to content

Web Chat Widget

Embed DeskFork live chat on any website. The widget connects directly to your DeskFork inbox via WebSocket for real-time messaging.

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.

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>

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>

Configure widget appearance under Settings → Inboxes → [inbox] → Widget → Appearance:

OptionDescription
Accent colourPrimary colour (hex)
Launcher positionBottom-right (default) or bottom-left
Welcome messageText shown on the welcome screen
Offline messageShown when no agents are available
Team nameDisplayed in the widget header

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}.

// Open the widget programmatically
window.DeskFork.open();
// Close the widget
window.DeskFork.close();
// Listen for new messages
window.DeskFork.on("message", (msg) => {
console.log("New message:", msg);
});