WebSDK初始化
更新时间:2025-08-20 15:22:48
SDK初始化
/**
* 初始化SDK
* @param config - 初始配置项
* @returns
* @public
*/
declare function init(config: InitConfig): Promise<void>;
/**
* SDK实始化配置选择
* @public
*/
declare class InitConfig {
/**
* 是否开启日志调试
*/
debug: boolean;
/**
* 通用版App配置项
*/
appKeyConfig?: AppKeyConfig;
}
export declare namespace RTCXSDKInit {
export {
init,
uninit,
}
}
初始化
import {
RTCXSDKInit,
RTCXSDKInitTypes,
RTCXCommonTypes,
} from '@rtcx/websdk'
// 初始换SDK,appKey和appSecret是平台分配给PC SDK,在系统中的唯一标识及对应的密钥
const appKeyConfig = new RTCXSDKInitTypes.AppKeyConfig()
appKeyConfig.appKey = 'appKey'
appKeyConfig.appSecret = 'appSecret'
const initConfig = new RTCXSDKInitTypes.InitConfig()
initConfig.appKeyConfig = appKeyConfig
initConfig.debug = false //需要时开启
initConfig.productEnv = RTCXCommonTypes.PlatformEnvEnum.PROD
console.info('checkInitSdk init', initConfig)
RTCXSDKInit.init(initConfig)
示例
import {
RTCXSDKInit,
RTCXSDKInitTypes,
RTCXCommonTypes,
} from '@rtcx/websdk'
// 初始换SDK,appKey和appSecret是平台分配给PC SDK,在系统中的唯一标识及对应的密钥
const appKeyConfig = new RTCXSDKInitTypes.AppKeyConfig()
appKeyConfig.appKey = 'appKey'
appKeyConfig.appSecret = 'appSecret'
const initConfig = new RTCXSDKInitTypes.InitConfig()
initConfig.appKeyConfig = appKeyConfig
initConfig.debug = false //需要时开启
initConfig.productEnv = RTCXCommonTypes.PlatformEnvEnum.PROD
console.info('checkInitSdk init', initConfig)
RTCXSDKInit.init(initConfig)