Presence
Presence is NodalMerge’s ephemeral awareness channel. Use it for live collaboration context (who is here, where their cursor is, what they are doing now), not durable business data.What presence is for
Good presence payloads:- Cursor or caret location
- Active selection/viewport
- Typing indicator
- Temporary user status
What presence is not for
Do not use presence for:- Durable domain records
- Audit-critical actions
- Canonical product truth
Basic usage
set(...) calls merge into your local presence state and rebroadcast.
Presence subscriptions
Lifecycle behavior
Presence has heartbeat and staleness semantics:- Heartbeats refresh peer liveness
- Silent peers age out as stale
- Disconnect clears ephemeral participation view
Tuning knobs
SDK options allow heartbeat/stale timing configuration:presenceHeartbeatMspresenceStaleMs
Clear and leave semantics
Presence can be explicitly cleared to stop broadcasting local ephemeral state. Consumers should handle leave reasons and avoid assuming all leaves are hard disconnects.React/UI patterns
Recommended UI pattern:- Keep durable model in room state
- Layer presence view over durable state in rendering
- Degrade gracefully when presence events lag or drop
Privacy and data minimization
Presence payloads should be minimal and non-sensitive. Avoid sending:- Secrets/tokens
- High-volume raw telemetry
- Sensitive personal data
Common mistakes
- Persisting business logic state in presence
- Ignoring presence cleanup/unsubscribe in component lifecycle
- Overloading presence with large payloads
- Assuming presence guarantees delivery/history