Skip to main content
Import OfflineProtocol from @offline-protocol/mesh-sdk. These signatures match v0.27.0. Read the integration guide for prerequisites and complete usage.

Methods on this page

meshCreateGroup

Creates a new MLS group with full protocol integration. Emits GroupCreated event. Use inviteToGroup() to add members. returns: Group info

meshInviteToGroup

Invites a user to an MLS group. Sends MLS Welcome to invitee and Commit to existing members. Emits GroupMemberAdded event on all participants.

meshSendGroupMessage

Sends an MLS-encrypted message to all group members via mesh transport. Handles encryption and fan-out to each member automatically. returns: Array of per-member message IDs

meshForwardMessageToGroup

Forwards a message to all members of a group with forwarding attribution. The message content is encrypted via MLS for the group and fan-out follows the same path as regular group messages. returns: Array of per-member message IDs

meshRemoveFromGroup

Removes a member from an MLS group. Sends removal notification to all members.

meshLeaveGroup

Leaves an MLS group with notification to other members.

meshListGroups

Lists all MLS groups (excluding 1:1 sessions). returns: Array of group IDs

meshGetGroupInfo

Gets information about an MLS group. returns: Group info or null if not found

meshGroupRichReadiness

Whether a rich group send right now would seal its extras, and which members hold the gate closed. Point-in-time and advisory: the send path re-evaluates the gate itself: use this to warn before sending instead of learning from a GroupRichExtrasDropped event after the drop. returns: Readiness snapshot ({ ready, unknownMembers })

groupRelaySyncState

The relay-side registration state of a group. Point-in-time: transitions arrive as group_relay_sync_changed events. 'synced' means the relay positively acknowledged the group’s registration on the current connection: relay-dependent server commands for it (CreateGroupInviteLink & co. via sendRawServerCommand) can be issued. 'pending' means a registration is in flight; 'unsynced' means none is (Internet down, relay grouping disabled, or a prior attempt errored / timed out).

requestGroupRelayRegistration

Registers (or re-registers) a group with the relay server on demand: the supported path for making a mesh-created group known to the relay before issuing relay-dependent server commands for it. Never raw-send CreateGroup: it desyncs the SDK’s registration tracking. Fire-and-event: the outcome arrives as group_relay_sync_changed (ensureGroupRegistered wraps the wait). Resolves true when the registration frame was queued (or the group is already synced), false when relay grouping is disabled or the Internet transport is unavailable; rejects when the group is unknown locally.

ensureGroupRegistered

Resolves once the relay holds a positively acknowledged registration for the group: the gate to await before CreateGroupInviteLink and other relay-dependent raw server commands for a mesh-created group. Resolves immediately when the group is already synced; otherwise kicks a registration (when none is in flight) and waits for the group_relay_sync_changed outcome. Rejects on a negative outcome (reason: 'error' | 'ack_timeout' | …), when the registration cannot be sent (Internet down / relay grouping disabled / unknown group), or on timeout. The SDK re-sends an unanswered registration every 30s up to 3 attempts before giving up with ack_timeout (~90s worst case): the default timeout covers that full cycle. A shorter timeout is fine for UI purposes: the SDK keeps retrying in the background and a later group_relay_sync_changed still fires on success.

meshSetMemberRole

Sets a member’s role in an MLS group (admin only). Broadcasts role change to all group members.

meshGetMemberRole

Gets a member’s role in an MLS group. returns: Role string (“admin” or “member”)

meshGetGroupRoles

Gets all member roles in an MLS group. returns: Map of user_id -> role

meshRenameGroup

Renames an MLS group (admin only). Broadcasts the rename to all group members. throws: Error if not admin or group not found

Parameter and result types

Import these types from the same SDK package. Event payloads and configuration types are linked below.

MlsGroupInfo

ForwardMessageToGroupParams

MessagePriority

GroupRichReadiness

RelaySyncState