Skip to main content
EngageFabric provides real-time updates via WebSocket connections, enabling live notifications, leaderboard updates, and multiplayer features.

How Real-Time Works

When your application tracks an event via the REST API, the event is published to Redis. The WebSocket server picks up the notification and pushes it to all connected clients in real time.

Connecting

Connect to the WebSocket server with authentication:

Subscriptions

Subscribe to different channels to receive updates:

Player Updates

Receive updates when a player’s state changes:

Leaderboard Updates

Get real-time leaderboard changes:

Lobby Updates

For multiplayer features:

Chat Messages

Real-time chat:

Event Types

Player Events

Leaderboard Events

Lobby Events

Chat Events


Sending Events

Emit events to the server:

Connection Management

Reconnection

The SDK handles reconnection automatically, but you can customize behavior:

Token Refresh

WebSocket tokens expire after 15 minutes. Implement refresh logic:

Rate Limiting

WebSocket events are rate-limited to prevent abuse: Exceeding limits triggers a warning event:

Best Practices

Unsubscribe when done

Remove subscriptions when leaving screens to reduce bandwidth.

Handle disconnections

Implement reconnection logic and re-subscribe after reconnecting.

Batch updates

Update UI in batches if receiving many events quickly.

Use heartbeats

Monitor connection health with ping/pong events.