nimeet Docs
中文

Mini-program SDK API Reference

Complete Mini-program public surface generated from the public SDK interface definition: classes, interfaces, enums, events, error identifiers and capability scope.

Generated from the public SDK interface definitions

Version v1.1.0 · Updated 2026-10-26 · revision 1

Interface overview

This page lists the public API of Mini program(WeChat): classes, methods, overloads, properties, events and error codes. The interface definition matches the SDK package version.

Checklist itemCount
Interface / class4
Method32
Method overloads45
Property4
Enums4
error-code constants0

Availability

This platform's SDK: Generally available. The interface definition matches the SDK package version; runtime capability follows the published SDK package.

Join channel flow

Arranged in the typical call order of join / leave / publish / subscribe; the parameter table is expanded under “Parameters of the minimal runnable flow”.

StepInterfaceMethodOverload count
Join a channelClientjoin1
Leave a channelClientleave1
publish the local trackClientpublish1
Renew the TokenClientrenewToken1
subscribe to remote mediaClientsubscribe1

parameters for the minimal runnable flow

ParametersTypeOptionalVariadic parameters
channelKeystringNoNo
channelstringNoNo
uidnumber|stringNoNo
isAudioOnlybooleanNoNo
UidTypeUidTypeisNo
onSuccessfunctionisNo
onFailurefunctionisNo
onSuccessfunctionisNo
onFailurefunctionisNo
onSuccessfunctionisNo
onFailurefunctionisNo
tokenstringNoNo
onSuccessfunctionisNo
onFailurefunctionisNo
uidnumberNoNo
optionsobjectisNo
onSuccessfunctionisNo
onFailurefunctionisNo

Endpoint index

InterfaceMethodPropertyEvents
ChannelMediaError030
ChannelMediaRelayConfiguration300
Client27014
Log210

all endpoints

ChannelMediaError 0 method / 3 Property
PropertyTyperead-only
codenumberNo
dataanyNo
messagestringNo
ChannelMediaRelayConfiguration 3 method / 0 Property
typescript
removeDestChannelInfo(channelName: string): void
setDestChannelInfo(channelName: string, destInfo: any): void
setSrcChannelInfo(srcInfo: any): void

Method detail: 3 / 3 (parameters, returns, errors)

MethodParametersReturnsErrors
removeDestChannelInfochannelName: stringvoidError code index
setDestChannelInfochannelName: string, destInfo: anyvoidError code index
setSrcChannelInfosrcInfo: anyvoidError code index
Client 27 method / 0 Property
typescript
constructor(options: object): Client
destroy(onSuccess?: function, onFailure?: function): Promise<void>
init(appId: string, onSuccess?: function, onFailure?: function): Promise<void>
join(channelKey: string, channel: string, uid: number|string, isAudioOnly: boolean, UidType?: UidType, onSuccess?: function, onFailure?: function): Promise<void>
leave(onSuccess?: function, onFailure?: function): Promise<void>
mute(uid: number, target: string, onSuccess?: function, onFailure?: function): Promise<void>
muteLocal(target: string, onSuccess?: function, onFailure?: function): Promise<void>
off(event: string): void
on(event: "channel-media-relay-event", callback: function): void
on(event: "channel-media-relay-state", callback: function): void
on(event: "client-banned"): void
on(event: "error", callback: function): void
on(event: "mute-audio", callback: function): void
on(event: "mute-video", callback: function): void
on(event: "stream-added", callback: function): void
on(event: "stream-removed", callback: function): void
on(event: "token-privilege-did-expire"): void
on(event: "token-privilege-will-expire"): void
on(event: "unmute-audio", callback: function): void
on(event: "unmute-video", callback: function): void
on(event: "update-url", callback: function): void
on(event: "video-rotation", callback: function): void
publish(onSuccess?: function, onFailure?: function): Promise<string>
rejoin(channelKey: string, channel: string, uid: number|string, uids: number, isAudioOnly: boolean, UidType?: UidType, onSuccess?: function, onFailure?: function): Promise<void>
renewToken(token: string, onSuccess?: function, onFailure?: function): Promise<void>
setAudioCodec(audioCodec: AudioCodec): void
setRemoteVideoStreamType(uid: number, streamType: 0|1, onSuccess?: function, onFailure?: function): Promise<void>
setRole(role: string, onSuccess?: function, onFailure?: function): Promise<void>
startChannelMediaRelay(config: ChannelMediaRelayConfiguration, callback: function): void
stopChannelMediaRelay(callback: function): void
subscribe(uid: number, options?: object, onSuccess?: function, onFailure?: function): Promise<object>
unmute(uid: number, target: string, onSuccess?: function, onFailure?: function): Promise<void>
unmuteLocal(target: string, onSuccess?: function, onFailure?: function): Promise<void>
unpublish(onSuccess?: function, onFailure?: function): Promise<void>
unsubscribe(uid: number, onSuccess?: function, onFailure?: function): Promise<void>
updateChannelMediaRelay(config: ChannelMediaRelayConfiguration, callback: function): void
updatePlayerNetStatus(uid: number, event: any): void
updatePlayerStateChange(uid: number, event: any): void
updatePusherNetStatus(event: any): void
updatePusherStateChange(event: any): void

