The following describe how to run the sample code of the In-app Chat UIKit.
Before you begin, make sure your environment meets the following:
- Chrome 58 or later.
- Node.js 14.18.1 or later
- The device is connected to the internet.
- Go to ZEGOCLOUD Admin Console|_blank and do the following:
- Create a project, and get the
AppID
andServerSecret
of your project. - Subscribe the In-app Chat service.
- Create a project, and get the
├── README.md # README file
├── package.json
├── public
├── src
│ ├── pages # Business component directory
│ ├── store # Business state management
│ ├── util # Utilities
│ ├── ZIMKit # In-app Chat UIKit SDK
│ ├── index.jsx # Project entry file
│ ├── config.js # SDK config file
├── tsconfig.json # ts config file
-
Download the sample code, open the
config.js
file under the src`` folder, and fill in the AppID and ServerSecret you get from the ZEGOCLOUD Admin Console. If you generate the Token using your own server, fill in the method that used to generate the Token in thetokenURL
.const appConfig = { appID: 0, // Fill in the App ID you get. serverSecret: '' // Run the ServerSecret you get. tokenURL: '' // Your API method that used to generate Tokens. };
-
Run the following code in order to run the sample code.
npm install # Install dependencies.
npm start # After installing the dependencies, execute this to run the project.