daily-examples/dailyjs/text-chat
Jon 211beeba2f removed asset symlink to fix Vercel builds 2021-09-06 15:07:56 +01:00
..
components added RoomContainer abstraction 2021-07-20 14:00:05 +01:00
contexts added notification sound 2021-06-23 16:23:44 +01:00
hooks initial commit 2021-07-19 12:30:11 +01:00
pages added default props util 2021-07-06 12:04:28 +01:00
public/assets removed asset symlink to fix Vercel builds 2021-09-06 15:07:56 +01:00
.babelrc initial commit 2021-06-21 15:19:43 +01:00
README.md further improvements to README 2021-06-23 18:02:25 +01:00
env.example missing env.example 2021-07-13 21:14:52 +01:00
image.png attempt to fix symlink 2021-06-23 17:27:13 +01:00
index.js added RoomContainer abstraction 2021-07-20 14:00:05 +01:00
next.config.js initial commit 2021-06-21 15:19:43 +01:00
package.json lint package command 2021-06-30 11:13:57 +01:00

README.md

Text Chat

Text Chat

Live example

See it in action here ➡️


What does this demo do?

  • Use sendAppMessage to send messages
  • Listen for incoming messages using the call object app-message event
  • Extend the basic call demo with a chat provider and aside
  • Show a notification bubble on chat tray button when a new message is received
  • Demonstrate how to play a sound whenever a message is received

Please note: this demo is not currently mobile optimised

Getting started

# set both DAILY_API_KEY and DAILY_DOMAIN
mv env.example .env.local

yarn
yarn workspace @dailyjs/text-chat dev

How does this example work?

In this example we extend the basic call demo with the ability to send chat messages.

We pass a custom tray object, a custom app object (wrapping the original in a new ChatProvider) as well as add our ChatAside panel. We also symlink both the public and pages/api folders from the basic call.

In a real world use case you would likely want to implement serverside logic so that participants joining a call can retrieve previously sent messages. This round trip could be done inside of the Chat context.

Deploy your own on Vercel

Deploy with Vercel