Skip to content

Deploy ​

Host the OmnyChat gateway so your app has a WebSocket endpoint. Docker is the usual path.

Docker ​

bash
export OMNYCHAT_JWT_SECRET="change-me-in-production"
docker compose up --build -d
URLPurpose
http://localhost:8080/healthzLiveness
http://localhost:8080/readyzReady (DB; Redis if configured)
ws://localhost:8080/v1/wsYour app connects here

Message data lives under ./data (SQLite inside the container).

Point @omnychat/client at wss://your-host/v1/ws in production.

Environment ​

VariableDefaultNotes
OMNYCHAT_HTTP_ADDR:8080Listen address
OMNYCHAT_DB_PATH./data/omnychat.dbSQLite path
OMNYCHAT_JWT_SECRET(required)HS256 secret — same one your backend uses to sign JWTs
OMNYCHAT_JWT_PUBLIC_KEYPEM RSA key; use RS256 instead of a shared secret
OMNYCHAT_JWT_ISSUEROptional iss check
OMNYCHAT_ALLOWED_ORIGINS*Comma-separated browser Origins
OMNYCHAT_MAX_FRAME_BYTES1048576Max WebSocket payload
OMNYCHAT_PING_INTERVAL_SEC30Heartbeat
OMNYCHAT_REDIS_URLe.g. redis://redis:6379/0 for more than one gateway replica
OMNYCHAT_INSTANCE_IDrandom UUIDStable id per replica
OMNYCHAT_WEBHOOK_URLPOST target for message events (push notifications, etc.)
OMNYCHAT_WEBHOOK_SECRETRequired if webhook URL set; HMAC key
OMNYCHAT_TLS_CERT_FILEOptional TLS cert on the gateway
OMNYCHAT_TLS_KEY_FILEOptional TLS key

Webhooks (optional) ​

When OMNYCHAT_WEBHOOK_URL is set, the gateway POSTs JSON after a message is created, edited, or deleted — useful for mobile push from your backend:

json
{
  "type": "message.created",
  "room_id": "…",
  "server_msg_id": "…",
  "sender_id": "…",
  "seq": 1,
  "body": "…",
  "at": 1710000000000
}

Header: X-OmnyChat-Signature: sha256=<hmac-hex> over the raw body.

Security checklist ​

  • Use a strong OMNYCHAT_JWT_SECRET (or RS256 with a public key on the gateway)
  • Terminate TLS at your reverse proxy (or set OMNYCHAT_TLS_*)
  • Restrict OMNYCHAT_ALLOWED_ORIGINS in production
  • Keep the SQLite volume private
  • POST /v1/rooms requires Authorization: Bearer <JWT>

More than one replica ​

Set OMNYCHAT_REDIS_URL so live room events fan out across gateway instances. Persistence in this release is still SQLite per volume — one writer (or shared storage you trust) until a multi-node DB option ships.

Apache License 2.0