
SDKAppID and SDKSecretKey, which will be used in subsequent steps(login).npm install @trtc/calls-uikit-react
debug directory to your project directory src/debug, it is necessary when generating userSig locally.cp -r node_modules/@trtc/calls-uikit-react/debug ./src
xcopy node_modules\\@trtc\\calls-uikit-react\\debug .\\src\\debug /i /e
/src/App.tsx file.import { useState } from 'react';import { TUICallKit, TUICallKitAPI } from "@trtc/calls-uikit-react";import * as GenerateTestUserSig from "./debug/GenerateTestUserSig-es"; // Refer to Step 2.2
return (<><span> caller's ID: </span><input type="text" placeholder='input caller userID' onChange={(event) => setCallerUserID(event.target.value)} /><button onClick={init}> step1. init </button> <br /><span> callee's ID: </span><input type="text" placeholder='input callee userID' onChange={(event) => setCalleeUserID(event.target.value)} /><button onClick={call}> step2. call </button>{/* 【1】Import the TUICallKit component: Call interface UI */}<TUICallKit /></>);
fill in SDKAppID, SDKSecretKey as two parameters in the code.const SDKAppID = 0; // TODO: Replace with your SDKAppID (Notice: SDKAppID is of type number)const SDKSecretKey = ''; // TODO: Replace with your SDKSecretKeyconst [callerUserID, setCallerUserID] = useState('');const [calleeUserID, setCalleeUserID] = useState('');//【2】Initialize the TUICallKit componentconst init = async () => {const { userSig } = GenerateTestUserSig.genTestUserSig({userID: callerUserID,SDKAppID,SecretKey: SDKSecretKey,});await TUICallKitAPI.init({userID: callerUserID,userSig,SDKAppID,});alert('TUICallKit init succeed');}
Parameter | Type | Note |
userID | String | Unique identifier of the user, defined by you, it is allowed to contain only upper and lower case letters (a-z, A-Z), numbers (0-9), underscores, and hyphens. |
SDKAppID | Number | |
SDKSecretKey | String | |
userSig | String | A security protection signature used for user log in authentication to confirm the user's identity and prevent malicious attackers from stealing your cloud service usage rights. |
genTestUserSig (Refer to Step 3.2) function in the debug file to generate a `userSig`. In this method, SDKSecretKey is vulnerable to decompilation and reverse engineering. Once your key is leaked, attackers can steal your Tencent Cloud traffic.try {await TUICallKitAPI.setSelfInfo({nickName: "jack",avatar: "http://xxx",});} catch (error: any) {alert(`[TUICallKit] Failed to call the setSelfInfo API. Reason: ${error}`);}
import { TUICallKitAPI, CallMediaType } from "@trtc/calls-uikit-react";//【3】Make a 1v1 video callconst call = async () => {await TUICallKitAPI.calls({userIDIDList: [calleeUserID],type: CallMediaType.VIDEO,});};
step1. init to login (caller and callee).
step2. callto make a call. If you have a call problem, refer to FAQs.

enableFloatWindow(enable: boolean) to enable/disable the floating window.TUICallKitAPI.enableFloatWindow(true)
importfilePathfrom'../public/ring.mp3';try {await TUICallKitAPI.setCallingBell(filePath?: string);} catch (error: any) {alert(`[TUICallKit] setCallingBell API failed. Reason: ${error}`);}
try {await TUICallKitAPI.enableMuteMode(enable: boolean);} catch (error: any) {alert(`[TUICallKit] enableMuteMode API failed. Reason: ${error}`);}
Vue3 + TypeScript and @trtc/calls-uikit-react version number is 3.2.2 or later projects. If you are using other languages or technology stacks, please use the Custom UI Implementation.npm install @trtc/calls-uikit-react
src/components/ directory as an example:mkdir -p ./src/components/TUICallKit && cp -r ./node_modules/@trtc/calls-uikit-react/* ./src/components/TUICallKit
xcopy .\\node_modules\\@trtc\\calls-uikit-react .\\src\\components\\TUICallKit /i /e
import { TUICallKit, TUICallKitAPI } from "./components/TUICallKit/src/index";
.eslintignore file in the root directory of your project, for example:# .eslintignoresrc/components/TUICallKit
{"compilerOptions": {"resolveJsonModule": true}}
{"compilerOptions": {"experimentalDecorators": true}}

Serial number | Resource Path | Description |
1 | /TUICallKit/Components/assets/button/camera-close.svg | Camera Off icon |
2 | /TUICallKit/Components/assets/button/microphone-open.svg | Turn on the mic icon |
3 | /TUICallKit/Components/assets/button/speaker-open.svg | Turn on the speaker icon |
4 | /TUICallKit/Components/assets/button/desktop/inviteUser.svg | Invite user icon during call |
5 | /TUICallKit/Components/assets/button/hangup.svg | Hang Up Call icon |
6 | /TUICallKit/Components/assets/button/desktop/minimize.svg | Miniaturize Icon |
7 | /TUICallKit/Components/assets/button/desktop/fullScreen.svg | Full Screen Icon |


Serial number | Resource Path | Description |
1 | /TUICallKit/Components/assets/button/mobile/minimize.svg | Miniaturize Icon |
2 | /TUICallKit/Components/assets/button/hangup.svg | Hang Up Call icon |
3 | /TUICallKit/Components/assets/button/accept.svg | Accept icon |
4 | /TUICallKit/Components/assets/button/microphone-open.svg | Turn on the mic icon |
5 | /TUICallKit/Components/assets/button/speaker-open.svg | Turn on the speaker icon |
6 | /TUICallKit/Components/assets/button/camera-close.svg | Camera Off icon |
7 | /TUICallKit/Components/assets/button/switchCamera.svg | Switch Camera Icon |

import { TUICallKitAPI, FeatureButton } from "@trtc/calls-uikit-react";TUICallKitAPI.hideFeatureButton(FeatureButton.Camera);

import { TUICallKitAPI } from "@trtc/calls-uikit-react";TUICallKitAPI.setLocalViewBackgroundImage('http://xxx.png');TUICallKitAPI.setRemoteViewBackgroundImage('remoteUserId', 'http://xxx.png');


import { TUICallKitAPI, LayoutMode } from "@trtc/calls-uikit-react";TUICallKitAPI.setLayoutMode(LayoutMode.LocalInLargeView);
import { TUICallKitAPI } from "@trtc/calls-uikit-react";TUICallKitAPI.setCameraDefaultState(false);
info_rtc@tencent.com.Feedback