In-app Chat Kit
  • iOS
  • Android
  • Web : JavaScript
  • Flutter
  • React Native
  • Overview
  • Quick start
    • Integrate the SDK
    • Start a chat
  • Run the sample code
  • UI components
    • Overview
    • Conversation component
    • Message component
  • SDK downloads
  • Release notes

Run the sample code

Last updated:2022-12-23 12:49

Sample code (Vue)
Download
Sample code (React)
Download

Overview

The following describes how to run the sample code of the In-app Chat Kit.

Prerequisites

  • Go to ZEGOCLOUD Admin Console and do the following:

    1. Create a project, and get the AppID and ServerSecret of your project.
    2. Subscribe to the In-app Chat service (Contact technical support if the subscript doesn’t go well).
  • Platform-specific requirements:

    • Chrome 58 or later.
    • Node.js 14.18.1 or later
    • The device is connected to the internet.

Run the sample code (Vue)

  1. Download the sample code, open the keyCenter.ts file under the Samples/ZIMKitDemo/src directory using VSCode (or other programming software), and fill in the appID and serverSecret you get from the ZEGOCLOUD Admin Console.
    const appConfig = {
        appID: 0,         // The AppID you get from ZEGOCLOUD Admin Console.
        serverSecret: '', // The ServerSecret you get from ZEGOCLOUD Admin Console.
    };
  1. In Terminal, use the cd command to navigate to the Samples/ZIMKitDemo directory, and run the following command in order to run the sample code.
     npm install   # Install dependencies.
     npm run serve # After installing the dependencies, execute this to run the project.

Run the sample code (React)

  1. Download the sample code, open the keyCenter.ts file under the Samples/ZIMKitDemo/src directory using VSCode (or other programming software), and fill in the appID and serverSecret you get from the ZEGOCLOUD Admin Console.
    const appConfig = {
        appID: 0,         // The AppID you get from ZEGOCLOUD Admin Console.
        serverSecret: '', // The ServerSecret you get from ZEGOCLOUD Admin Console.
    };
  1. In Terminal, use the cd command to navigate to the Samples/ZIMKitDemo directory, and run the following command in order to run the sample code.
    npm install # Install dependencies.
    npm start   # After installing the dependencies, execute this to run the project. 

Congratulations! So far, you have finished all the steps, and this is what you gonna see when the sample code is run successfully:

More to explore

Get support

Need help or want to raise your questions? Click the button below to join our Discord community to get quick responses.

Join Discord community
Page Directory