Compile and run a sample project

Updated

Compile and run a project using Agora SDK

Agora provides Open-source sample projects on GitHub to demonstrate the implementation of basic and advanced Voice SDK features.

This page shows how to compile, configure, and run the Voice SDK ReactJS sample project.

Prerequisites

Project setup

Get the sample project

Run the following command to clone the GitHub repository locally:

git clone https://github.com/AgoraIO/API-Examples-Web

The GitHub examples repository provides the following projects:

DescriptionPath
Feature demos/Demo
Extension demos/ExtensionDemo
Vue framework examples/vue/api-examples
React framework examples/react/api-examples

Configure the sample project

Navigate to /react/api-examples and run the following command to install the dependencies.

npm install

Run the sample project

  1. Use the following command to run the sample project.

    npm run dev
  2. On the demo page, enter your App ID, token, and channel name and join the channel.

    The channel name must be the same as the channel ID you used to generate the token.