### Install Dependencies for TUIRoomKit Web Example
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/Web/example/vite-vue3-ts/README.md
Navigate to the example directory and install project dependencies using npm.
```bash
cd TUIRoomKit/Web/example/vite-vue3-ts
npm install
```
--------------------------------
### Run TUIRoomKit Web Example in Development
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/Web/example/vite-vue3-ts/README.md
Start the sample project in a development environment using npm.
```bash
npm run dev
```
--------------------------------
### Run TUIRoomKit Web Example in Development
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/Web/example/webpack-vue2.7-ts/README.md
Start the sample project in a development environment to test features locally.
```bash
npm run serve
```
--------------------------------
### Installation and Setup
Source: https://context7.com/tencent-rtc/tuiroomkit/llms.txt
Instructions for installing the TUIRoomKit Web (Vue 3) package and setting up the `UIKitProvider` for global theme and language configuration.
```APIDOC
## Installation
```bash
npm install @tencentcloud/roomkit-web-vue3 \
tuikit-atomicx-vue3 \
@tencentcloud/tuiroom-engine-js \
@tencentcloud/uikit-base-component-vue3 \
@tencentcloud/tui-core-lite \
@tencentcloud/uikit-base-component-vue3 \
@tencentcloud/universal-api \
vue@^3.4.21
```
## Setup
Wrap your application root with `UIKitProvider` to apply theme and language globally.
```vue
```
```
--------------------------------
### Flutter: Create and Join Room with quickStart
Source: https://context7.com/tencent-rtc/tuiroomkit/llms.txt
Use `ConferenceSession.newInstance` with cascade setters and `quickStart()` to create and immediately enter a conference room. Configure microphone, camera, speaker, and user permissions before starting.
```dart
import 'package:tencent_conference_uikit/tencent_conference_uikit.dart';
void createRoom() {
final roomId = '${Random().nextInt(900000) + 100000}'; // 6-digit random ID
ConferenceSession.newInstance(roomId)
..name = 'Alice\'s Meeting'
..isMuteMicrophone = false // mic open
..isOpenCamera = true // camera open
..isSoundOnSpeaker = true
..enableMicrophoneForAllUser = true
..enableCameraForAllUser = true
..enableMessageForAllUser = true
..enableSeatControl = false // free-speech mode
..onActionSuccess = () {
// Navigate to the in-room page on success
Get.to(() => ConferenceMainPage());
}
..onActionError = (ConferenceError error, String message) {
// error codes: errConferenceIdOccupied, errConferenceIdInvalid, etc.
showToast('Create failed: $error — $message');
}
..quickStart();
}
```
--------------------------------
### Install Dependencies for TUIRoomKit Electron Example
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/Electron/example/vue3/README.md
Installs project dependencies using npm. The `--legacy-peer-deps` flag is used to resolve potential peer dependency conflicts. If experiencing slow installations or timeouts, consider configuring npm and Electron mirrors.
```bash
cd TUIRoomKit/Electron/example/vue3
npm install --legacy-peer-deps
```
--------------------------------
### ConferenceSession.newInstance - quickStart (Create Room)
Source: https://context7.com/tencent-rtc/tuiroomkit/llms.txt
Creates a new conference room and immediately enters it. Configuration options can be chained before calling `quickStart()`.
```APIDOC
## Flutter — `ConferenceSession.newInstance` — `quickStart` (Create Room)
Create and immediately enter a conference room. Chain setters in cascade notation, then call `.quickStart()`.
```dart
import 'package:tencent_conference_uikit/tencent_conference_uikit.dart';
void createRoom() {
final roomId = '${Random().nextInt(900000) + 100000}'; // 6-digit random ID
ConferenceSession.newInstance(roomId)
..name = 'Alice\'s Meeting'
..isMuteMicrophone = false // mic open
..isOpenCamera = true // camera open
..isSoundOnSpeaker = true
..enableMicrophoneForAllUser = true
..enableCameraForAllUser = true
..enableMessageForAllUser = true
..enableSeatControl = false // free-speech mode
..onActionSuccess = () {
// Navigate to the in-room page on success
Get.to(() => ConferenceMainPage());
}
..onActionError = (ConferenceError error, String message) {
// error codes: errConferenceIdOccupied, errConferenceIdInvalid, etc.
showToast('Create failed: $error — $message');
}
..quickStart();
}
```
```
--------------------------------
### Install Project Dependencies
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/MiniProgram/README.md
Navigate to the MiniProgram directory and install the necessary npm dependencies.
```bash
cd MiniProgram/
npm install
```
--------------------------------
### Build TUIRoomKit Electron Installer
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/Electron/example/vue3/README.md
Builds distributable installer packages for the TUIRoomKit Electron example. `npm run build` creates packages for the current CPU architecture, while `npm run build:mac-universal` specifically targets dual-architecture Macs. The built installers are located in the `release` directory.
```bash
npm run build // Build mac single-architecture packages, windows packages
npm run build:mac-universal // Building mac dual-architecture packages
```
--------------------------------
### Run TUIRoom Electron Vue2 Sample Project
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/Electron/example/vue2/README.md
Start the development server for the TUIRoom Electron Vue2 sample project.
```bash
npm run start
```
--------------------------------
### Install Post-Compilation Dependencies (Windows)
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/MiniProgram/README.md
After compilation, run this script on Windows to install dependencies for the compiled MiniProgram, which uses a split-package approach due to main package size limits.
```bash
./wxmini_dev.bat
```
--------------------------------
### Build TUIRoomKit Web Example for Production
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/Web/example/vite-vue3-ts/README.md
Generate deployment files for the production environment using npm.
```bash
npm run build
```
--------------------------------
### Install Dependencies with CocoaPods
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/iOS/README.md
Run this command in the terminal within your project directory to install the necessary dependencies for the iOS demo application.
```bash
pod install
```
--------------------------------
### Install Dependencies for Uni-App
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/uni-app/README.md
Install necessary npm packages for the Uni-App project. Ensure you are in the uni-app directory and have a package.json file.
```bash
cd TUIRoomKit/uni-app
npm init -y
npm i @tencentcloud/tuiroom-engine-uniapp-app @tencentcloud/universal-api mitt pinia --save
```
--------------------------------
### Install Dependencies for TUIRoom Electron Vue2
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/Electron/example/vue2/README.md
Install project dependencies using npm. If facing slow installations or timeouts, consider configuring npm and Electron mirrors.
```bash
cd TUIRoomKit/Electron/vue2
npm install
```
--------------------------------
### Run Development Server
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/MiniProgram/README.md
Start the development server for the WeChat MiniProgram target.
```bash
npm run dev:mp-weixin
```
--------------------------------
### Install Post-Compilation Dependencies (Mac)
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/MiniProgram/README.md
After compilation, run this script on Mac to install dependencies for the compiled MiniProgram, which uses a split-package approach due to main package size limits.
```bash
bash wxmini_dev.sh
```
--------------------------------
### Run TUIRoomKit Demo (Flutter)
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/Flutter/tencent_conference_uikit/example/README.md
Execute this command in the `example` directory to compile and run the TUIRoomKit Flutter demo application.
```bash
flutter run
```
--------------------------------
### Build Electron Installer Packages
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/Electron/example/vue2/README.md
Build installer packages for Mac and Windows. Note that Mac builds require a Mac environment and Windows builds require a Windows environment.
```bash
npm run pack:mac // Build mac single-architecture packages
npm run pack:win64 // Building windows packages
npm run pack:mac-universal // Building mac dual-architecture packages
```
--------------------------------
### iOS (Swift): Start or Join Conference with Params
Source: https://context7.com/tencent-rtc/tuiroomkit/llms.txt
Present the conference UI by configuring a ConferenceMainViewController with StartConferenceParams or JoinConferenceParams and pushing it onto a navigation controller. Ensure all required parameters are set for starting or joining.
```swift
import TUIRoomKit
// --- Start (create) a conference ---
func startConference(roomId: String) {
let params = StartConferenceParams(
roomId: roomId,
isOpenMicrophone: true,
isOpenCamera: false,
isOpenSpeaker: true,
isMicrophoneDisableForAllUser: false,
isCameraDisableForAllUser: false,
isSeatEnabled: false, // free-speech mode
name: "Alice's Meeting",
password: nil
)
let vc = ConferenceMainViewController()
vc.setStartConferenceParams(params: params)
navigationController?.pushViewController(vc, animated: true)
}
// --- Join an existing conference ---
func joinConference(roomId: String) {
let params = JoinConferenceParams(
roomId: roomId,
isOpenMicrophone: true,
isOpenCamera: false,
isOpenSpeaker: true
)
let vc = ConferenceMainViewController()
vc.setJoinConferenceParams(params: params)
navigationController?.pushViewController(vc, animated: true)
}
```
--------------------------------
### Install TUIRoomKit Web (Vue 3) and Dependencies
Source: https://context7.com/tencent-rtc/tuiroomkit/llms.txt
Install the TUIRoomKit Vue 3 package and its peer dependencies using npm. Ensure you have Vue 3 and other specified UI kit components installed.
```bash
npm install @tencentcloud/roomkit-web-vue3 \
tuikit-atomicx-vue3 \
@tencentcloud/tuiroom-engine-js \
@tencentcloud/uikit-base-component-vue3 \
@tencentcloud/tui-core-lite \
@tencentcloud/uikit-base-component-vue3 \
@tencentcloud/universal-api \
vue@^3.4.21
```
--------------------------------
### Setup UIKitProvider in Vue 3 App
Source: https://context7.com/tencent-rtc/tuiroomkit/llms.txt
Wrap your Vue 3 application root with UIKitProvider to globally apply theme and language settings. This setup also includes registering a global invitation handler for room invitations.
```vue
```
--------------------------------
### Android: Start or Join Conference via Intent
Source: https://context7.com/tencent-rtc/tuiroomkit/llms.txt
Launch the built-in conference UI by starting ConferenceMainActivity with serialized StartConferenceParams or JoinConferenceParams extras. Ensure the correct parameters are passed for starting or joining a conference.
```java
import com.tencent.cloud.tuikit.roomkit.ConferenceDefine;
import com.tencent.cloud.tuikit.roomkit.ConferenceMainActivity;
// --- Start (create) a conference ---
ConferenceDefine.StartConferenceParams startParams =
new ConferenceDefine.StartConferenceParams("room-abc-123");
startParams.name = "Alice's Meeting";
startParams.isOpenMicrophone = true;
startParams.isOpenCamera = false;
startParams.isOpenSpeaker = true;
startParams.isSeatEnabled = false; // free-speech mode
Intent startIntent = new Intent(this, ConferenceMainActivity.class);
startIntent.putExtra(ConferenceDefine.KEY_START_CONFERENCE_PARAMS, startParams);
startActivity(startIntent);
// --- Join an existing conference ---
ConferenceDefine.JoinConferenceParams joinParams =
new ConferenceDefine.JoinConferenceParams("room-abc-123");
joinParams.isOpenMicrophone = true;
joinParams.isOpenCamera = false;
Intent joinIntent = new Intent(this, ConferenceMainActivity.class);
joinIntent.putExtra(ConferenceDefine.KEY_JOIN_CONFERENCE_PARAMS, joinParams);
startActivity(joinIntent);
```
--------------------------------
### Android - Conference Session Setup and Observers
Source: https://context7.com/tencent-rtc/tuiroomkit/llms.txt
Details the setup of `ConferenceSession` on Android, including enabling features like watermarking and adding observers to react to conference lifecycle events.
```APIDOC
## ConferenceSession Setup and Observers (Android)
### Description
On Android, `ConferenceSession.sharedInstance()` is the entry point for configuring conference-level features. Add a `ConferenceObserver` to react to lifecycle events.
### Initialization and Configuration
```java
import com.tencent.cloud.tuikit.roomkit.ConferenceSession;
import com.tencent.cloud.tuikit.roomkit.ConferenceDefine;
// Get the shared instance
ConferenceSession session = ConferenceSession.sharedInstance();
// Enable optional features
session.enableWaterMark();
session.setWaterMarkText("Confidential - Alice");
```
### ConferenceObserver
Implement the `ConferenceObserver` interface to handle various conference events.
```java
import com.tencent.cloud.tuikit.roomkit.ConferenceDefine;
import com.tencent.cloud.tuikit.engine.room.TUIRoomDefine;
import com.tencent.cloud.tuikit.engine.common.TUICommonDefine;
public class MyActivity extends AppCompatActivity {
private final ConferenceDefine.ConferenceObserver observer =
new ConferenceDefine.ConferenceObserver() {
@Override
public void onConferenceStarted(TUIRoomDefine.RoomInfo roomInfo,
TUICommonDefine.Error error, String message) {
// Handle conference started event
}
@Override
public void onConferenceJoined(TUIRoomDefine.RoomInfo roomInfo,
TUICommonDefine.Error error, String message) {
// Handle conference joined event
}
@Override
public void onConferenceExited(TUIRoomDefine.RoomInfo roomInfo,
ConferenceDefine.ConferenceExitedReason reason) {
// Handle conference exited event
}
@Override
public void onConferenceFinished(TUIRoomDefine.RoomInfo roomInfo,
ConferenceDefine.ConferenceFinishedReason reason) {
// Handle conference finished event
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ConferenceSession session = ConferenceSession.sharedInstance();
session.addObserver(observer);
}
@Override
protected void onDestroy() {
super.onDestroy();
ConferenceSession.sharedInstance().removeObserver(observer);
ConferenceSession.destroySharedInstance();
}
}
```
### Observer Methods
- **onConferenceStarted**: Called when the conference starts.
- **onConferenceJoined**: Called when the user joins the conference.
- **onConferenceExited**: Called when the user exits the conference.
- **onConferenceFinished**: Called when the conference finishes.
```
--------------------------------
### Start a Quick Conference
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/Flutter/tencent_conference_uikit/README.md
Initiate a new conference session with a specified room ID. This method is used for quickly starting a new meeting. The success callback allows navigation to the conference page, while the error callback handles any issues during the process.
```dart
import 'package:tencent_conference_uikit/tencent_conference_uikit.dart';
ConferenceSession.newInstance('your roomId')
..onActionSuccess = _quickStartSuccess
..onActionError = _quickStartError
..quickStart();
void _quickStartSuccess() {
//You can navigate to the conference page on your own in this success callback of starting a quick conference.
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ConferenceMainPage(),
),
);
}
void _quickStartError(ConferenceError error, String message) {
debugPrint("code: $error message: $message");
}
```
--------------------------------
### Configure Project with GetMaterialApp
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/Flutter/tencent_conference_uikit/README.md
Replace MaterialApp with GetMaterialApp or set navigatorKey to Get.key. This step requires importing the get package.
```dart
import 'package:get/get.dart';
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GetMaterialApp( // Use GetMaterialApp to replace MaterialApp
// Your original MaterialApp content
);
}
}
```
--------------------------------
### Configure npm and Electron Mirrors
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/Electron/example/vue3/README.md
Optional configuration to set npm and Electron download mirrors, which can improve installation speed and reliability, especially in regions with network restrictions. Create a `.npmrc` file in the project root to apply these settings.
```ini
registry=https://registry.npmmirror.com
ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/
ELECTRON_BUILDER_BINARIES_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/
```
--------------------------------
### Add tencent_conference_uikit Dependency
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/Flutter/tencent_conference_uikit/README.md
Add the tencent_conference_uikit plugin to your pubspec.yaml file and run 'flutter pub get'.
```yaml
dependencies:
tencent_conference_uikit: latest release version
```
```bash
flutter pub get
```
--------------------------------
### Android Conference Session Setup and Observers
Source: https://context7.com/tencent-rtc/tuiroomkit/llms.txt
Configure conference-level features using `ConferenceSession.sharedInstance()` and react to lifecycle events by adding a `ConferenceObserver`. Remember to remove the observer and destroy the instance when done.
```java
import com.tencent.cloud.tuikit.roomkit.ConferenceSession;
import com.tencent.cloud.tuikit.roomkit.ConferenceDefine;
import com.tencent.cloud.tuikit.engine.room.TUIRoomDefine;
import com.tencent.cloud.tuikit.engine.common.TUICommonDefine;
public class MyActivity extends AppCompatActivity {
private final ConferenceDefine.ConferenceObserver observer =
new ConferenceDefine.ConferenceObserver() {
@Override
public void onConferenceStarted(TUIRoomDefine.RoomInfo roomInfo,
TUICommonDefine.Error error, String message) {
if (error == TUICommonDefine.Error.SUCCESS) {
Log.d("TUIRoom", "Room started: " + roomInfo.roomId);
}
}
@Override
public void onConferenceJoined(TUIRoomDefine.RoomInfo roomInfo,
TUICommonDefine.Error error, String message) {
Log.d("TUIRoom", "Joined: " + roomInfo.roomId);
}
@Override
public void onConferenceExited(TUIRoomDefine.RoomInfo roomInfo,
ConferenceDefine.ConferenceExitedReason reason) {
Log.d("TUIRoom", "Exited, reason: " + reason);
finish(); // navigate back
}
@Override
public void onConferenceFinished(TUIRoomDefine.RoomInfo roomInfo,
ConferenceDefine.ConferenceFinishedReason reason) {
Log.d("TUIRoom", "Room finished: " + reason);
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ConferenceSession session = ConferenceSession.sharedInstance();
// Optional features
session.enableWaterMark();
session.setWaterMarkText("Confidential - Alice");
session.addObserver(observer);
}
@Override
protected void onDestroy() {
super.onDestroy();
ConferenceSession.sharedInstance().removeObserver(observer);
ConferenceSession.destroySharedInstance();
}
}
```
--------------------------------
### Get Chat SDK Instance
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/Electron/roomkit/vue3/src/TUIRoom/components/Chat/ChatKit/README.md
Retrieves the Chat SDK instance from the TUILogin context. This instance is necessary for interacting with chat functionalities.
```javascript
// Get Chat SDK instance
const { chat } = TUILogin.getContext();
```
--------------------------------
### Join a Conference
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/Flutter/tencent_conference_uikit/README.md
Join an existing conference using its room ID. This method is used to enter a pre-existing meeting. Similar to starting a conference, success and error callbacks are provided for navigation and error handling.
```dart
import 'package:tencent_conference_uikit/tencent_conference_uikit.dart';
ConferenceSession.newInstance('your roomId')
..onActionSuccess = _joinSuccess
..onActionError = _joinError
..join();
void _joinSuccess() {
//You can navigate to the conference page on your own in this success callback of joining a conference.
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ConferenceMainPage(),
),
);
}
void _joinError(ConferenceError error, String message) {
debugPrint("code: $error message: $message");
}
```
--------------------------------
### Initialize TUILogin
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/uni-app/src/roomkit/TUIKit/README.md
Initialize the login process with the required options. Ensure all parameters like SDKAppID, userID, and userSig are correctly provided.
```javascript
TUILogin.login(options);
```
--------------------------------
### iOS Podfile Configuration for Permissions
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/Flutter/tencent_conference_uikit/README.md
Enable camera and microphone permissions in the iOS Podfile by adding preprocessor definitions.
```ruby
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
'PERMISSION_MICROPHONE=1',
'PERMISSION_CAMERA=1',
]
end
end
end
```
--------------------------------
### Configure MiniProgram Permissions
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/MiniProgram/README.md
Ensure your MiniProgram has the necessary permissions for live-pusher and live-player components. This typically involves using an enterprise account and enabling the components in the WeChat public platform.
```bash
Register as an enterprise account. Enable live-pusher and live-player permissions in the WeChat public platform under 'Development' -> 'Development Management' -> 'Interface Settings'.
```
--------------------------------
### TUILogin Initialization and Usage
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/uni-app/src/roomkit/TUIKit/README.md
This section details how to import and use the TUILogin module for initializing and managing user sessions in your Uniapp application.
```APIDOC
## Importing TUILogin
```javascript
// Import the TUILogin module
import { TUILogin } from '@tencentcloud/tui-core';
```
## TUILogin Options
The `options` object for `TUILogin.login()` requires the following properties:
| Parameter | Type | Description |
| --------------- | --------------------- | --------------------------------------------------------------------------- |
| SDKAppID | number | The SDKAppID of your Tencent Cloud IM application. Required. |
| userID | string | The unique identifier for the user. Required. |
| userSig | string | The user signature for authentication. Required. |
| TIMPush | any | Push plugin instance. Used when integrating push plugins for Uniapp app builds. |
| pushConfig | object | Push plugin configuration. Used when integrating push plugins for Uniapp app builds. |
| useUploadPlugin | boolean | Whether to use the upload plugin. Defaults to `false`. |
| proxyServer | string | WebSocket server proxy address. |
| fileUploadProxy | string | Proxy address for image, video, and file uploads. |
| fileDownloadProxy | string | Proxy address for image, video, and file downloads. |
| framework | string \| undefined | The UI framework being used. Possible values: `vue2`, `vue3`, `undefined`. Required. |
## Login
Initializes the login process with the provided options.
```javascript
// Initialize login
TUILogin.login(options);
```
## Logout
Logs the user out of the TUIKit service.
```javascript
// Log out
TUILogin.logout();
```
## Set Log Level
Configures the log output level for the Chat SDK.
- `0`: Normal log level
- `1`: Release level logs
- `2`: Warning level logs
- `3`: Error level logs
- `4`: No log level
```javascript
// Set Chat SDK log level
TUILogin.setLogLevel(0);
```
## Get Chat SDK Instance
Retrieves the Chat SDK instance from the TUIKit context.
```javascript
// Get Chat SDK instance
const { chat } = TUILogin.getContext();
```
```
--------------------------------
### ConferenceObserver - Lifecycle Callbacks
Source: https://context7.com/tencent-rtc/tuiroomkit/llms.txt
Register a `ConferenceObserver` to receive notifications for conference lifecycle events such as starting, joining, finishing, and exiting.
```APIDOC
## Flutter — `ConferenceObserver` — Lifecycle Callbacks
Register a `ConferenceObserver` with the global conference manager to receive start, join, finish, and exit notifications.
```dart
import 'package:tencent_conference_uikit/tencent_conference_uikit.dart';
// ConferenceObserver is currently available via the manager layer;
// use it in conjunction with ConferenceSession callbacks shown above,
// or directly subscribe through the RoomEngineManager event handler.
final observer = ConferenceObserver(
onConferenceStarted: (String conferenceId, ConferenceError error) {
if (error == ConferenceError.success) {
print('Conference started: $conferenceId');
}
},
onConferenceJoined: (String conferenceId, ConferenceError error) {
print('Joined conference: $conferenceId');
},
onConferenceFinished: (String conferenceId) {
print('Conference finished: $conferenceId');
Get.back(); // navigate to home
},
onConferenceExited: (String conferenceId) {
print('Exited conference: $conferenceId');
Get.back();
},
);
```
```
--------------------------------
### Login to Chat Service
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/Electron/roomkit/vue3/src/TUIRoom/components/Chat/ChatKit/README.md
Initiates the login process using TUILogin. The options object requires SDKAppID, userID, and userSig. Optional parameters include push configurations and proxy settings.
```javascript
// Login
TUILogin.login(options);
```
--------------------------------
### Create and Join Room with `conference.createAndJoinRoom`
Source: https://context7.com/tencent-rtc/tuiroomkit/llms.txt
Create a new conference room and join it as the owner. You can specify the room type (Standard or Webinar) and optional room name and password.
```typescript
import { conference } from '@tencentcloud/roomkit-web-vue3';
import { RoomType } from 'tuikit-atomicx-vue3/room';
try {
await conference.createAndJoinRoom({
roomId: 'room-abc-123',
roomType: RoomType.Standard, // or RoomType.Webinar
options: {
roomName: "Alice's Meeting",
password: 'secret123', // optional password
},
});
console.log('Room created and joined');
} catch (error: any) {
// ERR_ROOM_ID_OCCUPIED → room ID already in use
console.error('Error code:', error.code, error.message);
}
```
--------------------------------
### Flutter: Conference Lifecycle Callbacks
Source: https://context7.com/tencent-rtc/tuiroomkit/llms.txt
Register a `ConferenceObserver` with the global conference manager to receive notifications for conference start, join, finish, and exit events. This is useful for managing navigation and state changes.
```dart
import 'package:tencent_conference_uikit/tencent_conference_uikit.dart';
// ConferenceObserver is currently available via the manager layer;
// use it in conjunction with ConferenceSession callbacks shown above,
// or directly subscribe through the RoomEngineManager event handler.
final observer = ConferenceObserver(
onConferenceStarted: (String conferenceId, ConferenceError error) {
if (error == ConferenceError.success) {
print('Conference started: $conferenceId');
}
},
onConferenceJoined: (String conferenceId, ConferenceError error) {
print('Joined conference: $conferenceId');
},
onConferenceFinished: (String conferenceId) {
print('Conference finished: $conferenceId');
Get.back(); // navigate to home
},
onConferenceExited: (String conferenceId) {
print('Exited conference: $conferenceId');
Get.back();
},
);
```
--------------------------------
### Import TUILogin for Vue3
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/Electron/roomkit/vue3/src/TUIRoom/components/Chat/ChatKit/README.md
Import the TUILogin module from the @tencentcloud/tui-core package. This is the entry point for authentication and context retrieval.
```javascript
import { TUILogin } from '@tencentcloud/tui-core';
```
--------------------------------
### Web (Vue 3) - Handling Room Invitations
Source: https://context7.com/tencent-rtc/tuiroomkit/llms.txt
Explains how to use the `useRoomInvitation` composable to handle incoming room-call invitations. It displays a dialog and triggers `onAcceptCall` when the user accepts.
```APIDOC
## useRoomInvitation Composable
### Description
Handle incoming room-call invitations (push-style). When a remote user invites the current user, a dialog is shown; accepting triggers `onAcceptCall`.
### Parameters
- **options** (object) - Required - Configuration options for the invitation handler.
- **onAcceptCall** (function) - Required - Callback function executed when the user accepts an invitation. It receives an object with `roomId`, `password`, and `roomType`.
### Usage
```typescript
import { useRoomInvitation } from '@tencentcloud/roomkit-web-vue3';
import { useRouter } from 'vue-router';
const router = useRouter();
useRoomInvitation({
onAcceptCall: ({ roomId, password, roomType }) => {
router.push({
path: '/room',
query: { roomId, password, roomType: String(roomType) },
});
},
});
```
**Note**: For H5/mobile, use `useRoomInvitationH5` instead.
```
--------------------------------
### Configure SDKAppID and SDKSecretKey in GenerateTestUserSig.java
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/Android/README.md
This Java code snippet shows where to configure your SDKAppID and SDKSecretKey. Ensure these are obtained from the TRTC console before running the demo.
```java
package com.tencent.liteav.debug;
public class GenerateTestUserSig {
// Obtain SDKAppID and SDKSecretKey from the TRTC console: https://console.cloud.tencent.com/trtc/app
// Replace the placeholder values with your actual SDKAppID and SDKSecretKey
public static final String SDKAPPID = "1400000123"; // Replace with your SDKAppID
public static final String SDKSECRETKEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // Replace with your SDKSecretKey
// The following methods are used to generate UserSig. Do not modify them.
public static String genTestUserSig(String userId) {
return genSig(SDKAPPID, SDKSECRETKEY, userId, 30 * 86400);
}
private static native String genSig(long sdkAppId, String secretKey, String userId, long expire);
static {
System.loadLibrary("encrypt");
}
}
```
--------------------------------
### Configure Basic Information
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/MiniProgram/README.md
Modify the `basic-info-config.js` file to set your SDKAppID and SDKSECRETKEY. These are required for TUIRoomKit to connect to Tencent Cloud services.
```javascript
{
//... other config
SDKAPPID: 0, // Replace with your SDKAppID
SDKSECRETKEY: '', // Replace with your SDKSECRETKEY
//... other config
}
```
--------------------------------
### Configure SDK Credentials in Swift
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/iOS/README.md
Set your SDKAppID and SDKSecretKey in this Swift file to authenticate with the TRTC service. Ensure these are correctly copied from the TRTC console.
```swift
let SDKAPPID: Int32 = 1400000123 // Placeholder. Replace with your own SDKAppID
let SDKSECRETKEY = "YOUR_SDK_SECRET_KEY" // Placeholder. Replace with your own SDKSecretKey
```
--------------------------------
### iOS Info.plist Configuration for Permissions
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/Flutter/tencent_conference_uikit/README.md
Add NSCameraUsageDescription and NSMicrophoneUsageDescription to Info.plist for camera and mic permissions.
```xml
NSCameraUsageDescription
TUIRoom needs access to your Camera permission
NSMicrophoneUsageDescription
TUIRoom needs access to your Mic permission
```
--------------------------------
### Clone TUIRoomKit Repository
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/MiniProgram/README.md
Clone the TUIRoomKit repository to your local machine to begin.
```bash
git clone https://github.com/tencentyun/TUIRoomKit.git
```
--------------------------------
### ConferenceSession.newInstance - join (Join Room)
Source: https://context7.com/tencent-rtc/tuiroomkit/llms.txt
Joins an existing conference room using its ID. Configuration options can be set before calling `join()`.
```APIDOC
## Flutter — `ConferenceSession.newInstance` — `join` (Join Room)
Join an existing room.
```dart
import 'package:tencent_conference_uikit/tencent_conference_uikit.dart';
void joinRoom(String roomId) {
ConferenceSession.newInstance(roomId)
..isMuteMicrophone = false
..isOpenCamera = false
..isSoundOnSpeaker = true
..onActionSuccess = () {
Get.to(() => ConferenceMainPage());
}
..onActionError = (ConferenceError error, String message) {
switch (error) {
case ConferenceError.errConferenceIdNotExist:
showToast('Room not found'); break;
default:
showToast('Join failed: $message');
}
}
..join();
}
```
```
--------------------------------
### Flutter: Join Existing Room with join
Source: https://context7.com/tencent-rtc/tuiroomkit/llms.txt
Use `ConferenceSession.newInstance` with cascade setters and `join()` to join an existing conference room. Configure initial microphone and camera states, and handle success or error callbacks.
```dart
import 'package:tencent_conference_uikit/tencent_conference_uikit.dart';
void joinRoom(String roomId) {
ConferenceSession.newInstance(roomId)
..isMuteMicrophone = false
..isOpenCamera = false
..isSoundOnSpeaker = true
..onActionSuccess = () {
Get.to(() => ConferenceMainPage());
}
..onActionError = (ConferenceError error, String message) {
switch (error) {
case ConferenceError.errConferenceIdNotExist:
showToast('Room not found'); break;
default:
showToast('Join failed: $message');
}
}
..join();
}
```
--------------------------------
### Joining a Room: `conference.joinRoom`
Source: https://context7.com/tencent-rtc/tuiroomkit/llms.txt
Joins an existing conference room as a participant. Supports password-protected rooms.
```APIDOC
## `conference.joinRoom`
Join an existing room as a participant. Supports password-protected rooms.
```typescript
import { conference } from '@tencentcloud/roomkit-web-vue3';
import { RoomType } from 'tuikit-atomicx-vue3/room';
try {
await conference.joinRoom({
roomId: 'room-abc-123',
roomType: RoomType.Standard,
password: 'secret123', // omit if the room has no password
});
} catch (error: any) {
// TUIErrorCode.ERR_NEED_PASSWORD → show password prompt
// TUIErrorCode.ERR_ROOM_ID_NOT_EXIST → room not found
console.error(error.code, error.message);
}
```
```
--------------------------------
### Initialize and Login for Floating Chat
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/Flutter/tencent_conference_uikit/README.md
Initialize the Tencent Cloud Chat SDK and log in with user credentials to enable the floating chat feature. Ensure you replace placeholder values with your actual SDKAppID, userID, and userSig. This step is optional if you do not need the floating chat feature.
```dart
import 'package:tencent_cloud_chat_sdk/enum/V2TimSDKListener.dart';
import 'package:tencent_cloud_chat_sdk/enum/log_level_enum.dart';
import 'package:tencent_cloud_chat_sdk/models/v2_tim_callback.dart';
import 'package:tencent_cloud_chat_sdk/tencent_im_sdk_plugin.dart';
// Initialize
var initResult = await TencentImSDKPlugin.v2TIMManager.initSDK(
sdkAppID: SDKAPPID, // Replace with your SDKAPPID
loglevel: LogLevelEnum.V2TIM_LOG_INFO, // Log registration level
listener: V2TimSDKListener(), // Event listener. When using the floating chat, pass an empty object here.
);
if (initResult.code == 0) { // Initialized successfully
// Login
V2TimCallback imLoginResult = await TencentImSDKPlugin.v2TIMManager.login(
userID: 'userId', // Replace with your userID
userSig: 'userSig', // Replace with your userSig
);
}
```
--------------------------------
### Room Creation: `conference.createAndJoinRoom`
Source: https://context7.com/tencent-rtc/tuiroomkit/llms.txt
Creates a new conference room and joins it as the owner. Supports `RoomType.Standard` (free speech) and `RoomType.Webinar` (raise-hand/seat-controlled).
```APIDOC
## `conference.createAndJoinRoom`
Create a new conference room and immediately join it as the owner.
```typescript
import { conference } from '@tencentcloud/roomkit-web-vue3';
import { RoomType } from 'tuikit-atomicx-vue3/room';
try {
await conference.createAndJoinRoom({
roomId: 'room-abc-123',
roomType: RoomType.Standard, // or RoomType.Webinar
options: {
roomName: "Alice's Meeting",
password: 'secret123', // optional password
},
});
console.log('Room created and joined');
} catch (error: any) {
// ERR_ROOM_ID_OCCUPIED → room ID already in use
console.error('Error code:', error.code, error.message);
}
```
```
--------------------------------
### TUILogin
Source: https://github.com/tencent-rtc/tuiroomkit/blob/main/Electron/roomkit/vue2/src/TUIRoom/components/Chat/ChatKit/README.md
Handles user login and logout for the chat service. It requires SDKAppID, userID, and userSig for authentication. Optional parameters include push configurations and proxy settings.
```APIDOC
## TUILogin
```javascript
import { TUILogin } from '@tencentcloud/tui-core';
```
The `options` parameter is of the Object type. It contains the following attribute values:
| Name | Type | Description |
| --- | --- | --- |
| SDKAppID | number | Required, SDKAppID of the chat app |
| userID | string | Required, user ID|
| userSig |string | Required, the password with which the user logs in to the Chat console. It is essentially the ciphertext generated by encrypting information such as the UserID. For the detailed generation method, see [Generating UserSig](https://trtc.io/document/34385) |
| TIMPush | any | Optional, TIMPush plugin instance when uniapp build app packages |
| pushConfig | object | Optional, TIMPush plugin's config |
| useUploadPlugin | boolean | Optional, whether to use the upload plugin, the default is false |
| proxyServer | string | Optional, WebSocket server proxy address |
| fileUploadProxy | string | Optional, image, video, file upload proxy address |
| fileDownloadProxy | string | Optional, image, video, file download proxy address|
| framework | string | undefined | Required, UI framework type, optional values: vue2、vue3、undefined |
### Login
```javascript
// Login
TUILogin.login(options);
```
### Logout
```javascript
// Logout
TUILogin.logout();
```
### Set Log Level
```javascript
// Set the SDK log level.
// 0: Common level. You are advised to use this level during access as it covers more logs.
// 1: Release level. You are advised to use this level for key information in a production environment.
TUILogin.setLogLevel(0);
```
### Get Chat SDK Instance
```javascript
// Get Chat SDK instance
const { chat } = TUILogin.getContext();
```
```
--------------------------------
### Handle Incoming Room Invitations (Vue 3)
Source: https://context7.com/tencent-rtc/tuiroomkit/llms.txt
Use the `useRoomInvitation` composable to handle incoming room-call invitations. It displays a dialog and triggers `onAcceptCall` when the user accepts.
```typescript
// In App.vue
```
#### ConferenceMainView
```vue
```
```