> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-rn-guide-message-privately.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Overview of Overview in CometChat.

Our React Chat UI Kit lets developers easily add text, voice & video to your website. It a fully polished UI and the complete business logic.

Don't forget to check out the [Key Concepts](/ui-kit/react/v3/key-concepts) for your React Chat UI Kit before proceeding.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/NN4EdpOU3viwWMb_/images/0e955585-1623200296-a5319a2568392198711896c260286a7a.png?fit=max&auto=format&n=NN4EdpOU3viwWMb_&q=85&s=c88ed8be7ac89f37a5f30dc75eed907b" width="1440" height="900" data-path="images/0e955585-1623200296-a5319a2568392198711896c260286a7a.png" />
</Frame>

<Tip>
  What's New in v3

  * Seamless scaling to over 1M+ concurrent users
  * Faster connection & response times
  * Higher rate limits
  * Supports up to 100K users in a group
  * Unlimited groups
  * Support for Transient Messages
  * Real-time user & group members count
  * And more!
</Tip>

CometChat's React UI Kit’s customizable UI components simplify the process of integrating text chat and voice/video calling features to your website or mobile application in a few minutes.

<CardGroup>
  <Card title="I want to checkout React UI Kit">
    Follow the steps mentioned in the `README.md` file.

    Kindly, click on below button to download our React UI Kit.

    [React UI Kit](https://github.com/cometchat-pro/cometchat-pro-react-ui-kit/archive/master.zip)

    [View on Github](https://github.com/cometchat/cometchat-chat-uikit-react/tree/v3)
  </Card>

  <Card title="I want to explore the sample app">
    Kindly, click on below button to download our React Sample App.

    [React Sample App](https://github.com/cometchat-pro/javascript-react-chat-app/archive/master.zip)

    [View on Github](https://github.com/cometchat/cometchat-chat-sample-app-react/tree/v3)
  </Card>
</CardGroup>

***

## Prerequisites

Before you begin, ensure you have met the following requirements:

1. A text editor. (e.g. Visual Studio Code, Notepad++, Sublime Text, Atom, or VIM)
2. [Node](https://nodejs.org/en/)
3. [npm](https://www.npmjs.com/get-npm)
4. [React](https://reactjs.org/)

<Tabs>
  <Tab title="CLI">
    ```sh theme={null}
    npm install react@17.0.2
    ```
  </Tab>
</Tabs>

5. [React DOM](https://reactjs.org/docs/react-dom.html)

<Tabs>
  <Tab title="CLI">
    ```sh theme={null}
    npm install react-dom@17.0.2
    ```
  </Tab>
</Tabs>

6. [React Scripts](https://www.npmjs.com/package/react-scripts)

<Tabs>
  <Tab title="CLI">
    ```sh theme={null}
    npm install react-scripts@4.0.3
    ```
  </Tab>
</Tabs>

## Installing the React Chat UI Kit

<Warning>
  Important

  Please follow the steps provided in the [Key Concepts](/ui-kit/react/v3/key-concepts) to create V3 apps before you proceed.
</Warning>

### Setup

1. Register on CometChat

   * To install React UI Kit, you need to first register on the CometChat Dashboard. Click [here](https://app.cometchat.com) to Sign Up.

2. Get your application keys

   * Create a new app.
   * Head over to the QuickStart or API & Auth Keys section and note the App ID, Auth Key, and Region.

3. Add the CometChat dependency

<Tabs>
  <Tab title="CLI">
    ```sh theme={null}
    npm install @cometchat-pro/chat@3.0.11 --save
    ```
  </Tab>
</Tabs>

### Configure CometChat inside your app

* Import CometChat SDK

<Tabs>
  <Tab title="JavaScript">
    ```js theme={null}
    import { CometChat } from "@cometchat-pro/chat";
    ```
  </Tab>
</Tabs>

* Initialize CometChat

The init() method initializes the settings required for CometChat. We suggest calling the init() method on app startup, preferably in the index.js file.

<Tabs>
  <Tab title="JavaScript">
    ```js theme={null}
    const appID = "APP_ID";
    const region = "REGION";
    const appSetting = new CometChat.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(region).build();
    CometChat.init(appID, appSetting).then(
      () => {
        console.log("Initialization completed successfully");
        // You can now call login function.
      },
      error => {
        console.log("Initialization failed with error:", error);
        // Check the reason for error and take appropriate action.
      }
    );
    ```
  </Tab>
</Tabs>

<Warning>
  Replace APP\_ID and REGION with your CometChat App ID and Region in the above code.
</Warning>

* Create user

This method takes a `User` object and the `Auth Key` as input parameters and returns the created `User` object if the request is successful.

<Tabs>
  <Tab title="JavaScript">
    ```js theme={null}
    let authKey = "AUTH_KEY";
    var uid = "user1";
    var name = "Kevin";

    var user = new CometChat.User(uid);
    user.setName(name);
    CometChat.createUser(user, authKey).then(
        user => {
            console.log("user created", user);
        },error => {
            console.log("error", error);
        }
    )
    ```
  </Tab>
</Tabs>

<Warning>
  Replace AUTH\_KEY with your CometChat Auth Key in the above code.
</Warning>

* Login your user

This method takes `UID` and `Auth Key` as input parameters and returns the User object containing all the information of the logged-in user.

<Tabs>
  <Tab title="JavaScript">
    ```js theme={null}
    const authKey = "AUTH_KEY";
    const uid = "cometchat-uid-1";

    CometChat.login(uid, authKey).then(
      user => {
        console.log("Login Successful:", { user });
      },
      error => {
        console.log("Login failed with exception:", { error });
      }
    );
    ```
  </Tab>
</Tabs>

<Warning>
  Replace AUTH\_KEY with your CometChat Auth Key in the above code.
</Warning>

<Note>
  We have set up 5 users for testing having UIDs: cometchat-uid-1, cometchat-uid-2, cometchat-uid-3, cometchat-uid-4, and cometchat-uid-5.

  We have used uid cometchat-uid-1 as an example here. You can create a User from CometChat Dashboard as well.
</Note>

### Add the React UI Kit to your project

* Clone this repository

<Tabs>
  <Tab title="CLI">
    ```sh theme={null}
    git clone https://github.com/cometchat-pro/cometchat-pro-react-ui-kit.git
    ```
  </Tab>
</Tabs>

* Copy the cloned repository to your source folder

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/mNTojjz_O28of40c/images/fab909d0-5p1s5fydgt07yucxkvc52f3eb71ggc3b2fxpxbxrtqjwlu6ucprecaafptqsubcv-94951ebb3d447224908dac25b847a778.png?fit=max&auto=format&n=mNTojjz_O28of40c&q=85&s=d5a6915c5eacfc41104815d8b1f6bbcc" width="312" height="584" data-path="images/fab909d0-5p1s5fydgt07yucxkvc52f3eb71ggc3b2fxpxbxrtqjwlu6ucprecaafptqsubcv-94951ebb3d447224908dac25b847a778.png" />
</Frame>

* Copy all the dependencies from package.json into your project's package.json and install them

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/mkn0UqPQ5BXljCV1/images/97cd783d-n4xhanpy3xmvh13e5qh2hk84kojuiotug2silsban3mju3g9rezxm3m3cr8jvn22-1cb20c52b175591aadfd077bb97f6034.png?fit=max&auto=format&n=mkn0UqPQ5BXljCV1&q=85&s=032fdf30bfb518cb0d849792b66b4053" width="720" height="487" data-path="images/97cd783d-n4xhanpy3xmvh13e5qh2hk84kojuiotug2silsban3mju3g9rezxm3m3cr8jvn22-1cb20c52b175591aadfd077bb97f6034.png" />
</Frame>

### Launch CometChat

Using the CometChatUI component, you can launch a fully functional chat application. In this component, all the UI Screens and UI Components are interlinked and work together to launch a fully functional chat on your website/application.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/k0f_g7UwNe_JINeP/images/4574e56a-1623200307-fcc7e751c1f740c4a693bfdb14354be8.gif?s=30ae5ac9e115d98a88ddee30418eee98" width="800" height="375" data-path="images/4574e56a-1623200307-fcc7e751c1f740c4a693bfdb14354be8.gif" />
</Frame>

### Usage

<Tabs>
  <Tab title="React">
    ```js theme={null}
    import { CometChatUI } from "./CometChatWorkspace/src";

    class App extends React.Component {

      render() {

        return (
          <div style={{width: '800px', height:'800px' }}>
          	<CometChatUI />
          </div>
    	  );
    	}
    }
    ```
  </Tab>
</Tabs>

## Check out our React chat sample app

Visit our [React sample app](https://github.com/cometchat/cometchat-chat-sample-app-react/tree/v3) repository to run the sample app yourself.
