Broadcast Messages Between Client Apps

JavaScript web application demonstrating how-to use CommandService to broadcast information to other clients in a conference such as a dynamic position on screen.


Coordinating position on screen across clients


Users can use arrow keys to move their avatar around the screen. Position of avatar is communicated to other users in real time utilizing Communications API's CommandService.

Features Tech Stack
  • JavaScript

Getting Started

Key concepts

To send a command to all participants in a session, call the send() method of the Command object.

  .send({payload: 'hello world'})
  .catch((err) => {

To receive commands send in a session, add an event listener for the 'received' event dispatched by the Command object.

VoxeetSDK.command.on('received', (participant, message) => {
  const dataParsed = JSON.parse(message);
  console.log("Command received, message:", dataParsed.payload)


Initial State

Messages sent with the CommandService are non-durable and not persistent meaning that inactive participants who have not yet joined the conference will not receive messages sent prior to joining the session.



Related Content

What’s Next