← Free Tools / WebChat Widget

WebChat Widget

Open Source

Drop-in chat widget for your website. One script tag, zero dependencies, connects to your Sanctuary Gateway. Your members can reach you without installing anything.

Live Preview

Sanctuary
Online — usually replies instantly
Powered by Sanctuary

Floating bubble (bottom-right of your site)

Customize

Show "Powered by Sanctuary"
Sound on new message
Ask for name before chat

Your Embed Code

Paste this before </body> on any page. The widget loads asynchronously — zero impact on page speed.

HTML
~4 KB gzipped
0 dependencies
Works on all modern browsers
Mobile responsive

Self-Host the Widget

Want full control? Copy the standalone script file to your own server. No CDN dependency, no external calls.

sanctuary-chat.js

WebSocket Protocol

The widget speaks a simple JSON protocol with the Sanctuary Gateway. Build your own client in any language.

Server → Client

On connect:

{ "type": "connected", "sessionId": "abc123" }

Reply message:

{
  "type": "message",
  "text": "Welcome! How can we help?",
  "gatewayId": "xyz789",
  "timestamp": "2026-01-30T12:00:00Z"
}

Client → Server

Set display name:

{ "type": "set_name", "displayName": "Jane" }

Send message:

{ "type": "message", "text": "MENU" }

Need the full platform?

WebChat is just one channel. Sanctuary connects Telegram, WhatsApp, Discord, Signal, and Matrix — all through one gateway, one dashboard, one system.