Skip to main content
sendAppMessage(data, recipient?) Sends a message to other participants during the call. Messages are delivered only to participants currently in the call — they are not stored or replayed for late joiners. Broadcast messages are not delivered to the sender.

Parameters

data
object
required
A JSON-serializable object. Must be within the 4KB size limit.
recipient
string | string[]
Who should receive the message. Pass a participant session_id, an array of session_ids, or '*' to broadcast to everyone. Defaults to '*'.Note: use session_id, not user_id.

Return value

Returns this for chaining.

Example

// Broadcast to everyone
call.sendAppMessage({ type: 'reaction', emoji: '👋' });

// Send to a specific participant
call.sendAppMessage({ type: 'dm', text: 'Hey!' }, participantSessionId);

// Send to a set of participants
call.sendAppMessage({ type: 'alert' }, [id1, id2]);

See also

Events