Skip to content

cometchat-pro-tutorials/react-chat-elements-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

“How to make CometChat work with react-chat-elements” - tutorial app

Read the full tutorial here:

>> How to make CometChat work with react-chat-elements

>> Live Demo Here

This example shows how to build a chat app with React and react-chat-elements:

Screenshots

screenshot

Technology

This demo uses:

  • CometChat Pro 2.0.0
  • React 16.10.2
  • react-chat-elements 10.7.1

Running the demo

To run the demo follow these steps:

  1. Head to CometChat Pro and create an account
  2. From the dashboard, create a new v2 app called "react-chat-elements"
  3. Once created, click Explore
  4. Go to the API Keys tab
  5. Copy the API key called "react-chat-elements" with Full Access
  6. 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.
  7. 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')
  1. Install the project dependencies via: npm i
  2. Run the app via: npm start
  3. 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 ✌️

Useful links