Read the full tutorial here:
>> How to make CometChat work with react-chat-elements
This example shows how to build a chat app with React and react-chat-elements:
This demo uses:
- CometChat Pro 2.0.0
- React 16.10.2
- react-chat-elements 10.7.1
To run the demo follow these steps:
- Head to CometChat Pro and create an account
- From the dashboard, create a new v2 app called "react-chat-elements"
- Once created, click Explore
- Go to the API Keys tab
- Copy the API key called "react-chat-elements" with Full Access
- Download the repository here or by running
git clone https://github.com/mihailgaberov/react-chat-elements-app.git
and open it in your favorite IDE. - Create a .env file in the project directory with your newly-created credentials, such as:
REACT_APP_ID=your app ID
REACT_APP_API_KEY=your key
REACT_APP_REGION=your region (e.g. 'eu' or 'us')
- Install the project dependencies via:
npm i
- Run the app via:
npm start
- Once the app loads the login screen use one of the test users: superhero1, superhero2 or superhero3 to login
_Note: The best way to test it locally is to open two instances of your browser, one in normal mode and one in incognito mode. When doing multiple tests, make sure your local storage is empty or you will be logged as the user whose details are already recorded there, for example "superhero3". _
Questions about running the demo? Open an issue. We're here to help ✌️