Method detail: 27 / 27 (parameters, returns, errors)

MethodParametersReturnsErrors
constructoroptions: objectClientError code index
destroyonSuccess?: function, onFailure?: functionPromise<void>Error code index
initappId: string, onSuccess?: function, onFailure?: functionPromise<void>Error code index
joinchannelKey: string, channel: string, uid: number|string, isAudioOnly: boolean, UidType?: UidType, onSuccess?: function, onFailure?: functionPromise<void>Error code index
leaveonSuccess?: function, onFailure?: functionPromise<void>Error code index
muteuid: number, target: string, onSuccess?: function, onFailure?: functionPromise<void>Error code index
muteLocaltarget: string, onSuccess?: function, onFailure?: functionPromise<void>Error code index
offevent: stringvoidError code index
onevent: "channel-media-relay-event", callback: functionvoidError code index
publishonSuccess?: function, onFailure?: functionPromise<string>Error code index
rejoinchannelKey: string, channel: string, uid: number|string, uids: number, isAudioOnly: boolean, UidType?: UidType, onSuccess?: function, onFailure?: functionPromise<void>Error code index
renewTokentoken: string, onSuccess?: function, onFailure?: functionPromise<void>Error code index
setAudioCodecaudioCodec: AudioCodecvoidError code index
setRemoteVideoStreamTypeuid: number, streamType: 0|1, onSuccess?: function, onFailure?: functionPromise<void>Error code index
setRolerole: string, onSuccess?: function, onFailure?: functionPromise<void>Error code index
startChannelMediaRelayconfig: ChannelMediaRelayConfiguration, callback: functionvoidError code index
stopChannelMediaRelaycallback: functionvoidError code index
subscribeuid: number, options?: object, onSuccess?: function, onFailure?: functionPromise<object>Error code index
unmuteuid: number, target: string, onSuccess?: function, onFailure?: functionPromise<void>Error code index
unmuteLocaltarget: string, onSuccess?: function, onFailure?: functionPromise<void>Error code index
unpublishonSuccess?: function, onFailure?: functionPromise<void>Error code index
unsubscribeuid: number, onSuccess?: function, onFailure?: functionPromise<void>Error code index
updateChannelMediaRelayconfig: ChannelMediaRelayConfiguration, callback: functionvoidError code index
updatePlayerNetStatusuid: number, event: anyvoidError code index
updatePlayerStateChangeuid: number, event: anyvoidError code index
updatePusherNetStatusevent: anyvoidError code index
updatePusherStateChangeevent: anyvoidError code index
event namecallback parameters
channel-media-relay-eventFunction
channel-media-relay-stateFunction
client-bannedFunction
errorFunction
mute-audioFunction
mute-videoFunction
stream-addedFunction
stream-removedFunction
token-privilege-did-expireFunction
token-privilege-will-expireFunction
unmute-audioFunction
unmute-videoFunction
update-urlFunction
video-rotationFunction
Log 2 method / 1 Property
typescript
setLogLevel(level: number): void
uploadLogs(onSuccess?: function, onFailure?: function): Promise<void>

Method detail: 2 / 2 (parameters, returns, errors)

MethodParametersReturnsErrors
setLogLevellevel: numbervoidError code index
uploadLogsonSuccess?: function, onFailure?: functionPromise<void>Error code index
PropertyTyperead-only
onLogFunctionNo

Enums

EnumsMember countExample value
AudioCodec3G722 = 9
ENCRYPTION_MODE10AES_128_ECB = 2
StreamType2HIGH = null
UidType2INT = null
AudioCodec 3 members
Membervalue
G7229
PCMA8
PCMU0
ENCRYPTION_MODE 10 members
Membervalue
AES_128_ECB2
AES_128_GCM5
AES_128_GCM27
AES_128_XTS1
AES_256_GCM6
AES_256_GCM28
AES_256_XTS3
MODE_END9
NONE0
SM4_128_ECB4
StreamType 2 members
Membervalue
HIGHnull
LOWnull
UidType 2 members
Membervalue
INTnull
STRINGnull

error-code constants

This SDK does not expose error-code constants (see Known limitations). For platform REST error codes see Error codes; for cross-platform SDK error identifiers see SDK error identifiers.

Generated by the documentation build pipeline · 2026-10-31 01:24:02 UTC · Documentation center v1.1.0.

Content follows the public API definitions.

ni-meet is a self-hosted RTC PaaS with a LiveKit-based media plane (Apache-2.0) and an Agora-compatible API.