# Compile and run a sample project (/en/realtime-media/broadcast-streaming/build/set-up-your-project/compile-run-sample-project/react-native)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

Agora provides [Open-source sample projects on GitHub](https://github.com/AgoraIO-Extensions/react-native-agora/tree/main/example) to demonstrate the implementation of basic and advanced Video SDK features.

This page shows how to compile, configure, and run the Video SDK React Native sample project.

## Prerequisites

* React Native 0.60 or later. For more information, see [Get Started with React Native](https://reactnative.dev/docs/environment-setup).
* Node 16 or later

For your target platform, prepare the following:

<Tabs defaultValue="android" groupId="react-native-host-os">
  <TabsList>
    <TabsTrigger value="android">
      Android
    </TabsTrigger>

    <TabsTrigger value="ios">
      iOS
    </TabsTrigger>
  </TabsList>

  <TabsContent value="android">
    * A machine running macOS, Windows, or Linux
    * [Java Development Kit (JDK) 11](https://openjdk.org/projects/jdk/11/) or later
    * Latest version of Android Studio
    * A physical or virtual mobile device running Android 5.0 or later
  </TabsContent>

  <TabsContent value="ios">
    * A machine running macOS
    * Xcode 10 or later
    * CocoaPods
    * A physical or virtual mobile device running iOS 9.0 or later.
      If you use React Native 0.63 or later, ensure your iOS version is 10.0 or later.
  </TabsContent>
</Tabs>

* A camera and a microphone

* A valid Agora account and project. Please refer to [Agora account management](/en/introduction/account) for details.

* Installed [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)

## Project setup

### Get the sample project

Run the following command to clone the repository locally:

```bash
git clone git@github.com:AgoraIO-Extensions/react-native-agora.git
```

This repository contains sample projects for Agora Video SDK:

| Description                                       | Path                             |
| :------------------------------------------------ | :------------------------------- |
| Basic functions                                   | `/example/src/examples/basic`    |
| Advanced features                                 | `/example/src/examples/advanced` |
| [Hook](https://react.dev/reference/react) example | `/example/src/examples/hook`     |

### Configure the sample project

1. Install dependencies

Switch to the root directory and run the following commands to integrate the SDK and install dependencies:

```bash
yarn
```

2. Set your App ID and App Token

Open the `/example/src/config/agora.config.ts` file and fill in the App ID and temporary token you obtained from the Agora Console.

```typescript
// Agora App ID
let localAppId = '';
try {
  localAppId = require('./appID').default;
  console.log('appID', localAppId);
} catch (error) {
  console.warn(error);
}

const config = {
  appId: localAppId,
  // Agora app token
  token: '',
  // Agora channel ID
  channelId: 'test',
  uid: 0,
  logFilePath: '',
};

export default config;
```

## Run the sample project

1. Execute the following command in the project root directory to run the sample project.

   * Target platform Android

     ```bash
     yarn example android
     ```

   * Target platform iOS

     ```bash
     yarn example ios
     ```

2. After the operation is complete, the following application appears on your device:

   ![image](https://assets-docs.agora.io/images/video-sdk/run-compile-rn-step-2.png)

Showing Android as an example

3. Select the demo you want to experience from the menu. Choose **JoinChannelVideo** under **Basic** as an example, and click **join channel**.

   ![image](https://assets-docs.agora.io/images/video-sdk/run-compile-rn-step-3.png)

4. To test various audio and video interaction use-cases, connect to the [Agora web demo](https://webdemo.agora.io/basicVideoCall/index.html), or install and run the sample project on a second device. Make sure you use the same app ID on both devices. When you join the same channel from two devices, you can see and hear each other.

    
  
      
  
      
  
      
  
      
  
      
  
