Deskbell

The widget

What the Deskbell widget is, the four ways to put it on a page, what can be configured from where, and the pages in this section that cover each part.

The widget is the part of Deskbell your visitors see: a launcher, a panel that streams answers with their sources, thumbs for feedback, and the visitor's previous conversations. It is a custom element, <deskbell-widget>, rendered in a shadow root, so your page's CSS stays out of it and its CSS stays out of your page.

The widget open on a documentation page, answering a question with the pages it used listed underneath

Four ways to add it

WayForPage
One script tag with data-project-keyAny site. Mounts itself, finds your server from its own URLInstall
The element, placed by youControl over where it sits in the DOM, or inline in the pageInstall
@deskbell/widget from npmApplications that bundle their own JavaScriptInstall
@deskbell/widget-reactReact codebases; a wrapper around the same elementInstall

A UI of your own, on the same server and the same rules, is the SDK.

What is configured where

LayerSet byReaches
DashboardSettings › Appearance, no redeployEvery page the widget is on
AttributesThe embed code, per pageThat page
JavaScriptdeskbell("config", …) at runtimeThat page, until reload
CSS--deskbell-* tokens and ::part() rules on the host pageWins over all of the above
SlotsYour own markup for the launcher, header, empty state or footerReplaces the region

Options lists every option and the precedence order; Theming the tokens, parts and slots; Behaviour what each mode and content feature does; JavaScript API the commands and events.

What it does on the page

  • Asks POST /api/v1/ask and renders the streamed answer as Markdown, built as elements rather than inserted as HTML.
  • Shows the sources under each answer as pills that link to the page, or labelled as written answers.
  • Keeps the visitor's session id in localStorage so their threads are there on the next visit; with Visitor identity configured, threads follow the signed-in visitor across browsers.
  • Dispatches a deskbell:* event for everything that happens, so a tag manager can read them from window.
  • Sends one beacon per tab session when it mounts, which is how the Install page knows where the widget is live.

Size and dependencies

deskbell.js is built on Preact with nothing third-party beyond it, and the build fails above 40 KB gzipped. The npm package is an ES module with preact as its one dependency.

On this page