<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Roozer Grom</title>
    <description>The latest articles on DEV Community by Roozer Grom (@roozer_grom_b659e0c7acc0c).</description>
    <link>https://dev.to/roozer_grom_b659e0c7acc0c</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2976061%2Fc0704149-9624-468e-8aac-db187478fa10.png</url>
      <title>DEV Community: Roozer Grom</title>
      <link>https://dev.to/roozer_grom_b659e0c7acc0c</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/roozer_grom_b659e0c7acc0c"/>
    <language>en</language>
    <item>
      <title>ZEGOCLOUD Whiteboard SDK: Empowering Interactive Collaboration</title>
      <dc:creator>Roozer Grom</dc:creator>
      <pubDate>Mon, 26 May 2025 21:39:40 +0000</pubDate>
      <link>https://dev.to/roozer_grom_b659e0c7acc0c/zegocloud-whiteboard-sdk-empowering-interactive-collaboration-2nck</link>
      <guid>https://dev.to/roozer_grom_b659e0c7acc0c/zegocloud-whiteboard-sdk-empowering-interactive-collaboration-2nck</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In today's digital era, real-time collaboration is essential for effective communication, whether in online education, virtual meetings, or collaborative brainstorming. The &lt;strong&gt;&lt;a href="https://www.zegocloud.com/product/super-board" rel="noopener noreferrer"&gt;ZEGOCLOUD Whiteboard SDK&lt;/a&gt;&lt;/strong&gt; offers developers a powerful tool to integrate seamless, interactive whiteboard functionality into their applications. Built on ZEGOCLOUD's global real-time communication (RTC) infrastructure, this SDK enables low-latency, feature-rich whiteboard experiences across multiple platforms. In this article, we'll dive into the ZEGOCLOUD Whiteboard SDK, exploring its features, integration steps, use cases, and why it's a game-changer for real-time interaction.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the ZEGOCLOUD Whiteboard SDK?
&lt;/h2&gt;

&lt;p&gt;The ZEGOCLOUD Whiteboard SDK is a robust solution that allows developers to embed interactive whiteboard capabilities into their apps. It supports collaborative features like real-time drawing, annotations, file sharing, and synchronized interactions across Android, iOS, Windows, macOS, and Web platforms. With low-latency performance and AI-powered enhancements, it’s perfect for creating engaging experiences in education, enterprise collaboration, and beyond.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Features
&lt;/h3&gt;

&lt;p&gt;Here’s a look at the standout features of the ZEGOCLOUD Whiteboard SDK:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Real-Time Collaboration&lt;/strong&gt;: Multiple users can draw, annotate, and interact on the same whiteboard simultaneously, with changes synced instantly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross-Platform Support&lt;/strong&gt;: Compatible with Android, iOS, macOS, Windows, and Web for a consistent experience across devices.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;File Sharing and Synchronization&lt;/strong&gt;: Upload and share files (e.g., PPT, PDF, Word), transcoded into formats like HTML5 or PNG, preserving animations and transitions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rich Drawing Tools&lt;/strong&gt;: Includes freehand drawing, shapes, text, and annotations with customizable colors, sizes, and styles.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Low-Latency Performance&lt;/strong&gt;: Powered by ZEGOCLOUD’s global RTC network for smooth interactions, even in weak network conditions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI-Powered Features&lt;/strong&gt;: Enhances visuals with real-time video effects and dynamic annotations for engaging presentations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interactive Components&lt;/strong&gt;: Supports zoom, pan, undo/redo, and page management for a fluid user experience.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secure and Scalable&lt;/strong&gt;: Built with robust security and scalable architecture to handle large user groups.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customizable UI&lt;/strong&gt;: Offers prebuilt UI components and customization options to align with your app’s branding.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Choose ZEGOCLOUD Whiteboard SDK?
&lt;/h2&gt;

&lt;p&gt;The ZEGOCLOUD Whiteboard SDK stands out for its ease of use, performance, and versatility. Here’s why it’s a top choice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Low-Code Integration&lt;/strong&gt;: Prebuilt components and clear documentation make integration quick and simple.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Global Reach&lt;/strong&gt;: ZEGOCLOUD’s global network ensures low-latency performance across regions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flexible Customization&lt;/strong&gt;: Tailor the whiteboard’s appearance and functionality to fit your use case.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Robust Documentation&lt;/strong&gt;: Comprehensive guides, tutorials, and sample code are available on the &lt;a href="https://docs.zegocloud.com" rel="noopener noreferrer"&gt;ZEGOCLOUD Developer Center&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Use Cases
&lt;/h2&gt;

&lt;p&gt;The ZEGOCLOUD Whiteboard SDK is versatile and applicable in various scenarios:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Online Education&lt;/strong&gt;: Enables interactive lessons with real-time annotations, file sharing, and collaborative problem-solving.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Virtual Meetings&lt;/strong&gt;: Facilitates brainstorming, project planning, and presentations with shared whiteboards.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;E-Learning Platforms&lt;/strong&gt;: Integrates with educational apps for interactive courseware and group activities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Creative Collaboration&lt;/strong&gt;: Supports design teams in sketching ideas and annotating designs in real time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customer Support&lt;/strong&gt;: Allows visual explanations to improve communication with clients.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Integration Steps
&lt;/h2&gt;

&lt;p&gt;Integrating the ZEGOCLOUD Whiteboard SDK is straightforward. Below is a step-by-step guide for Web integration using JavaScript (similar steps apply for other platforms).&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;p&gt;Before starting, ensure you have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A ZEGOCLOUD account with access to the Admin Console.&lt;/li&gt;
&lt;li&gt;AppID and ServerSecret from the ZEGOCLOUD Admin Console.&lt;/li&gt;
&lt;li&gt;A development environment with Node.js installed (for Web projects).&lt;/li&gt;
&lt;li&gt;A compatible browser (e.g., latest Google Chrome) with SSL support (HTTPS, localhost, or 127.0.0.1).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step-by-Step Integration
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Set Up Your Project&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a new project in your preferred framework (e.g., React, Vue, Angular, or plain JavaScript).&lt;/li&gt;
&lt;li&gt;Install the ZEGOCLOUD Whiteboard SDK via NPM:
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; npm &lt;span class="nb"&gt;install&lt;/span&gt; @zegocloud/zego-uikit-prebuilt
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Ensure your project runs on an HTTPS server or localhost.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Generate a Kit Token&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use your AppID and ServerSecret to generate a token for authentication. Implement this on your server or use ZEGOCLOUD’s token generator.&lt;/li&gt;
&lt;li&gt;Example (JavaScript):
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ZegoUIKitPrebuilt&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@zegocloud/zego-uikit-prebuilt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

 &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;randomID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;len&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;chars&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;12345qwertyuiopasdfgh67890jklmnbvcxzMNBVCZXASDQWERTYHGFUIOLKJP&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;chars&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;charAt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;chars&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="p"&gt;}&lt;/span&gt;

 &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;appID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;YOUR_APP_ID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Replace with your AppID&lt;/span&gt;
 &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;serverSecret&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;YOUR_SERVER_SECRET&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Replace with your ServerSecret&lt;/span&gt;
 &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;roomID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;randomID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
 &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;kitToken&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ZegoUIKitPrebuilt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generateKitTokenForTest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;appID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;serverSecret&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;roomID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;randomID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;UserName&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Initialize the Whiteboard&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a whiteboard instance using the token and attach it to a DOM element.&lt;/li&gt;
&lt;li&gt;Example (React):
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ZegoUIKitPrebuilt&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@zegocloud/zego-uikit-prebuilt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

 &lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;roomID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;randomID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;myMeeting&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;appID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;YOUR_APP_ID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
     &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;serverSecret&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;YOUR_SERVER_SECRET&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
     &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;kitToken&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ZegoUIKitPrebuilt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generateKitTokenForTest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;appID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;serverSecret&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;roomID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;randomID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;UserName&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
     &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;zp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ZegoUIKitPrebuilt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;kitToken&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
     &lt;span class="nx"&gt;zp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;joinRoom&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
       &lt;span class="na"&gt;container&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="na"&gt;scenario&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
         &lt;span class="na"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ZegoUIKitPrebuilt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;GroupCall&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="p"&gt;},&lt;/span&gt;
       &lt;span class="na"&gt;whiteboardConfig&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
         &lt;span class="na"&gt;showAddImageButton&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="na"&gt;showCreateAndCloseButton&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="p"&gt;},&lt;/span&gt;
     &lt;span class="p"&gt;});&lt;/span&gt;
   &lt;span class="p"&gt;};&lt;/span&gt;

   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;myMeeting&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;100vw&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;100vh&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}}&lt;/span&gt; &lt;span class="sr"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;;
&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Customize Whiteboard Features&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configure settings like drawing tools and file uploads via the &lt;code&gt;whiteboardConfig&lt;/code&gt; object.&lt;/li&gt;
&lt;li&gt;Example:
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="nx"&gt;whiteboardConfig&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nl"&gt;showAddImageButton&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="nx"&gt;showCreateAndCloseButton&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
   &lt;span class="nx"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pen&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;line&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;rectangle&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;text&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
 &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Test and Deploy&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Test locally to ensure the whiteboard functions as expected.&lt;/li&gt;
