Skip to content

Developer docs

Website chat widget

A chat bubble for your website, powered by your agent. One line of HTML, nothing to install, and no secret in the visitor’s browser.

Add it to your site

In the dashboard open Widget, list the websites allowed to show it and save. You get a ready-made snippet; paste it before the closing </body> tag of every page that should show the chat.

HTML
Embed snippet (HTML)<script src="https://api.safecoin.online/widget.js" data-widget-id="wid_your_widget_id" async></script>

Use the exact snippet from your dashboard; it contains your own widget id.

How it works

  • A small launcher button opens a full-screen panel on phones and a corner panel on desktop. It runs in a sealed container, so your page’s styles can’t break it and it can’t break your page.
  • Replies stream in as they are written. When the agent hands the visitor over to a person, a notice appears.
  • If the service is unavailable, no button is shown, so visitors never see a broken chat.

Security

The widget id is public, and that is fine

It only says whose chat to open. It cannot be used to read your data or to act on your account.
  • Allowed websites only. The widget works only on the websites you list (https, except localhost for testing). On any other site it is refused with origin_not_allowed.
  • Short-lived visitor tokens. Each visitor gets a temporary token tied to your website. It is not a cookie and never an API key.
  • Public information only. Visitors can reach only the read-only tools you marked public. Tools that change things are never available to widget visitors. Order details appear only after the visitor proves the order number and email match.
  • Cost limits. You set the maximum message length and a daily message cap, and there are per-visitor and per-network limits. Your plan’s message allowance still applies.
  • Optional bot check. You can require a challenge before a chat starts.

If it doesn’t show

  • The page’s address is not on the allowed list. Add it exactly, including https:// and www. if you use it.
  • The agent is paused or out of messages. Visitors see a neutral “chat is unavailable” message (chat_unavailable), never your billing details.
  • Your daily widget cap was reached (widget_cap_reached). It resets on a rolling 24-hour basis.