Skip to main content
App messages are Daily’s general-purpose data channel: arbitrary JSON sent between participants, separate from audio and video. Use them for chat, emoji reactions, “raise hand,” shared cursors, or any custom signaling. useAppMessage wraps both sending and receiving in one hook.

Send and receive

useAppMessage returns a sendAppMessage function, and takes an onAppMessage callback for incoming messages:
The onAppMessage callback must be memoized with useCallback, like all Daily React event callbacks.

Addressing messages

The second argument to sendAppMessage chooses recipients:
  • '*' sends to every other participant (the default broadcast).
  • A session_id string sends to one participant only.
App messages are not delivered to the sender. If you want the sender’s own UI to reflect the message (an optimistic chat bubble, your own reaction), update local state when you call sendAppMessage, not from onAppMessage.

Replying from the handler

onAppMessage receives sendAppMessage as its second argument, so you can respond to a message without calling the hook twice or threading the function through closures:

Patterns

Use a type field to multiplex different kinds of messages over the one channel:
App messages are for transient signaling, not durable state, and have a per-message size limit. Do not send large blobs (images, files); send a URL instead. For persisting shared call state, see useMeetingSessionState.

Next steps

Handling events

The event model behind the callbacks.

sendAppMessage reference

The underlying daily-js method and limits.