&lt;li&gt;Deploy to an HTTPS server for production, as the SDK requires a secure connection.&lt;/li&gt;
&lt;li&gt;For production, generate tokens on your server instead of using &lt;code&gt;generateKitTokenForTest&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Sample Code
&lt;/h3&gt;

&lt;p&gt;Here’s a simplified React example for integrating the Whiteboard SDK:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ZegoUIKitPrebuilt&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@zegocloud/zego-uikit-prebuilt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;randomID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;len&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;chars&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;12345qwertyuiopasdfgh67890jklmnbvcxzMNBVCZXASDQWERTYHGFUIOLKJP&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;chars&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;charAt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;chars&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;roomID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;randomID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;myMeeting&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;appID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;YOUR_APP_ID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Replace with your AppID&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;serverSecret&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;YOUR_SERVER_SECRET&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Replace with your ServerSecret&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;kitToken&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ZegoUIKitPrebuilt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generateKitTokenForTest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;appID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;serverSecret&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;roomID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;randomID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;UserName&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;zp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ZegoUIKitPrebuilt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;kitToken&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;zp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;joinRoom&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;container&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;scenario&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ZegoUIKitPrebuilt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;GroupCall&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;whiteboardConfig&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;showAddImageButton&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;showCreateAndCloseButton&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;myMeeting&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;100vw&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;100vh&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}}&lt;/span&gt; &lt;span class="sr"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Best Practices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Optimize for Weak Networks&lt;/strong&gt;: Use ZEGOCLOUD’s network adaptation for smooth performance in low-bandwidth scenarios.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test Across Devices&lt;/strong&gt;: Ensure compatibility across Web, Android, iOS, and other platforms.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secure Token Generation&lt;/strong&gt;: Generate tokens on your server for production to enhance security.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use the Admin Console&lt;/strong&gt;: Monitor usage and manage AppID/ServerSecret via the ZEGOCLOUD Admin Console.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Leverage Documentation&lt;/strong&gt;: Refer to the &lt;a href="https://docs.zegocloud.com" rel="noopener noreferrer"&gt;ZEGOCLOUD Developer Center&lt;/a&gt; for guides and API references.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Basic editing tools
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd0euhhigtxlc54jvuk24.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd0euhhigtxlc54jvuk24.png" alt="ZEGOCLOUD Whiteboard SDK Basic editing tools list " width="800" height="756"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Pricing and Plans
&lt;/h2&gt;

&lt;p&gt;ZEGOCLOUD offers a free tier with 10,000 minutes for testing and development. For detailed pricing, visit the &lt;a href="https://www.zegocloud.com/pricing" rel="noopener noreferrer"&gt;ZEGOCLOUD pricing page&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The ZEGOCLOUD Whiteboard SDK is a powerful tool for building real-time, interactive whiteboard experiences. With its low-latency performance, cross-platform support, and rich features, it’s ideal for online education, virtual meetings, and collaborative workflows. By following the integration steps and best practices above, developers can create engaging apps that enhance collaboration.&lt;/p&gt;

&lt;p&gt;Explore the ZEGOCLOUD Whiteboard SDK today at the &lt;a href="https://docs.zegocloud.com" rel="noopener noreferrer"&gt;ZEGOCLOUD Developer Center&lt;/a&gt; and leverage the free trial to bring your app’s collaboration features to life!&lt;/p&gt;

&lt;p&gt;Happy coding, and enjoy your new video call app!&lt;/p&gt;

&lt;p&gt;written by shubham Pandey&lt;/p&gt;

</description>
      <category>zegocloud</category>
      <category>videocallingapp</category>
      <category>webdev</category>
      <category>whiteboardsdk</category>
    </item>
    <item>
      <title>Step-by-Step Guide to Building a Video Conference App with ZEGOCLOUD Video Conference Kit</title>
      <dc:creator>Roozer Grom</dc:creator>
      <pubDate>Fri, 02 May 2025 18:39:56 +0000</pubDate>
      <link>https://dev.to/roozer_grom_b659e0c7acc0c/step-by-step-guide-to-building-a-video-conference-app-with-zegocloud-video-conference-kit-28hf</link>
      <guid>https://dev.to/roozer_grom_b659e0c7acc0c/step-by-step-guide-to-building-a-video-conference-app-with-zegocloud-video-conference-kit-28hf</guid>
      <description>&lt;p&gt;In today's digital age, video conferencing has become an essential tool You can explore more on &lt;a href="https://www.zegocloud.com/" rel="noopener noreferrer"&gt;ZEGOCLOUD’s official website&lt;/a&gt; for powerful tools to build such apps... for remote work, education, and social interaction. Building a video conference application from scratch can be complex, but with &lt;a href="https://www.zegocloud.com/" rel="noopener noreferrer"&gt;ZEGOCLOUD's Video Conference&lt;/a&gt; Kit, developers can integrate feature-rich video conferencing capabilities into their web applications quickly and easily. This comprehensive guide will walk you through the process of setting up a video conference app using ZEGOCLOUD's Video Conference Kit in simple, beginner-friendly language. We'll cover everything from prerequisites to customization, including a detailed code tutorial with step-by-step instructions.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is ZEGOCLOUD Video Conference Kit?
&lt;/h2&gt;

&lt;p&gt;ZEGOCLOUD's Video Conference Kit is a prebuilt, feature-rich component that allows developers to embed video conferencing functionality into web and mobile applications with minimal coding. It provides a ready-to-use user interface (UI) and business logic, enabling you to create Zoom-like video conferencing apps in minutes. Key features include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;High-quality video and audio&lt;/strong&gt;: Supports crystal-clear voice and video, even in low-bandwidth conditions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Screen sharing&lt;/strong&gt;: Allows users to share their screens during calls.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customizable layouts&lt;/strong&gt;: Supports gallery and picture-in-picture layouts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real-time interaction&lt;/strong&gt;: Includes in-room messaging, participant management, and more.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross-platform support&lt;/strong&gt;: Works on web browsers (PC and mobile) and integrates with frameworks like React, Angular, and Vue.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This guide focuses on the web version of the Video Conference Kit, using HTML and JavaScript for integration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before we dive into the tutorial, ensure you have the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Basic Knowledge&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Familiarity with HTML, CSS, and JavaScript.&lt;/li&gt;
&lt;li&gt;Basic understanding of web development concepts.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Development Environment&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A code editor (e.g., Visual Studio Code).&lt;/li&gt;
&lt;li&gt;A modern web browser (Google Chrome is recommended for best compatibility).&lt;/li&gt;
&lt;li&gt;Node.js and npm (if using a framework like React).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;ZEGOCLOUD Account&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sign up for a free account on the &lt;a href="https://console.zegocloud.com/" rel="noopener noreferrer"&gt;ZEGOCLOUD Admin Console&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Create a project to obtain your &lt;code&gt;AppID&lt;/code&gt; and &lt;code&gt;ServerSecret&lt;/code&gt;, which are required for authentication.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Internet Connection&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A stable internet connection for testing and deploying your application.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step-by-Step Tutorial: Building a Video Conference App
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk6fgl8szrnzf7j3r8irj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk6fgl8szrnzf7j3r8irj.png" alt="Image description" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's build a simple video conference app using ZEGOCLOUD's Video Conference Kit. We'll use the HTML script method for integration, as it's the simplest approach for beginners. Follow these steps carefully.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Set Up Your ZEGOCLOUD Project
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Log in to ZEGOCLOUD Admin Console&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Visit &lt;a href="https://console.zegocloud.com/" rel="noopener noreferrer"&gt;ZEGOCLOUD Admin Console&lt;/a&gt; and sign in or create an account.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6j37fs7jssffxvrpdlhz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6j37fs7jssffxvrpdlhz.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Create a New Project&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click on &lt;strong&gt;Create Project&lt;/strong&gt; and select &lt;strong&gt;UIKit&lt;/strong&gt; as the project type.&lt;/li&gt;
&lt;li&gt;Give your project a name (e.g., "VideoConferenceApp").&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Obtain AppID and ServerSecret&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once the project is created, you'll see your &lt;code&gt;AppID&lt;/code&gt; (a numeric value) and &lt;code&gt;ServerSecret&lt;/code&gt; (a string).&lt;/li&gt;
&lt;li&gt;Note these down, as you'll need them to generate a Kit Token for authentication.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fksm4sgfa068fgv05uh1a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fksm4sgfa068fgv05uh1a.png" alt="Image description" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Enable Video Conference Kit&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;In the project dashboard, ensure the Video Conference Kit is enabled. This is usually enabled by default for UIKit projects.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 2: Set Up Your Project Folder
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Create a Project Directory&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On your computer, create a new folder called &lt;code&gt;video-conference-app&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Inside this folder, create a file named &lt;code&gt;index.html&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Basic HTML Structure&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open &lt;code&gt;index.html&lt;/code&gt; in your code editor and add the following basic HTML structure:
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;ZEGOCLOUD Video Conference App&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
        &lt;span class="nf"&gt;#root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100vw&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100vh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"root"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;#root&lt;/code&gt; div will serve as the container for the video conference UI.&lt;/li&gt;
&lt;li&gt;The CSS ensures the video conference interface takes up the full viewport.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 3: Import ZEGOCLOUD Video Conference Kit
&lt;/h3&gt;

