tencent cloud



Last updated: 2022-05-30 14:38:40

    This document describes how to quickly run the IM demo for Electron.

    Environment Requirements

    Platform Version
    Electron v13.1.5 or later
    Node.js v14.2.0


    You have signed up for a Tencent Cloud account and completed identity verification.


    Step 1. Create an app

    1. Log in to the IM console.

      If you already have an app, record its SDKAppID and obtain key information.
      A Tencent Cloud account can create a maximum of 300 IM apps. If you want to create a new app, disable and delete an unwanted app first. Once an app (along with its SDKAppID) is deleted, the provided services and all its data are lost. Please proceed with caution.

    2. Click Create Application, enter your app name, and click Confirm.
    3. After creation, you can see the status, service version, SDKAppID, tag, creation time, and expiry time of the new app on the overview page of the console. Record the SDKAppID.
    4. Click the created app. In the left sidebar, click Auxiliary Tools > UserSig Tools to create a UserID and the corresponding UserSig. Then copy the UserSig for future login.

    Step 2. Download source code, install dependencies, and run the project

    1. Clone the source code of the IM Electron demo to the local system.
      git clone https://github.com/tencentyun/im_electron_demo.git
    1. Install project dependencies.
      // Root directory of the project
      npm install
      // Rendering process directory
      cd src/client
      npm install
    1. Run the project.
      // Root directory of the project
      npm start
    1. Build the project.
      // Build the project in macOS
      npm run build:mac
      // Build the project in Windows
      npm run build:windows


    What platforms are supported?

    Currently, both macOS and Windows platforms are supported.

    What should I do if the error gypgyp ERR!ERR is reported during development environment installation?

    Please see gypgyp ERR!ERR! .

    What should I do if the screen turns white when I run npm run start on Mac?

    The error occurs because the rendering process code is not completely built and the port 3000 opened by the main process points to an empty page. The error will be resolved after the rendering process code is completely built and you refresh the window. Alternatively, you can run cd src/client && npm run dev:react and npm run dev:electron to start the rendering process and main process separately.

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support