Send Data

The sendData method allows the Local Peer to send data messages to other peers in the room. It is limited to 280 characters per message.

Parameters

NameTypeDescription
tostring[] or ""An array of peer IDs or "" for all peers.
payloadstringThe data message to send (limited to 280 characters).

Events

NameDescriptionReturns
data-messageTriggered when a data message is received.{ peerId: string; label: string; message: string }
receive-dataTriggered when data is received.TDataMessage

Example

// Send a message to specific peers
huddleClient.localPeer.sendData({ to: ["peerID1", "peerID2"], payload: "Hello, everyone!" });
 
// Sending message to all peers
huddleClient.localPeer.sendData({ to: "*", payload: "Hello, everyone!" });
Audio/Video Infrastructure designed for the developers to empower them ship simple yet powerful Audio/Video Apps.
support
company
Copyright © 2022 Graphene 01, Inc. All Rights Reserved.