daily-examples/custom/text-chat
harshithpabbati 015457a913 import the livestreaming and recording contexts and hooks 2022-01-27 14:36:28 +05:30
..
components import the livestreaming and recording contexts and hooks 2022-01-27 14:36:28 +05:30
contexts use shared state hook to get the chat history for the newly joined users 2021-11-17 15:15:13 +05:30
hooks renamed daily-js to custom 2021-09-23 17:22:47 +01:00
pages updated each demo 2021-09-29 13:50:50 +01:00
public Updated broader README and moved Header to shared component 2021-10-05 10:04:06 -07:00
.babelrc renamed daily-js to custom 2021-09-23 17:22:47 +01:00
README.md use shared state hook to get the chat history for the newly joined users 2021-11-17 15:15:13 +05:30
env.example renamed daily-js to custom 2021-09-23 17:22:47 +01:00
image.png renamed daily-js to custom 2021-09-23 17:22:47 +01:00
index.js renamed daily-js to custom 2021-09-23 17:22:47 +01:00
next.config.js renamed daily-js to custom 2021-09-23 17:22:47 +01:00
package.json renamed daily-js to custom 2021-09-23 17:22:47 +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
  • Using the useSharedState hook to get the chat history, for the new participants.
  • 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 @custom/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.

We use the useSharedState hook to retrieve the previously sent messages for the newly joined participants.

Deploy your own on Vercel

Deploy with Vercel