Special offer for new TRTC customers! Save  $100 on your first subscription.
Special offer for new TRTC customers! Save  $100 on your first subscription.
Grab It Now 


Last updated: 2023-09-11 17:52:37Download PDF
This document shows you how to quickly run TRTC-API-Example (Electron).



Step 1. Create an application

1. Log in to the TRTC console and select RTC Engine on the left sidebar.
2. Click Start now, enter an application name such as APIExample. If you already have an application, click link existing application.
3. Add or edit tags according to your actual business needs and click Create application.

step 2. Get your SDKAppId and SecretKey

After your application created, you can get your SDKAppID and SecretKey on Basic informaction. SDKAppID and SecrentKey is needed for running demo.

Step 3. Download the sample code

Go to GitHub to download the sample code for your platform.
git clone https://github.com/LiteAVSDK/TRTC_Electron.git

Step 4. Configure the project

Find and open Electron/TRTC-API-Example/assets/debug/gen-test-user-sig.js and set the following parameters:
SDKAPPID: A placeholder by default. Set it to the actual SDKAppID.
SECRETKEY: A placeholder by default. Set it to the actual key.
The method for generating UserSig described in this document involves configuring SECRETKEY in the client code. In this method, SECRETKEY may be easily decompiled and reversed, and if your key is disclosed, attackers can steal your Tencent Cloud traffic. Therefore, this method is only suitable for the local execution and debugging of TRTC-API-Example.
The best practice is to integrate the calculation code of UserSig into your server and provide an application-oriented API. When UserSig is needed, your application can send a request to your server for a dynamic UserSig. For more information, see How do I calculate UserSig during production?.


1. What firewall restrictions does the SDK face?

The SDK uses the UDP protocol for audio/video transmission and therefore cannot be used in office networks that block UDP. If you encounter such a problem, refer to Firewall Restrictions to troubleshoot the issue.