Presence Detection

Real-Time Presence

Know who is online, who is typing, who just left. Built on MQTT's native presence capabilities.

Presence Without the Plumbing

MQTT was designed for presence from day one. Last Will messages, retained state, and QoS delivery make it the ideal protocol.

Online/Offline Detection

Know instantly when users connect or disconnect. Retained messages store last-known state for late joiners.

Typing Indicators

Lightweight typing events over dedicated topics. Sub-100ms delivery for responsive chat experiences.

Last Will & Testament

MQTT's native LWT feature automatically publishes an offline message when a client disconnects unexpectedly.

Automatic Cleanup

Session tracking with automatic state cleanup. No stale presence data, no ghost users in your UI.

Last Will & Testament

Automatic Disconnect Detection

Set an online status on connect and a Last Will message for disconnect. The broker handles the rest β€” even if the client crashes or loses network.

Retained State
Presence messages are retained so new subscribers get current state immediately
QoS 1 Delivery
At-least-once delivery guarantees no missed presence updates
Topic-Based Channels
Organize presence by room, team, or application with topic hierarchies
Delivery Metrics
Track presence delivery rates and session durations in the dashboard
presence.js
// Publish presence on connect
client.publish('presence/alice',
JSON.stringify({
status: 'online',
timestamp: Date.now()
}), { retain: true, qos: 1 }
)
// Set last will for disconnect
client.connect({
will: {
topic: 'presence/alice',
payload: '{"status":"offline"}',
retain: true, qos: 1
}
})

Start Building with Presence

Add real-time presence to your app with MQTT topics and retained messages. Free tier included.