This is a demo showing various ways to send data to video call participants with Daily's "app-message"
events.
The demo allows you to either join an existing Daily room or create a new one at runtime. It then joins a video call using an embedded Daily Prebuilt iframe. Two custom controls are added to the right of the frame: one to broadcast an "app-message"
event from the client, and one to do the same from the server.
- The client-side broadcasting of an
"app-message"
event is done using asendAppMessage()
Daily instance method. - The server-side broadcasting of an
"app-message"
event is done using a POST request to Daily's/rooms/:name/send-app-message
REST API endpoint.
The server-side POST request is instrumented through a Netlify function, but the logic of the request would be the same with other stateless functions (like AWS Lambda) or a more traditional server implementation.
git clone [email protected]:daily-demos/app-message.git
cd app-message
- Copy
example.env
into a file called.env
- Paste your Daily API key into the
DAILY_API_KEY
variable in the.env
file. Do not commit this file to source control! npm i && npm run dev
- Adding chat to your custom video app
- Implementing cursor sharing alongside a video call
- Adding spatialization features to your video application
Let us know how experimenting with this demo goes! Feel free to reach out to us any time at [email protected]
.