&lt;p&gt;1  &lt;strong&gt;Add the ZEGOCLOUD SDK&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Include the ZEGOCLOUD Video Conference Kit SDK by adding the following &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag inside the &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; of your &lt;code&gt;index.html&lt;/code&gt;, just before the closing &lt;code&gt;&amp;lt;/body&amp;gt;&lt;/code&gt; tag:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/@zegocloud/zego-uikit-prebuilt/zego-uikit-prebuilt.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;This script loads the prebuilt Video Conference Kit library from a CDN, making it easy to integrate without installing dependencies.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2  &lt;strong&gt;Verify SDK Import&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Save the file and open &lt;code&gt;index.html&lt;/code&gt; in a browser (e.g., Chrome) using a local server. To run a local server, you can use:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;VS Code&lt;/strong&gt;: Install the "Live Server" extension and right-click &lt;code&gt;index.html&lt;/code&gt; to open with Live Server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Node.js&lt;/strong&gt;: Run &lt;code&gt;npx http-server&lt;/code&gt; in the project folder.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Ensure there are no errors in the browser's console.&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 4: Generate a Kit Token
&lt;/h3&gt;

&lt;p&gt;The ZEGOCLOUD Video Conference Kit requires a Kit Token for authentication. This token is generated using your &lt;code&gt;AppID&lt;/code&gt;, &lt;code&gt;ServerSecret&lt;/code&gt;, and other parameters like &lt;code&gt;roomID&lt;/code&gt;, &lt;code&gt;userID&lt;/code&gt;, and &lt;code&gt;userName&lt;/code&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Add Token Generation Logic&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Below the SDK script, add a &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag with the following JavaScript code to generate a Kit Token and initialize the video conference:
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Replace with your actual AppID and ServerSecret&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;appID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;YOUR_APP_ID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// e.g., 123456789&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;serverSecret&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;YOUR_SERVER_SECRET&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// e.g., "a1b2c3d4e5f6..."&lt;/span&gt;
&lt;span class="c1"&gt;// Generate a random roomID, userID, and userName&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;roomID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;36&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;substring&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Random 5-character room ID&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;userID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Random user ID&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;userName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user_&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;userID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// User name based on user ID&lt;/span&gt;
&lt;span class="c1"&gt;// Generate Kit Token&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;kitToken&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ZegoUIKitPrebuilt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generateKitTokenForTest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;appID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;serverSecret&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;roomID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;userID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;userName&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// Initialize the Video Conference Kit&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;zp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ZegoUIKitPrebuilt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;kitToken&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// Join the video conference room&lt;/span&gt;
&lt;span class="nx"&gt;zp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;joinRoom&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;container&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#root&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="na"&gt;sharedLinks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Personal link&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;protocol&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;//&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
                &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;host&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
                &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pathname&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;?roomID=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
                &lt;span class="nx"&gt;roomID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="na"&gt;scenario&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ZegoUIKitPrebuilt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;VideoConference&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2  &lt;strong&gt;Replace Credentials&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Replace &lt;code&gt;YOUR_APP_ID&lt;/code&gt; with the &lt;code&gt;AppID&lt;/code&gt; from your ZEGOCLOUD project.&lt;/li&gt;
