Admin module
A chat box that is yours
The usual chat widget is somebody else's JavaScript on your page, reading everything on it, and your customers' conversations on somebody else's server. This one is a table in your database and a hundred lines of script you can read.
Open conversations, then the closed ones
Every conversation with who it is from, the first line of what they said and how many messages you have not read. Clicking the image opens a full size preview.
Off until you say otherwise
A chat box nobody is watching is worse than none at all: a visitor types, waits, and decides the company is not there. So the module ships switched off, and the site renders no chat at all until the setting says yes.
Switching it off again is the same one setting. The conversations stay where they are, and the site simply stops offering the box.
At a glance
- Default: off
- Third-party script: none
- Cookie: none
- Where it lives: your database
- States: open, closed
What a public message box has to survive
Anything a stranger can type into is something a stranger will attack. Four things stand in the way.
It is text, and stays text
Messages are put on the page as text, never as markup, so a message containing a tag is a message containing a tag — not a script running in the admin's browser.
No cookie, and no token in an address
The conversation's key lives in the visitor's own browser storage from their first message, and travels only inside the body of a request. It never appears in a URL, a log or a referrer.
Same origin only
A message is accepted only from a page on this site. Another site cannot post into your chat from a hidden form.
Limited twice
Per address and per conversation, so one bored visitor cannot fill the table, and a script cannot open a thousand conversations.
And it tells you when somebody writes
A chat message can go straight to your phone through Telegram notifications, once per conversation per ten minutes so a long exchange is one buzz and not forty. The address a visitor leaves becomes a customer profile, marked as not verified, because anyone can type anyone's.
