Browse SDKs · uni-app / uni-app x
SDKsuni-appEnterprise

Get a call room token

OpenIM uni-app / uni-app x SDK guide for Get a call room token.

Copy
import { signalingGetTokenByRoomID } from '@/uni_modules/unix-openim-sdk'

const roomCredentials = await signalingGetTokenByRoomID({ roomID })

Use the Commercial signalingGetTokenByRoomID() operation when the application already knows a room ID but needs fresh join credentials.

The Promise resolves to OpenIMSignalingGetTokenByRoomIDResult | null, with optional token and liveURL fields. It does not return roomID again. Join the media engine with the room ID supplied to this request only after obtaining a valid token.

Room tokens are short-lived secrets. Keep them only in memory and never write them to logs, URLs, analytics events, files, or persistent storage. Stop the join flow when fields are absent or expired; do not reuse old credentials.