Skip to content

daily-demos/app-message

Daily App Message demo

This is a demo showing various ways to send data to video call participants with Daily's "app-message" events.

Demo screenshot description

Prerequisites

How the demo works

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 a sendAppMessage() 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.

Running locally

  1. git clone [email protected]:daily-demos/app-message.git
  2. cd app-message
  3. Copy example.env into a file called .env
  4. Paste your Daily API key into the DAILY_API_KEY variable in the .env file. Do not commit this file to source control!
  5. npm i && npm run dev

Example use cases for "app-message" events

Contributing and feedback

Let us know how experimenting with this demo goes! Feel free to reach out to us any time at [email protected].

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published