Skip to main content
Ansa uses WebSocket connections (via Socket.IO) to provide real-time features like typing indicators, agent presence, and instant message delivery.

Features

How It Works

The widget automatically establishes a WebSocket connection when opened. The connection handles:
  1. Bi-directional typing indicators between users and dashboard agents
  2. Real-time message delivery for human agent responses
  3. Presence updates when agents join or leave conversations
  4. Automatic reconnection with message history replay

Events

Client → Server

Server → Client

Rate Limiting

To prevent abuse, WebSocket events are rate-limited: When rate limits are exceeded, a rate-limit-exceeded event is sent:

Custom Integration

If you’re building a custom chat interface, you can connect directly to the WebSocket:

Connection States

The widget handles connection management automatically, including:
  • Exponential backoff for reconnection attempts
  • Message queuing during disconnection
  • Automatic replay of missed messages

Dashboard Integration

Human agents in the dashboard see:
  • User typing indicators — When customers are typing
  • Connection status — Whether the user is online
  • Read receipts — When messages are delivered

Next Steps

Widget API

Control widget programmatically

Webhooks

Server-side event notifications