Events Reference
Register listeners withprotocol.on(eventType, listener). See
Event Listeners for the full listener API.
Field naming. Every event payload field is snake_case, matching the native event JSON.
The only exceptions are type and the optional seenAt, a local timestamp in milliseconds
recorded when the JS bridge observed the event.
Types. ProtocolEvent is the discriminated union of every event; EventType is
ProtocolEvent['type'].
Message Events
message_sent
message_received
encrypted is false only for plaintext accepted under the requireEncryption: false
opt-out.
message_delivered
Terminal success: the recipient ACKed.message_failed
Terminal failure. This is the only terminal failure signal for a message.message_retrying
Non-terminal: a retry has been scheduled after a failed attempt.message_deferred
The message was queued because no transport was available. Not a failure.reason is a stable classification from a fixed local vocabulary, not a rendered error string.
message_undeliverable
A transport reported the recipient unreachable for an in-flight message.message_relayed
This node forwarded a message on behalf of another peer.message_decryption_failed
Identity Events
identity_ready
Fires once per successful startup, before any message can be sent.profile. Also readable with localAddress(). See
Identity & Addressing.
Connection Request Events
connection_request_received
sender_name and initial_message arrived in plaintext, because connection requests
precede the MLS session.
connection_request_undeliverable
A status signal, not proof of permanent failure. The original request may still be delivered
by the retry machinery, so a user-initiated resend can duplicate on the recipient’s side.
connection_accepted
connection_rejected
connection_request_cancelled
Network Events
neighbor_discovered
peer_id is the value that peer derived from its own identity key. Use it directly as
recipient, regardless of which transport discovered the peer.
neighbor_lost
transport_switched
network_metrics
Internet Transport Events
internet_status_changed
authenticated: true is the positive gate for sendRawServerCommand. The
connected: true, authenticated: false window is where the socket is up but the relay has not
yet accepted the auth token. Emitted only on actual transitions, so query the current value with
isInternetReady().
internet_session_superseded
The relay displaced this device’s connection: a newer registration for the same identity took the relay slot.internet_server_message
A raw relay frame your app needs outside or in addition to the SDK’s own processing.GroupInviteLinkCreated, GroupJoinedViaInvite,
GroupInviteJoinPending), GroupRoleChanged, GroupDeleted, RateLimited, and any future
relay message types. GroupError, GroupInfo, and UserGroups are dual-emitted here in
addition to their typed events. Apply state from one channel, not both, as there is no
cross-channel ordering guarantee.
mesh_stopped_by_user
Android only. The user stopped the mesh from the foreground-service notification’s Stop action rather than throughstop().
start().
Security Events
secure_session_established
secure_session_failed
security_warning
Welcome delivery events
welcome_send_succeeded followed by welcome_send_failed for the same Welcome is a legal
sequence over the internet transport: the bridge confirms on socket write, but the relay
stores nothing for offline recipients, so its later delivery error corrects the earlier
success. Treat these as state, not a terminal verdict. A PEER_UNREACHABLE failure always
carries next_retry_at.convergence_diag
A receiver-side breadcrumb for the Welcome receive/adopt/confirm path. Carries no protocol effect.Group Events
group_created
group_message_received
group_message_sent
group_message_partial_failure
group_message_delivery_report
The relay’s settled per-recipient report for a relay-broadcast group message, emitted after the SDK has already acted on it.This is observability, not a failure signal.
missed_reissued members were already re-sent.
It fires once per broadcast whose report arrived, seconds after group_message_sent, so
correlate by message_id, never by order.group_member_added / group_member_removed
group_unauthorized_membership_change
group_info
internet_server_message. Use the raw event for app-owned fields such as
descriptions, avatars, and pending join requests, but do not apply state from both.
user_groups
group_role_changed
group_renamed
meshRenameGroup. Renames observed only as
relay-native frames surface through internet_server_message instead.
group_relay_sync_changed
synced: true fires only on the relay’s positive registration ack. Await it with
ensureGroupRegistered().
group_rich_extras_dropped
unknown_members is empty when the local richPayloadEnabled kill switch caused the drop
instead. Use meshGroupRichReadiness() to warn before sending.
group_epoch_fork_detected / group_epoch_fork_resolved
Concurrent MLS commits caused members to diverge. The deterministic leader attempts automatic resolution.group_error
reason is a fixed code minted locally, not the relay’s wording. Do not parse it as prose
or show it to users as-is. Apps needing the exact wording (invite-link flows correlating by
request ID) should read the raw GroupError frame from internet_server_message.File & Media Events
file_progress
file_received
file_receive_failed
Terminal, at most once per transfer. Nofile_received will follow for this file_id;
the sender must re-send under a fresh one.
media_sent
All chunks were ACK-delivered.media_send_failed
The outbound transfer aborted before all chunks were delivered. Nomedia_sent will follow.
media_resend_required
An outbound media transfer was in flight when the previous process died.sendMedia with this file_id. They are checksum-validated against the
original transfer.
Presence & Typing Events
presence_updated
internet is relay-observed presence: an authoritative
CheckPresence answer or relay-derived reachability. peer is a peer-sent self-report.
Apps rendering relay-style presence UI should filter on internet.
Emission is 1:1 with the underlying signal. The SDK never dedupes unchanged statuses, so
every relay answer re-emits this event even when nothing changed.
last_seen_ms is present only for relay-sourced presence, and only when the relay knows it.
typing_indicator_received
read_receipt_received
Relay Role Events
relay_promoted
relay_demoted
relay_demoted_battery
Blocking Events
Emitted for local UI notification only.Service Discovery Events
service_discovered
service_request_received
service_response_received
DORS Events
phase: 'TRIGGERED' is a recommendation; 'APPLIED' means the fallback succeeded.
Resource Pressure Events
ack_evicted
fragment_assembly_evicted
Diagnostic Events
diagnostic
Next: Types & Internals
Type definitions, DORS scoring, mesh architecture, and troubleshooting.