Support chat

A small chat box on a customer's website whose conversations land in Kantoor. A visitor asks a question without an account; your team answers from the Support inbox, and the answer reaches the visitor's open panel within a couple of seconds. When nobody is there, the visitor can still leave the question and see it here.

It is not a bot and not a replacement for WhatsApp. It is the "ask before you buy / about my booking / about my order" box, with a written record.

What is in this release

  • One embeddable widget per site (one script tag), served from Kantoor.
  • The Support inbox: open / waiting on us / waiting on visitor / closed, one conversation with the visitor's name (if given), page, language and consent, replies, internal notes, assignment to an agent, and closing.
  • Balie can turn the widget on per site (see Balie's own guide); any other site pastes the snippet.
  • A site's allowed origins, so a copied key does not work elsewhere.
  • Honeypot, per-address and per-site rate limits, and a visitor token that is stored only as a hash.
  • English, Dutch, Papiamentu and Spanish widget copy; the site owner's greeting is per language.

Not yet in this release (planned, not promised): file uploads from visitors, the e-mail fallback and transcripts, a WebSocket (the panel polls every two seconds while open), editing opening hours from the screen, canned replies and tags, and the Kantoor phone notification. Opening hours are read from the site's business_hours when an operator or the API sets them, and the retention period is recorded but not yet enforced by a deletion job.

Who may read

A support agent of the organization's mail domain. The role lives in chat_support_agents and grants the support inbox only: not a mailbox, not administration. An agent replies and claims; a lead also changes the site settings and the team.

A Kantoor administrator is not an agent by being an administrator. Support conversations hold what customers said; administration is not consent to read it. An administrator can make themself a lead through Support → Support settings → Team (the same form works for any person with a mailbox in the domain).

Setting it up

  1. Sign in and open Support → Support settings.

  2. Add each person who answers to Team (their e-mail must be a mailbox in this organization).

  3. Create a site, open it, and add its address under Origins — the exact scheme and host, for example https://petals.boneiru.online.

  4. Copy the snippet into the site's page, before </body>:

    <script src="https://kantoor.shilohbv.com/widget/v1/widget.js"
            data-key="wk_live_XXXXXXXX" defer></script>

    On a site with a Content Security Policy, allow Kantoor:

    script-src 'self' https://kantoor.shilohbv.com;
    style-src  'self' https://kantoor.shilohbv.com;
    frame-src  https://kantoor.shilohbv.com;

    Balie adds the tag and the policy itself; its owner only ticks the switch.

The key is public (it is in the snippet). The origin list is the lock: a request from another origin is refused, and the frame may only be embedded on the listed origins. New key rotates it: every snippet with the old key stops and every open visitor link is invalidated. Conversations stay.

How a conversation flows

  1. The visitor writes the first message and accepts the privacy notice.
  2. A chat room of kind support is made in the organization's domain, with the first message, the page they wrote from (query string stripped), the language and the consent time. No Kantoor user is made for the visitor.
  3. The Support list shows it as Waiting on us. A push (when the phone notifications are on) and the live list tell the team.
  4. A reply moves it to Waiting on visitor. The visitor's panel polls and shows it; an internal note is staff-only and never reaches the visitor.
  5. Close ends it. The visitor's token stops working. The site carries a retention_days (365 by default); automatic deletion at the end of it is not in this release yet.

The public interface

Under /widget/v1, no session and no cookie:

MethodPathPurpose
GET/widget.jsthe loader (about 4 KB, no dependencies)
GET/widget.cssthe launcher and panel
GET/frame?key=the iframe document
GET/config?key=brand, copy, languages, hours
POST/conversationsstart with the first message
GET/conversations/:id?after=visitor-visible messages after a seq
POST/conversations/:id/messagesa visitor message
POST/conversations/:id/closethe visitor closes
GET/conversations/:id/events?after=long-poll fallback

The visitor's token (Authorization: Bearer ...) is scoped to one conversation and one site and can read only visibility = "public" messages. It lapses after 30 days without a visitor message and on key rotation.

For Balie and other provisioning systems

The same operator key as /api/v1/provisioning manages the sites under /api/v1/widget_sites: list, create (with domain naming the mail domain and allowed_origins), patch, rotate, delete, and PUT/DELETE .../agents/:email. A key sees only the sites of the domains it provisioned. Every answer carries the snippet; POST .../rotate_key returns the site with its new key.

Privacy

The visitor's e-mail is encrypted with KANTOOR_VAULT_KEY; the IP is kept only as a hash whose salt changes daily; page URLs lose their query string; message texts and tokens are never logged. The site owner is the controller, Shiloh (as Kantoor's operator) the processor. The widget sets no cookies: the browser keeps the visitor token and the language in localStorage.