Home / Companies / Daily / Blog / Post Details
Content Deep Dive

Use Next API routes and Daily to create video chat rooms dynamically

Blog post from Daily

Post Details
Company
Date Published
Author
Kimberlee Johnson
Word Count
1,119
Language
English
Hacker News Points
-
Summary

The new documentation site for a company has been built using Next.js and includes an embedded demo of their video chat feature, Daily. The demo allows users to quickly test out Daily calls and get a sense of what it would be like to embed the feature in their own app. To set up the demo, one needs a Daily account and can follow instructions on how to create a new repository locally and install dependencies. The demo uses Next API routes to create Daily rooms dynamically server-side, and includes a button that creates a room and starts a call when clicked. A callframe is created using a useEffect hook, which joins the room and listens for the 'left-meeting' event to reset app state when the local participant leaves the call. The demo also includes an input field that allows users to enter a room URL to join an existing room, and a "Join room" button that calls a function to set the room value in local state.