&lt;li&gt;Replace &lt;code&gt;YOUR_SERVER_SECRET&lt;/code&gt; with the &lt;code&gt;ServerSecret&lt;/code&gt; from your ZEGOCLOUD project.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;3  &lt;strong&gt;Explanation of the Code&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;AppID&lt;/code&gt; and &lt;code&gt;ServerSecret&lt;/code&gt;&lt;/strong&gt;: Authenticate your app with ZEGOCLOUD's servers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;roomID&lt;/code&gt;&lt;/strong&gt;: A unique identifier for the video conference room. Users with the same &lt;code&gt;roomID&lt;/code&gt; join the same conference.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;userID&lt;/code&gt; and &lt;code&gt;userName&lt;/code&gt;&lt;/strong&gt;: Identify the user in the conference. For testing, we generate random values.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;generateKitTokenForTest&lt;/code&gt;&lt;/strong&gt;: A helper method to create a temporary token for testing. For production, you should generate tokens server-side for security.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;joinRoom&lt;/code&gt;&lt;/strong&gt;: Initializes the video conference UI inside the &lt;code&gt;#root&lt;/code&gt; div and starts the conference.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 5: Test Your Video Conference App
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Run the Application&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Save &lt;code&gt;index.html&lt;/code&gt; and open it in a browser using a local server (e.g., &lt;code&gt;http://localhost:8080&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;You should see the ZEGOCLOUD video conference interface, with options to enable your camera and microphone.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Join the Conference&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Allow browser permissions for camera and microphone access.&lt;/li&gt;
&lt;li&gt;You'll see your video feed and the conference UI, including buttons for screen sharing, messaging, and participant management.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Test with Multiple Users&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open another browser tab or window and navigate to the same URL with the same &lt;code&gt;roomID&lt;/code&gt; (you can find the shared link in the UI).&lt;/li&gt;
&lt;li&gt;Alternatively, modify the &lt;code&gt;roomID&lt;/code&gt; in the code to a fixed value (e.g., &lt;code&gt;room123&lt;/code&gt;) and open multiple tabs with &lt;code&gt;?roomID=room123&lt;/code&gt; appended to the URL (e.g., &lt;code&gt;http://localhost:8080?roomID=room123&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;You should see multiple participants in the same conference.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 6: Customize the Video Conference UI
&lt;/h3&gt;

&lt;p&gt;ZEGOCLOUD's Video Conference Kit allows you to customize the UI and behavior using the &lt;code&gt;ZegoUIKitPrebuiltVideoConferenceConfig&lt;/code&gt; object. Here are some common customizations:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Add a Leave Confirmation Dialog&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;To prompt users before leaving the conference, modify the &lt;code&gt;joinRoom&lt;/code&gt; configuration:
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;zp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;joinRoom&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;container&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#root&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="na"&gt;sharedLinks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Personal link&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;protocol&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;//&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
                &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;host&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
                &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pathname&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;?roomID=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
                &lt;span class="nx"&gt;roomID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="na"&gt;scenario&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ZegoUIKitPrebuilt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;VideoConference&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;leaveConfirmDialogInfo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Leave the conference&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Are you sure you want to leave?&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;cancelButtonName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Cancel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;confirmButtonName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Confirm&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;This adds a confirmation dialog when the user clicks the "Leave" button.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2  &lt;strong&gt;Change Layout&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;By default, the kit uses a gallery layout. To switch to picture-in-picture, add:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;scenario&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ZegoUIKitPrebuilt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;VideoConference&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;layout&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;PictureInPicture&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3  &lt;strong&gt;Turn Off Camera by Default&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To disable the camera when joining:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;turnOnCameraWhenJoining&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4  &lt;strong&gt;Add Custom Avatars&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To display user avatars instead of the first letter of the username:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;avatar&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://example.com/avatar.png&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 7: Deploy Your Application
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Host on a Web Server&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For production, host your &lt;code&gt;index.html&lt;/code&gt; on a web server (e.g., Netlify, Vercel, or AWS).&lt;/li&gt;
&lt;li&gt;Ensure the server supports HTTPS, as ZEGOCLOUD requires secure connections for camera and microphone access.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Generate Tokens Server-Side&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For security, avoid using &lt;code&gt;generateKitTokenForTest&lt;/code&gt; in production. Instead, set up a server (e.g., using Node.js) to generate tokens. Refer to ZEGOCLOUD's documentation for server-side token generation.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Test Thoroughly&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Test your app across different browsers (Chrome, Firefox, Safari) and devices to ensure compatibility.&lt;/li&gt;
&lt;li&gt;Verify features like screen sharing, messaging, and participant management.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Complete Code Example
&lt;/h2&gt;

&lt;p&gt;Here's the complete &lt;code&gt;index.html&lt;/code&gt; file with all the code integrated:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;ZEGOCLOUD Video Conference App&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
        &lt;span class="nf"&gt;#root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100vw&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100vh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"root"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/@zegocloud/zego-uikit-prebuilt/zego-uikit-prebuilt.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
        &lt;span class="c1"&gt;// Replace with your actual AppID and ServerSecret&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;appID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;YOUR_APP_ID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// e.g., 123456789&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;serverSecret&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;YOUR_SERVER_SECRET&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// e.g., "a1b2c3d4e5f6..."&lt;/span&gt;
        &lt;span class="c1"&gt;// Generate a random roomID, userID, and userName&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;roomID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;36&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;substring&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;userID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;userName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user_&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;userID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="c1"&gt;// Generate Kit Token&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;kitToken&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ZegoUIKitPrebuilt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generateKitTokenForTest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="nx"&gt;appID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nx"&gt;serverSecret&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nx"&gt;roomID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nx"&gt;userID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nx"&gt;userName&lt;/span&gt;
        &lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="c1"&gt;// Initialize the Video Conference Kit&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;zp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ZegoUIKitPrebuilt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;kitToken&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="c1"&gt;// Join the video conference room&lt;/span&gt;
        &lt;span class="nx"&gt;zp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;joinRoom&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
            &lt;span class="na"&gt;container&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#root&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="na"&gt;sharedLinks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
                &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Personal link&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                        &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;protocol&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
                        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;//&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
                        &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;host&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
                        &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pathname&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
                        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;?roomID=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
                        &lt;span class="nx"&gt;roomID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="na"&gt;scenario&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ZegoUIKitPrebuilt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;VideoConference&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="na"&gt;leaveConfirmDialogInfo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Leave the conference&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Are you sure you want to leave?&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;cancelButtonName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Cancel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;confirmButtonName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Confirm&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="na"&gt;config&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;turnOnCameraWhenJoining&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Advanced Integration with Frameworks
&lt;/h2&gt;

&lt;p&gt;If you're using a JavaScript framework like React, Vue, or Angular, ZEGOCLOUD provides NPM packages for seamless integration. Here's a brief example using React:&lt;/p&gt;

&lt;h3&gt;
  
  
  React Integration
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install the ZEGOCLOUD Package&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Run the following command in your React project:
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @zegocloud/zego-uikit-prebuilt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2  &lt;strong&gt;Create a Video Conference Component&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a file named &lt;code&gt;VideoConference.js&lt;/code&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ZegoUIKitPrebuilt&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@zegocloud/zego-uikit-prebuilt&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;randomID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;len&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;chars&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;12345qwertyuiopasdfgh67890jklmnbvcxzMNBVCZXASDQWERTYHGFUIOLKJP&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;maxPos&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;chars&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;len&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;len&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;chars&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;charAt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;maxPos&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;VideoConference&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;roomID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;randomID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;myMeeting&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;appID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;YOUR_APP_ID&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;serverSecret&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;YOUR_SERVER_SECRET&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;kitToken&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ZegoUIKitPrebuilt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generateKitTokenForTest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="nx"&gt;appID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nx"&gt;serverSecret&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nx"&gt;roomID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nf"&gt;randomID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="nf"&gt;randomID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;zp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ZegoUIKitPrebuilt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;kitToken&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;zp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;joinRoom&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
            &lt;span class="na"&gt;container&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;sharedLinks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
                &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Personal link&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;protocol&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;//&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;host&lt;/span&gt;&lt;span class="p"&gt;}${&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pathname&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;?roomID=&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;roomID&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="na"&gt;scenario&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ZegoUIKitPrebuilt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;VideoConference&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;myMeeting&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;100vw&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;100vh&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}}&lt;/span&gt; &lt;span class="sr"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3  &lt;strong&gt;Use the Component&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Import and use the &lt;code&gt;VideoConference&lt;/code&gt; component in your React app.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For detailed framework-specific guides, refer to the &lt;a href="https://docs.zegocloud.com/" rel="noopener noreferrer"&gt;ZEGOCLOUD documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshooting Common Issues
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Camera/Microphone Not Working&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ensure you're using HTTPS (required for camera/microphone access).&lt;/li&gt;
&lt;li&gt;Check browser permissions for camera and microphone.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Token Errors&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Verify that your &lt;code&gt;AppID&lt;/code&gt; and &lt;code&gt;ServerSecret&lt;/code&gt; are correct.&lt;/li&gt;
&lt;li&gt;For production, use server-side token generation instead of &lt;code&gt;generateKitTokenForTest&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;UI Not Displaying&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Confirm that the &lt;code&gt;#root&lt;/code&gt; div exists and has sufficient width and height.&lt;/li&gt;
&lt;li&gt;Check the browser console for JavaScript errors.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Cross-Browser Compatibility&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Test on Chrome, as it's the most compatible browser. For other browsers, check ZEGOCLOUD's Web SDK compatibility.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Best Practices
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Secure Token Generation&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Always generate tokens on the server side for production apps to prevent exposing your &lt;code&gt;ServerSecret&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Optimize Performance&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use a fixed &lt;code&gt;roomID&lt;/code&gt; for consistent conference sessions.&lt;/li&gt;
&lt;li&gt;Minimize customizations that increase load times.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;User Experience&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add clear instructions for users to enable camera/microphone permissions.&lt;/li&gt;
&lt;li&gt;Customize the UI to match your app's branding.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Testing&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Test with multiple users and devices to ensure scalability.&lt;/li&gt;
&lt;li&gt;Simulate low-bandwidth conditions to verify performance.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;ZEGOCLOUD's Video Conference Kit makes it incredibly easy to build a fully functional video conferencing app with minimal coding. By following this guide, you've learned how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set up a ZEGOCLOUD project and obtain credentials.&lt;/li&gt;
&lt;li&gt;Integrate the Video Conference Kit into a web app using HTML and JavaScript.&lt;/li&gt;
&lt;li&gt;Customize the UI and behavior to suit your needs.&lt;/li&gt;
&lt;li&gt;Deploy and test your application.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With just a few lines of code, you can create a Zoom-like experience that supports high-quality video, screen sharing, and real-time interaction. For more advanced features or framework-specific integrations, explore the &lt;a href="https://docs.zegocloud.com/" rel="noopener noreferrer"&gt;ZEGOCLOUD documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For a production app, generate tokens securely on a server, add error handling, and maybe style it up a bit. But for now, you've got a solid foundation. Have fun streaming, and let me know how it goes!&lt;/p&gt;

&lt;p&gt;Start building your video conference app today and empower your users with seamless real-time communication!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written by Shubham Pandey&lt;/em&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;Subscribe: &lt;a href="https://www.youtube.com/@doumcoding" rel="noopener noreferrer"&gt;Doumcoding&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>webdev</category>
      <category>zegocloud</category>
      <category>videocallingapp</category>
    </item>
    <item>
      <title>Building a Live Streaming App with ZEGOCLOUD Live Streaming SDK and React JS: A Step-by-Step Guide</title>
      <dc:creator>Roozer Grom</dc:creator>
      <pubDate>Fri, 11 Apr 2025 06:10:38 +0000</pubDate>
      <link>https://dev.to/roozer_grom_b659e0c7acc0c/building-a-live-streaming-app-with-zegocloud-live-streaming-sdk-and-react-js-a-step-by-step-guide-224b</link>
      <guid>https://dev.to/roozer_grom_b659e0c7acc0c/building-a-live-streaming-app-with-zegocloud-live-streaming-sdk-and-react-js-a-step-by-step-guide-224b</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdspxhju2p2s6498c1fm0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdspxhju2p2s6498c1fm0.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Live streaming has become a massive part of how we connect online—think of platforms like &lt;strong&gt;Twitch&lt;/strong&gt;, &lt;strong&gt;YouTube Live&lt;/strong&gt;, or even live shopping apps. If you’re a developer wanting to create your own live streaming app, the &lt;strong&gt;ZEGOCLOUD Live Streaming SDK&lt;/strong&gt; is a fantastic tool to make it happen. It’s powerful, flexible, and works seamlessly with &lt;strong&gt;React JS&lt;/strong&gt;, a popular library for building interactive web apps.&lt;/p&gt;

&lt;p&gt;In this guide, I’ll take you through every step of integrating the &lt;strong&gt;ZEGOCLOUD Live Streaming SDK&lt;/strong&gt; into a &lt;strong&gt;React JS&lt;/strong&gt; project. We’ll:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set up the SDK
&lt;/li&gt;
&lt;li&gt;Initialize a live stream
&lt;/li&gt;
&lt;li&gt;Publish your video
&lt;/li&gt;
&lt;li&gt;Play streams from others
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All with detailed explanations and code snippets. I’ll keep it simple, practical, and easy to follow, so it feels like a real developer wrote it—not some AI spitting out generic stuff.&lt;/p&gt;

&lt;p&gt;Let’s dive in!&lt;/p&gt;

&lt;h3&gt;
  
  
  Why ZEGOCLOUD Live Streaming SDK?
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;ZEGOCLOUD Live Streaming SDK&lt;/strong&gt; is built for developers who need a robust solution for real-time video streaming. It handles the heavy lifting—like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Connecting users
&lt;/li&gt;
&lt;li&gt;Managing streams
&lt;/li&gt;
&lt;li&gt;Ensuring low latency
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So you can focus on building a great app.&lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;React JS&lt;/strong&gt;, you get a clean way to manage your UI, making this combo perfect for a modern web-based live streaming app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before we start, here’s what you’ll need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Node.js&lt;/strong&gt;: Installed on your system (&lt;a href="https://nodejs.org" rel="noopener noreferrer"&gt;get it from nodejs.org&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React Knowledge&lt;/strong&gt;: Basics of components, hooks (&lt;code&gt;useState&lt;/code&gt;, &lt;code&gt;useEffect&lt;/code&gt;), and JSX.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ZEGOCLOUD Account&lt;/strong&gt;: Sign up at &lt;a href="https://www.zegocloud.com" rel="noopener noreferrer"&gt;ZEGOCLOUD’s website&lt;/a&gt; and grab your &lt;strong&gt;App ID&lt;/strong&gt; and &lt;strong&gt;Server Secret&lt;/strong&gt; from the &lt;strong&gt;Admin Console&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Text Editor&lt;/strong&gt;: VS Code or any editor you like.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpjdman8y22t5wbbf4n33.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpjdman8y22t5wbbf4n33.jpg" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Setting Up Your React Project
&lt;/h2&gt;

&lt;p&gt;First, let’s create a fresh React project. I’m using &lt;strong&gt;Vite&lt;/strong&gt; because it’s fast and lightweight, but you can use &lt;strong&gt;Create React App&lt;/strong&gt; if that’s your preference.&lt;/p&gt;

&lt;p&gt;Open your terminal and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm create vite@latest live-streaming-app --template react
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Move into the project folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd live-streaming-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install dependencies and start the development server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install
npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Visit &lt;a href="http://localhost:5173" rel="noopener noreferrer"&gt;http://localhost:5173&lt;/a&gt; in your browser—you should see a basic React app. Perfect! We’ve got our base setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Installing the ZEGOCLOUD Live Streaming SDK
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;ZEGOCLOUD SDK&lt;/strong&gt; for web apps uses &lt;strong&gt;WebRTC&lt;/strong&gt;, so we’ll install the &lt;code&gt;zego-express-engine-webrtc&lt;/code&gt; package.&lt;br&gt;
In your terminal, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install zego-express-engine-webrtc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This adds the SDK to your project. You’ll see it listed in package.json once it’s installed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Initializing the SDK
&lt;/h2&gt;

&lt;p&gt;Now, let’s set up the SDK in our React app.Open &lt;code&gt;src/App.jsx&lt;/code&gt; and replace its contents with this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { useEffect } from 'react';
import { ZegoExpressEngine } from 'zego-express-engine-webrtc';

function App() {
  useEffect(() =&amp;gt; {
    const appID = import.meta.env.VITE_ZEGO_APP_ID; // Your App ID
    const serverSecret = import.meta.env.VITE_ZEGO_SERVER_SECRET; // Your Server Secret
    const zg = new ZegoExpressEngine(appID, serverSecret);
    console.log('ZEGOCLOUD SDK Initialized!');

    return () =&amp;gt; {
      zg.destroyEngine(); // Cleanup when component unmounts
    };
  }, []);

  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;My Live Streaming App&amp;lt;/h1&amp;gt;
      &amp;lt;div id="local-stream" style={{ width: '400px', height: '300px', border: '1px solid #ccc' }}&amp;gt;&amp;lt;/div&amp;gt;
      &amp;lt;div id="remote-streams" style={{ width: '400px', height: '300px', border: '1px solid #ccc' }}&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

export default App;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What’s Going On?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Imports&lt;/strong&gt;: We bring in &lt;code&gt;useEffect&lt;/code&gt; for lifecycle management and &lt;code&gt;ZegoExpressEngine&lt;/code&gt; from the SDK.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Initialization&lt;/strong&gt;: Inside &lt;code&gt;useEffect&lt;/code&gt;, we create a new instance of &lt;code&gt;ZegoExpressEngine&lt;/code&gt; with our App ID and Server Secret.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cleanup&lt;/strong&gt;: The &lt;code&gt;return&lt;/code&gt; statement ensures the engine is destroyed when the component unmounts, avoiding memory leaks.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UI&lt;/strong&gt;: Two &lt;code&gt;div&lt;/code&gt;s with IDs &lt;code&gt;local-stream&lt;/code&gt; and &lt;code&gt;remote-streams&lt;/code&gt; will hold our video feeds.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Environment Variables
&lt;/h2&gt;

&lt;p&gt;We’re using &lt;code&gt;VITE_ZEGO_APP_ID&lt;/code&gt; and &lt;code&gt;VITE_ZEGO_SERVER_SECRET&lt;/code&gt;.&lt;br&gt;
Create a &lt;code&gt;.env&lt;/code&gt; file in your project root and add:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;VITE_ZEGO_APP_ID=your_app_id_here
VITE_ZEGO_SERVER_SECRET=your_server_secret_here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace the placeholders with your actual values from the ZEGOCLOUD Admin Console.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Logging into a Room
&lt;/h2&gt;

&lt;p&gt;In ZEGOCLOUD, a “room” is where users connect for live streaming. Let’s log in.Update the &lt;code&gt;useEffect&lt;/code&gt; block:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;useEffect(() =&amp;gt; {
  const appID = import.meta.env.VITE_ZEGO_APP_ID;
  const serverSecret = import.meta.env.VITE_ZEGO_SERVER_SECRET;
  const zg = new ZegoExpressEngine(appID, serverSecret);

  const roomID = 'live-room-001'; // Unique room name
  const userID = `user_${Math.floor(Math.random() * 10000)}`; // Random user ID
  const userName = 'Streamer';
  const token = 'your_token_here'; // Replace with a real token

  zg.loginRoom(roomID, token, { userID, userName }, { userUpdate: true })
    .then(() =&amp;gt; {
      console.log('Logged into the room!');
    })
    .catch(error =&amp;gt; {
      console.error('Login failed:', error);
    });

  return () =&amp;gt; {
    zg.logoutRoom(roomID);
    zg.destroyEngine();
  };
}, []);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Explanation
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Variables&lt;/strong&gt;: &lt;code&gt;roomID&lt;/code&gt; is the room’s identifier, &lt;code&gt;userID&lt;/code&gt; is unique for each user (randomized here for simplicity), and &lt;code&gt;userName&lt;/code&gt; is a display name.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Token&lt;/strong&gt;: The token is for authentication. For testing, you can generate a temporary token in the ZEGOCLOUD Admin Console. In production, create it securely on your server.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;loginRoom&lt;/strong&gt;: This connects us to the room. The &lt;code&gt;{ userUpdate: true }&lt;/code&gt; option lets us track other users joining or leaving.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flsc42f9anmnqe5fxps7g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flsc42f9anmnqe5fxps7g.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Publishing Your Live Stream
&lt;/h2&gt;

&lt;p&gt;To start streaming your video, we need to capture your camera and microphone feed and publish it.Add this inside the &lt;code&gt;.then()&lt;/code&gt; block:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;zg.loginRoom(roomID, token, { userID, userName }, { userUpdate: true })
  .then(() =&amp;gt; {
    console.log('Logged into the room!');
    return zg.createStream({ camera: { audio: true, video: true } });
  })
  .then(localStream =&amp;gt; {
    const streamID = `${userID}_stream`; // Unique stream ID
    zg.startPublishingStream(streamID, localStream);

    const localVideo = document.getElementById('local-stream');
    const videoElement = document.createElement('video');
    videoElement.autoplay = true;
    videoElement.muted = true; // Mute local audio to avoid feedback
    videoElement.srcObject = localStream;
    localVideo.appendChild(videoElement);
  })
  .catch(error =&amp;gt; {
    console.error('Error:', error);
  });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What’s Happening?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;createStream&lt;/strong&gt;: Captures audio and video from your device. You’ll need to grant browser permissions for this.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;startPublishingStream&lt;/strong&gt;: Sends your stream to the room with a unique &lt;code&gt;streamID&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Display Local Stream&lt;/strong&gt;: We create a &lt;code&gt;&amp;lt;video&amp;gt;&lt;/code&gt; element, attach the &lt;code&gt;localStream&lt;/code&gt;, and add it to the &lt;code&gt;local-stream&lt;/code&gt; div.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 6: Playing Remote Streams
&lt;/h2&gt;

&lt;p&gt;To watch other users’ streams, we need to listen for stream updates.Add this event listener &lt;strong&gt;after initializing &lt;code&gt;zg&lt;/code&gt;&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;useEffect(() =&amp;gt; {
  const appID = import.meta.env.VITE_ZEGO_APP_ID;
  const serverSecret = import.meta.env.VITE_ZEGO_SERVER_SECRET;
  const zg = new ZegoExpressEngine(appID, serverSecret);

  zg.on('roomStreamUpdate', async (roomID, updateType, streamList) =&amp;gt; {
    const remoteContainer = document.getElementById('remote-streams');
    if (updateType === 'ADD') {
      streamList.forEach(async stream =&amp;gt; {
        const remoteStream = await zg.startPlayingStream(stream.streamID, { audio: true, video: true });
        const videoElement = document.createElement('video');
        videoElement.id = stream.streamID;
        videoElement.autoplay = true;
        videoElement.playsInline = true;
        videoElement.muted = false;
        videoElement.srcObject = remoteStream;
        remoteContainer.appendChild(videoElement);
      });
    } else if (updateType === 'DELETE') {
      streamList.forEach(stream =&amp;gt; {
        const videoElement = document.getElementById(stream.streamID);
        if (videoElement) {
          videoElement.remove();
        }
      });
    }
  });

  const roomID = 'live-room-001';
  const userID = `user_${Math.floor(Math.random() * 10000)}`;
  const userName = 'Streamer';
  const token = 'your_token_here';

  zg.loginRoom(roomID, token, { userID, userName }, { userUpdate: true })
    .then(() =&amp;gt; {
      console.log('Logged into the room!');
      return zg.createStream({ camera: { audio: true, video: true } });
    })
    .then(localStream =&amp;gt; {
      const streamID = `${userID}_stream`;
      zg.startPublishingStream(streamID, localStream);

      const localVideo = document.getElementById('local-stream');
      const videoElement = document.createElement('video');
      videoElement.autoplay = true;
      videoElement.muted = true;
      videoElement.srcObject = localStream;
      localVideo.appendChild(videoElement);
    })
    .catch(error =&amp;gt; {
      console.error('Error:', error);
    });

  return () =&amp;gt; {
    zg.logoutRoom(roomID);
    zg.destroyEngine();
  };
}, []);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Breakdown
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;roomStreamUpdate&lt;/strong&gt;: This event triggers when streams are added (&lt;code&gt;ADD&lt;/code&gt;) or removed (&lt;code&gt;DELETE&lt;/code&gt;).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ADD&lt;/strong&gt;: For each new stream, we use &lt;code&gt;startPlayingStream&lt;/code&gt; to fetch it, create a &lt;code&gt;&amp;lt;video&amp;gt;&lt;/code&gt; element, and display it in &lt;code&gt;remote-streams&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DELETE&lt;/strong&gt;: Removes the video element when a stream ends.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 7: Adding Basic Controls (Optional)
&lt;/h2&gt;

&lt;p&gt;Let’s add a button to stop publishing your stream.Update &lt;code&gt;App.jsx&lt;/code&gt; with state and a button:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { useEffect, useState } from 'react';
import { ZegoExpressEngine } from 'zego-express-engine-webrtc';

function App() {
  const [zg, setZg] = useState(null);
  const [streamID, setStreamID] = useState(null);

  useEffect(() =&amp;gt; {
    const appID = import.meta.env.VITE_ZEGO_APP_ID;
    const serverSecret = import.meta.env.VITE_ZEGO_SERVER_SECRET;
    const engine = new ZegoExpressEngine(appID, serverSecret);
    setZg(engine);

    engine.on('roomStreamUpdate', async (roomID, updateType, streamList) =&amp;gt; {
      const remoteContainer = document.getElementById('remote-streams');
      if (updateType === 'ADD') {
        streamList.forEach(async stream =&amp;gt; {
          const remoteStream = await engine.startPlayingStream(stream.streamID, { audio: true, video: true });
          const videoElement = document.createElement('video');
          videoElement.id = stream.streamID;
          videoElement.autoplay = true;
          videoElement.playsInline = true;
          videoElement.muted = false;
          videoElement.srcObject = remoteStream;
          remoteContainer.appendChild(videoElement);
        });
      } else if (updateType === 'DELETE') {
        streamList.forEach(stream =&amp;gt; {
          const videoElement = document.getElementById(stream.streamID);
          if (videoElement) {
            videoElement.remove();
          }
        });
      }
    });

    const roomID = 'live-room-001';
    const userID = `user_${Math.floor(Math.random() * 10000)}`;
    const userName = 'Streamer';
    const token = 'your_token_here';

    engine.loginRoom(roomID, token, { userID, userName }, { userUpdate: true })
      .then(() =&amp;gt; {
        console.log('Logged into the room!');
        return engine.createStream({ camera: { audio: true, video: true } });
      })
      .then(localStream =&amp;gt; {
        const sid = `${userID}_stream`;
        setStreamID(sid);
        engine.startPublishingStream(sid, localStream);

        const localVideo = document.getElementById('local-stream');
        const videoElement = document.createElement('video');
        videoElement.autoplay = true;
        videoElement.muted = true;
        videoElement.srcObject = localStream;
        localVideo.appendChild(videoElement);
      })
      .catch(error =&amp;gt; {
        console.error('Error:', error);
      });

    return () =&amp;gt; {
      engine.logoutRoom(roomID);
      engine.destroyEngine();
    };
  }, []);

  const stopStreaming = () =&amp;gt; {
    if (zg &amp;amp;&amp;amp; streamID) {
      zg.stopPublishingStream(streamID);
      const localVideo = document.getElementById('local-stream');
      localVideo.innerHTML = ''; // Clear the local video
      setStreamID(null);
    }
  };

  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;My Live Streaming App&amp;lt;/h1&amp;gt;
      &amp;lt;div id="local-stream" style={{ width: '400px', height: '300px', border: '1px solid #ccc' }}&amp;gt;&amp;lt;/div&amp;gt;
      &amp;lt;div id="remote-streams" style={{ width: '400px', height: '300px', border: '1px solid #ccc' }}&amp;gt;&amp;lt;/div&amp;gt;
      {streamID &amp;amp;&amp;amp; &amp;lt;button onClick={stopStreaming}&amp;gt;Stop Streaming&amp;lt;/button&amp;gt;}
    &amp;lt;/div&amp;gt;
  );
}

export default App;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Explanation
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;State&lt;/strong&gt;: &lt;code&gt;zg&lt;/code&gt; stores the engine instance, and &lt;code&gt;streamID&lt;/code&gt; tracks the active stream.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;stopStreaming&lt;/strong&gt;: Stops the stream and clears the local video.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Full Code
&lt;/h2&gt;

&lt;p&gt;Here’s everything together:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { useEffect, useState } from 'react';
import { ZegoExpressEngine } from 'zego-express-engine-webrtc';

function App() {
  const [zg, setZg] = useState(null);
  const [streamID, setStreamID] = useState(null);

  useEffect(() =&amp;gt; {
    const appID = import.meta.env.VITE_ZEGO_APP_ID;
    const serverSecret = import.meta.env.VITE_ZEGO_SERVER_SECRET;
    const engine = new ZegoExpressEngine(appID, serverSecret);
    setZg(engine);

    engine.on('roomStreamUpdate', async (roomID, updateType, streamList) =&amp;gt; {
      const remoteContainer = document.getElementById('remote-streams');
      if (updateType === 'ADD') {
        streamList.forEach(async stream =&amp;gt; {
          const remoteStream = await engine.startPlayingStream(stream.streamID, { audio: true, video: true });
          const videoElement = document.createElement('video');
          videoElement.id = stream.streamID;
          videoElement.autoplay = true;
          videoElement.playsInline = true;
          videoElement.muted = false;
          videoElement.srcObject = remoteStream;
          remoteContainer.appendChild(videoElement);
        });
      } else if (updateType === 'DELETE') {
        streamList.forEach(stream =&amp;gt; {
          const videoElement = document.getElementById(stream.streamID);
          if (videoElement) {
            videoElement.remove();
          }
        });
      }
    });

    const roomID = 'live-room-001';
    const userID = `user_${Math.floor(Math.random() * 10000)}`;
    const userName = 'Streamer';
    const token = 'your_token_here';

    engine.loginRoom(roomID, token, { userID, userName }, { userUpdate: true })
      .then(() =&amp;gt; {
        console.log('Logged into the room!');
        return engine.createStream({ camera: { audio: true, video: true } });
      })
      .then(localStream =&amp;gt; {
        const sid = `${userID}_stream`;
        setStreamID(sid);
        engine.startPublishingStream(sid, localStream);

        const localVideo = document.getElementById('local-stream');
        const videoElement = document.createElement('video');
        videoElement.autoplay = true;
        videoElement.muted = true;
        videoElement.srcObject = localStream;
        localVideo.appendChild(videoElement);
      })
      .catch(error =&amp;gt; {
        console.error('Error:', error);
      });

    return () =&amp;gt; {
      engine.logoutRoom(roomID);
      engine.destroyEngine();
    };
  }, []);

  const stopStreaming = () =&amp;gt; {
    if (zg &amp;amp;&amp;amp; streamID) {
      zg.stopPublishingStream(streamID);
      const localVideo = document.getElementById('local-stream');
      localVideo.innerHTML = '';
      setStreamID(null);
    }
  };

  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;My Live Streaming App&amp;lt;/h1&amp;gt;
      &amp;lt;div id="local-stream" style={{ width: '400px', height: '300px', border: '1px solid #ccc' }}&amp;gt;&amp;lt;/div&amp;gt;
      &amp;lt;div id="remote-streams" style={{ width: '400px', height: '300px', border: '1px solid #ccc' }}&amp;gt;&amp;lt;/div&amp;gt;
      {streamID &amp;amp;&amp;amp; &amp;lt;button onClick={stopStreaming}&amp;gt;Stop Streaming&amp;lt;/button&amp;gt;}
    &amp;lt;/div&amp;gt;
  );
}

export default App;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Testing the App
&lt;/h2&gt;

&lt;p&gt;Run &lt;code&gt;npm run dev&lt;/code&gt; and open &lt;a href="http://localhost:5173" rel="noopener noreferrer"&gt;http://localhost:5173&lt;/a&gt;.&lt;br&gt;&lt;br&gt;
You should see your video in the &lt;code&gt;local-stream&lt;/code&gt; div.&lt;/p&gt;

&lt;p&gt;To test remote streams, open another tab with the same &lt;code&gt;roomID&lt;/code&gt; but a different &lt;code&gt;userID&lt;/code&gt;. The second user’s stream should appear in &lt;code&gt;remote-streams&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fymodh0swbt4dd5fm7op0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fymodh0swbt4dd5fm7op0.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;There you go—you’ve built a live streaming app with the &lt;strong&gt;ZEGOCLOUD Live Streaming SDK&lt;/strong&gt; and &lt;strong&gt;React JS&lt;/strong&gt;!&lt;br&gt;&lt;br&gt;
We’ve covered setting up the project, initializing the SDK, joining a room, publishing your stream, and playing others’ streams.&lt;/p&gt;

&lt;p&gt;It’s a basic app, but ZEGOCLOUD offers tons more—like co-hosting, low-latency modes, or stream recording—that you can explore in their &lt;a href="https://docs.zegocloud.com/" rel="noopener noreferrer"&gt;docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For a production app:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Generate tokens securely on a server&lt;/li&gt;
&lt;li&gt;Add error handling&lt;/li&gt;
&lt;li&gt;Style it up a bit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But for now, you’ve got a solid foundation.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Have fun streaming, and let me know how it goes!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Happy coding, and enjoy your new video call app!&lt;/p&gt;

&lt;p&gt;written by shubham Pandey&lt;/p&gt;

&lt;p&gt;for video tutorial watch this :-&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/3slwikAumlE"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>programming</category>
      <category>zegocloud</category>
      <category>livestreaming</category>
      <category>stramingapp</category>
    </item>
    <item>
      <title>Building a Video Call App with ZEGOCLOUD SDK and React JS: A Step-by-Step Guide In 10 Minutes</title>
      <dc:creator>Roozer Grom</dc:creator>
      <pubDate>Wed, 26 Mar 2025 08:40:23 +0000</pubDate>
      <link>https://dev.to/roozer_grom_b659e0c7acc0c/building-a-video-call-app-with-zegocloud-sdk-and-react-js-a-step-by-step-guide-in-10-minutes-5i9</link>
      <guid>https://dev.to/roozer_grom_b659e0c7acc0c/building-a-video-call-app-with-zegocloud-sdk-and-react-js-a-step-by-step-guide-in-10-minutes-5i9</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl2twp0q63fs9b64fqddb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl2twp0q63fs9b64fqddb.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In today’s world, video calling is everywhere — whether it’s catching up with friends or hosting a team meeting. If you’re a developer looking to add video call features to your app, it might sound like a big challenge. But with tools like the &lt;strong&gt;ZEGOCLOUD SDK&lt;/strong&gt;, it’s easier than you think! ZEGOCLOUD is a cloud-based platform that gives developers simple &lt;strong&gt;APIs&lt;/strong&gt; and &lt;strong&gt;SDK&lt;/strong&gt;s to integrate video calling into their projects fast.&lt;/p&gt;

&lt;p&gt;In this article, I’ll walk you through how to build a video call app using React JS and the &lt;strong&gt;ZEGOCLOUD SDK&lt;/strong&gt;. We’ll go step by step, with clear instructions, code snippets, and explanations to make it beginner-friendly. By the end, you’ll have a working &lt;strong&gt;video call app&lt;/strong&gt; — Let’s get started.&lt;/p&gt;

&lt;p&gt;Why ZEGOCLOUD and React JS?&lt;/p&gt;

&lt;p&gt;ZEGOCLOUD makes video calling simple by handling all the tricky stuff — like connecting users and managing streams — so you don’t have to. Pair that with React JS, a popular JavaScript library for building user interfaces, and you’ve got a powerful combo for creating modern web apps. Whether you’re a solo developer or part of a team, this setup lets you build something functional quickly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Choose ZegoCloud?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ZegoCloud stands out due to its:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;High-Quality Video and Audio:&lt;/strong&gt;&lt;br&gt;
Ensures clear and reliable communication.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Low Latency&lt;/strong&gt;:&lt;br&gt;
Provides a near real-time interactive experience.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Scalability:&lt;/strong&gt;&lt;br&gt;
Can handle a large number of concurrent users.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cross-Platform Support&lt;/strong&gt;&lt;br&gt;
: Works on various operating systems and devices.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Rich Feature Set:&lt;/strong&gt;&lt;br&gt;
Offers features like screen sharing, recording, and more, beyond basic video calling.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Prerequisites :-
&lt;/h2&gt;

&lt;p&gt;Before we dive in, let’s make sure you’ve got everything you need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Node.js&lt;/strong&gt;  Installed on your computer (download it from &lt;a href="https://nodejs.org/en" rel="noopener noreferrer"&gt;nodejs.org&lt;/a&gt; if you haven’t already).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Basic React Knowledge:&lt;/strong&gt; You should know how components, hooks (like useEffect), and JSX work.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ZEGOCLOUD Account:&lt;/strong&gt; Sign up at &lt;a href="https://www.zegocloud.com/" rel="noopener noreferrer"&gt;ZEGOCLOUD’s website &lt;/a&gt;to get your App ID and Server Secret.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Text Editor:&lt;/strong&gt;  Something like VS Code works great.&lt;br&gt;
Once you’ve got these ready, we’re good to go!&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm34idc48ufajzy0gznib.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm34idc48ufajzy0gznib.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F50mg1b5pplku237mb21a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F50mg1b5pplku237mb21a.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Setting Up the React Project :-
&lt;/h2&gt;

&lt;p&gt;First, we need a React project to work with. We’ll use Vite, a fast tool for creating React apps (though you could use Create React App if you prefer). Open your terminal and type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm create vite@latest video-call-app --template react
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This creates a new project called video-call-app. Now, move into that folder:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd video-call-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Start the development server to make sure everything’s working:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;You should see a basic React app running at &lt;a href="http://localhost:5173" rel="noopener noreferrer"&gt;http://localhost:5173&lt;/a&gt;. Great! We’ve got our foundation.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 2: Installing the ZEGOCLOUD SDK :-
&lt;/h2&gt;

&lt;p&gt;Next, we need to add the ZEGOCLOUD SDK to our project. This SDK gives us all the tools to handle video calls. Run this command in your terminal:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install zego-express-engine-webrtc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This installs the ZEGOCLOUD WebRTC SDK, which is perfect for web apps like ours. Once it’s done, you’ll see it added to your package.json.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 3: Importing and Initializing the SDK :-
&lt;/h2&gt;

&lt;p&gt;Now, let’s set up the SDK in our app. Open src/App.jsx (or src/App.js if you’re using JavaScript instead of JSX) and replace its contents with this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { useEffect } from 'react';
import { ZegoExpressEngine } from 'zego-express-engine-webrtc';

function App() {
  useEffect(() =&amp;gt; {
    const appID = import.meta.env.VITE_ZEGO_APP_ID;
    const serverSecret = import.meta.env.VITE_ZEGO_SERVER_SECRET;
    const zg = new ZegoExpressEngine(appID, serverSecret);
    console.log('ZEGOCLOUD SDK initialized!');
  }, []);

  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;My Video Call App&amp;lt;/h1&amp;gt;
      &amp;lt;div id="local-video"&amp;gt;&amp;lt;/div&amp;gt;
      &amp;lt;div id="remote-video"&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

export default App;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;What’s Happening Here?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Imports:&lt;/strong&gt;  We bring in React’s  &lt;strong&gt;useEffect&lt;/strong&gt; hook and the &lt;strong&gt;ZegoExpressEngine&lt;/strong&gt; from the SDK.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;useEffect:&lt;/strong&gt;  This hook runs code when the component loads. Here, it initializes the ZEGOCLOUD SDK with an App ID and Server Secret.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;HTML:&lt;/strong&gt;  We’ve added two &lt;strong&gt;div&lt;/strong&gt; elements with IDs &lt;strong&gt;local-video&lt;/strong&gt;  and &lt;strong&gt;remote-video&lt;/strong&gt;. These will hold our video streams later.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But wait — where do &lt;strong&gt;VITE_ZEGO_APP_ID&lt;/strong&gt; and &lt;strong&gt;VITE_ZEGO_SERVER_SECRET&lt;/strong&gt; come from? We need to set them up as environment variables.&lt;/p&gt;
&lt;h2&gt;
  
  
  Setting Up Environment Variables :-
&lt;/h2&gt;

&lt;p&gt;In your project’s root folder, create a file called &lt;strong&gt;.env&lt;/strong&gt; and add these lines&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;VITE_ZEGO_APP_ID=your_app_id_here
VITE_ZEGO_SERVER_SECRET=your_server_secret_here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Replace &lt;strong&gt;your_app_id_here&lt;/strong&gt; and &lt;strong&gt;your_server_secret_here&lt;/strong&gt; with the actual values from your ZEGOCLOUD console. Since we’re using Vite, environment variables start with &lt;strong&gt;VITE_&lt;/strong&gt; and are accessed with &lt;strong&gt;import.meta.env.&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 4: Joining a Room :-
&lt;/h2&gt;

&lt;p&gt;In ZEGOCLOUD, a “room” is like a virtual meeting space where users connect for a video call. To join one, we use the &lt;strong&gt;loginRoom&lt;/strong&gt; method. Update the &lt;strong&gt;useEffect&lt;/strong&gt; block in &lt;strong&gt;App.jsx&lt;/strong&gt; like this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;useEffect(() =&amp;gt; {
  const appID = import.meta.env.VITE_ZEGO_APP_ID;
  const serverSecret = import.meta.env.VITE_ZEGO_SERVER_SECRET;
  const zg = new ZegoExpressEngine(appID, serverSecret);

  const roomID = 'zego-room'; // Change this to anything you like
  const userID = 'user123'; // A unique ID for the user
  const userName = 'John Doe';
  const token = 'your_token_here'; // Replace with a real token

  zg.loginRoom(roomID, token, { userID, userName }, { userUpdate: true })
    .then(() =&amp;gt; {
      console.log('Successfully joined the room!');
    })
    .catch(error =&amp;gt; {
      console.error('Error joining room:', error);
    });
}, []);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;What’s This Code Doing?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Variables:&lt;/strong&gt;  We define a &lt;strong&gt;roomID&lt;/strong&gt; (the room’s name), &lt;strong&gt;userID&lt;/strong&gt; (a unique identifier for you), and  &lt;strong&gt;userName&lt;/strong&gt;. The &lt;strong&gt;token&lt;/strong&gt; is for authentication.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;loginRoom:&lt;/strong&gt; This method connects us to the room. The { &lt;strong&gt;userUpdate: true&lt;/strong&gt;} option ensures we get updates about other users in the room.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Important Note:&lt;/strong&gt; The token is a placeholder here. In a real app, you’d generate this securely on a server using your App ID and Server Secret. For this tutorial, you can use a test token from ZEGOCLOUD’s documentation, but don’t hardcode it in production!&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 5: Creating a Local Audio and Video Stream :-
&lt;/h2&gt;

&lt;p&gt;Now that we’re in the room, let’s capture our audio and video (like turning on your webcam and mic). Add this code inside the &lt;strong&gt;.then()&lt;/strong&gt; block:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;zg.loginRoom(roomID, token, { userID, userName }, { userUpdate: true })
  .then(() =&amp;gt; {
    console.log('Successfully joined the room!');
    return zg.createStream({ camera: { audio: true, video: true } });
  })
  .then(localStream =&amp;gt; {
    console.log('Local stream created!');
  })
  .catch(error =&amp;gt; {
    console.error('Error:', error);
  });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;createStream:&lt;/strong&gt;  This method uses your device’s camera and microphone to create a stream. The { &lt;strong&gt;audio: true, video: true&lt;/strong&gt; } options enable both.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;localStream:&lt;/strong&gt; This is the stream object we’ll use next to share our video.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your browser asks for camera/mic permissions, allow it — otherwise, this won’t work!&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 6: Starting the Video Call :-
&lt;/h2&gt;

&lt;p&gt;To let others see and hear us, we need to “publish” our stream to the room. Add this inside the second .then() block:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.then(localStream =&amp;gt; {
  const streamID = 'stream_' + userID; // Unique ID for the stream
  zg.startPublishingStream(streamID, localStream);
  console.log('Stream published!');
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;streamID:&lt;/strong&gt;  A unique identifier for our stream (we’re just adding the userID to make it simple).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;startPublishingStream:&lt;/strong&gt; This sends our audio and video to the room.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, our stream is live for others to see!&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 7: Rendering Video Streams :-
&lt;/h2&gt;

&lt;p&gt;Finally, let’s display the video streams — ours (local) and anyone else’s (remote).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Showing the Local Stream&lt;/strong&gt;&lt;br&gt;
Add this code after publishing the stream:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.then(localStream =&amp;gt; {
  const streamID = 'stream_' + userID;
  zg.startPublishingStream(streamID, localStream);

  const localVideo = document.getElementById('local-video');
  const videoElement = document.createElement('video');
  videoElement.autoplay = true;
  videoElement.muted = true; // Mute local audio to avoid echo
  videoElement.srcObject = localStream;
  localVideo.appendChild(videoElement);
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;videoElement:&lt;/strong&gt;  We create a  &amp;lt;video&amp;gt; tag dynamically, set it to autoplay, and mute it (so you don’t hear yourself).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;srcObject:&lt;/strong&gt; This attaches our localStream to the video element.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Showing Remote Streams&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To see other people’s streams, we need to listen for updates. Add this event listener right after initializing zg:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;useEffect(() =&amp;gt; {
  const appID = import.meta.env.VITE_ZEGO_APP_ID;
  const serverSecret = import.meta.env.VITE_ZEGO_SERVER_SECRET;
  const zg = new ZegoExpressEngine(appID, serverSecret);

  zg.on('roomStreamUpdate', async (roomID, updateType, streamList) =&amp;gt; {
    if (updateType === 'ADD') {
      const remoteVideo = document.getElementById('remote-video');
      streamList.forEach(stream =&amp;gt; {
        const vd = document.createElement('video');
        vd.id = stream.streamID;
        vd.autoplay = true;
        vd.playsInline = true;
        vd.muted = false;
        remoteVideo.appendChild(vd);
        zg.startPlayingStream(stream.streamID, { audio: true, video: true })
          .then(stream =&amp;gt; {
            vd.srcObject = stream;
          });
      });
    } else if (updateType === 'DELETE') {
      streamList.forEach(stream =&amp;gt; {
        const vd = document.getElementById(stream.streamID);
        if (vd) {
          vd.remove();
        }
      });
    }
  });

  // Rest of the code (loginRoom, etc.) goes here
}, []);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;roomStreamUpdate:&lt;/strong&gt;  This event fires when streams are added or removed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ADD:&lt;/strong&gt; When a new stream appears, we create a &amp;lt;video&amp;gt; and play it with startPlayingStream.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;DELETE:&lt;/strong&gt; When someone leaves, we remove their video.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  The Full Code
&lt;/h2&gt;

&lt;p&gt;Here’s everything put together in App.jsx:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { useEffect } from 'react';
import { ZegoExpressEngine } from 'zego-express-engine-webrtc';

function App() {
  useEffect(() =&amp;gt; {
    const appID = import.meta.env.VITE_ZEGO_APP_ID;
    const serverSecret = import.meta.env.VITE_ZEGO_SERVER_SECRET;
    const zg = new ZegoExpressEngine(appID, serverSecret);

    zg.on('roomStreamUpdate', async (roomID, updateType, streamList) =&amp;gt; {
      if (updateType === 'ADD') {
        const remoteVideo = document.getElementById('remote-video');
        streamList.forEach(stream =&amp;gt; {
          const vd = document.createElement('video');
          vd.id = stream.streamID;
          vd.autoplay = true;
          vd.playsInline = true;
          vd.muted = false;
          remoteVideo.appendChild(vd);
          zg.startPlayingStream(stream.streamID, { audio: true, video: true })
            .then(stream =&amp;gt; {
              vd.srcObject = stream;
            });
        });
      } else if (updateType === 'DELETE') {
        streamList.forEach(stream =&amp;gt; {
          const vd = document.getElementById(stream.streamID);
          if (vd) {
            vd.remove();
          }
        });
      }
    });

    const roomID = 'zego-room';
    const userID = 'user123';
    const userName = 'John Doe';
    const token = 'your_token_here'; // Replace with a real token

    zg.loginRoom(roomID, token, { userID, userName }, { userUpdate: true })
      .then(() =&amp;gt; {
        console.log('Successfully joined the room!');
        return zg.createStream({ camera: { audio: true, video: true } });
      })
      .then(localStream =&amp;gt; {
        const streamID = 'stream_' + userID;
        zg.startPublishingStream(streamID, localStream);

        const localVideo = document.getElementById('local-video');
        const videoElement = document.createElement('video');
        videoElement.autoplay = true;
        videoElement.muted = true;
        videoElement.srcObject = localStream;
        localVideo.appendChild(videoElement);
      })
      .catch(error =&amp;gt; {
        console.error('Error:', error);
      });
  }, []);

  return (
    &amp;lt;div&amp;gt;
      &amp;lt;h1&amp;gt;My Video Call App&amp;lt;/h1&amp;gt;
      &amp;lt;div id="local-video"&amp;gt;&amp;lt;/div&amp;gt;
      &amp;lt;div id="remote-video"&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

export default App;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Testing Your App&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Run &lt;strong&gt;npm run dev&lt;/strong&gt; and open &lt;strong&gt;&lt;a href="http://localhost:5173" rel="noopener noreferrer"&gt;http://localhost:5173&lt;/a&gt;&lt;/strong&gt;. You should see your video in the &lt;strong&gt;local-video&lt;/strong&gt; div. To test with another user, open the app in a second browser tab (or another device) with a different &lt;strong&gt;userID&lt;/strong&gt;. Their video should appear in the &lt;strong&gt;remote-video&lt;/strong&gt; div.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq7lj582mmbatm057p8l7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq7lj582mmbatm057p8l7.png" alt="Image description" width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;And there you have it — a fully functional video call app built with &lt;strong&gt;React JS&lt;/strong&gt; and &lt;strong&gt;ZEGOCLOUD&lt;/strong&gt;! We’ve covered setting up the project, integrating the SDK, joining a room, creating streams, and displaying videos. It’s a solid starting point, but ZEGOCLOUD offers way more — like screen sharing or call recording — if you want to take it further.&lt;/p&gt;

&lt;p&gt;For a real app, make sure to generate tokens securely on a server and add error handling. Check out &lt;a href="https://www.zegocloud.com/docs" rel="noopener noreferrer"&gt;ZEGOCLOUD’s official docs&lt;/a&gt; for more ideas.&lt;/p&gt;

&lt;p&gt;Happy coding, and enjoy your new video call app!&lt;/p&gt;

&lt;p&gt;written by shubham Pandey&lt;/p&gt;

&lt;p&gt;for video tutorial watch this :-&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;a href="https://www.youtube.com/watch?si=qnyPL181l-dn9VGD&amp;amp;v=v7sL2P2H8ls&amp;amp;feature=youtu.be" rel="noopener noreferrer"&gt;
      youtube.com
    &lt;/a&gt;
&lt;/div&gt;



</description>
      <category>react</category>
      <category>zegocloud</category>
      <category>videocallapp</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
