Read the full tutorial here:
>> Build a desktop chat app with CometChat, React and Nw.js
This example shows how to build a desktop chat app with React and Nw.js:
This demo uses:
- CometChat Pro 1.4.1
- React 16.8.6
- Redux 4.0.1
- redux-thunk 2.3.0
- Nw.js 0.38.2-sdk
To run the demo follow these steps:
- Head to CometChat Pro and create an account
- From the dashboard, create a new app called "desktop-chat-nw"
- Once created, click Explore
- Go to the API Keys tab and click Create API Key
- Create an API key called "desktop-chat-nw" with Full Access
- Download the repository here or by running
git clone https://github.com/mihailgaberov/desktop-chat-nw.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
- Install the project dependencies via:
npm i
- Run the app via:
npm run launch
- Once the app loads the login screen use one of the test users: superhero1, superhero2, superhero3, superhero4 or superhero5 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 ✌️