Collaborative Whiteboard
  • iOS
  • Android
  • Web
  • Electron : JavaScript
  • Windows
  • macOS
  • Overview
  • SDK downloads
  • Demo app
  • Sample codes
  • Development guide
  • Quick starts
  • Error codes
  • Server APIs
  • Documentation
  • Collaborative Whiteboard
  • Sample codes
Sample codes
GitHub download
  • "class="dropdown-option"> GitHub
  • The sample source code is for reference only when the developer accesses it. ZEGO is not responsible for the follow-up maintenance of the sample source code.
  • If the developer plans to use the sample source code in a production environment, please make sure to conduct sufficient testing before release to avoid potential problems and losses.
  • ZEGO has unified the concept of environment, and there is no longer a formal/testing distinction. 2021-11-16 and previous users who created projects in ZEGO Admin Console, please refer to Test Environment Obsolete instructions Perform SDK upgrade and adjust related code.

1 Sample source code operation guide

1.1 Preparing the environment

Before starting to integrate the SDK, please make sure that the development environment meets the following requirements:

  • Electron 7.0.0 and above.
  • Operating system Windows 7 and above / macOS 10.10 and above system.
  • Node environment has been installed, it is recommended to use the long-term support version shown on the homepage of its official website
Platform Remarks
Windows 32-bit node
macOS 64-bit node

You can go to node official website to download and refer to Tutorial to install.

1.2 Prerequisites

Please go to the ZEGO Admin Console to register an account and apply for the AppID and AppSign required to initialize the SDK. For the application process, please refer to Project Management.

1.3 Example source code project structure

├─ .gitignore
├─ .prettierrc.js
├─ biz.js // API Specific usage example
├─ index.html // Project entry file
├─ lib
├─ main.js
├─ pack.config.js
├─ sdk
│  ├─ biz.js // API Specific usage example
│  ├─ init.js // Initialize SDK related
│  ├─ init_express.js // Initialize SDK related
│  ├─ zego-express-docsview-electron // File SDK
│  └─ zego-express-engine-electron // Whiteboard SDK
├─ style.css
└─ style_login.css

1.4 Matters needing attention

The downloaded sample source code lacks the AppID and AppSign required for SDK initialization, and the whiteboard_demo/sdk/init.js file needs to be modified. Please use the AppID and AppSign obtained in the "Prerequisites" of this article to fill in correctly.

// APP account
var _openConfig = {
    appID: 0, // Please fill in the APPID you applied for
    appSignStr: '', // Please fill in the APPSIGN you applied for
    sdkPath: {
        express: './sdk/zego-express-engine-electron/ZegoExpressEngine.js',
        expressWb: './sdk/zego-express-engine-electron/ZegoWhiteBoardView.js',
        docs: './sdk/zego-express-docsview-electron'

1.5 Run the sample source code

  1. Switch to the project directory in Terminal and execute yarn install or npm install command to install dependencies.

  2. Execute the yarn start or npm run start command in Terminal to run the sample source code, and the login window will pop up automatically after the run is successful.

Execute the Control+C command in Terminal to stop the operation.

Page Directory