usePermissions

usePermissions(sessionId?: string): Object

usePermissions is a convenience hook to access the local participant's permissions.

Params

ParameterOptionalTypeDescription
sessionIdstringA unique identifier for the participant

Return type

Returns an object with the following properties:

NameTypeDescription
canSendAudiobooleantrue in case the local participant's permissions.canSend is true, or includes 'audio'
canSendVideobooleantrue in case the local participant's permissions.canSend is true, or includes 'video'
canSendCustomAudiobooleantrue in case the local participant's permissions.canSend is true, or includes 'customAudio'
canSendCustomVideobooleantrue in case the local participant's permissions.canSend is true, or includes 'customVideo'
canSendScreenAudiobooleantrue in case the local participant's permissions.canSend is true, or includes 'screenAudio'
canSendScreenVideobooleantrue in case the local participant's permissions.canSend is true, or includes 'screenVideo'
hasPresencebooleantrue in case the local participant's permissions.hasPresence is true
canAdminParticipantsbooleantrue in case the local participant's permissions.canAdmin is true, or includes 'participants'
canAdminStreamingbooleantrue in case the local participant's permissions.canAdmin is true, or includes 'streaming'
canAdminTranscriptionbooleantrue in case the local participant's permissions.canAdmin is true, or includes 'transcription'
permissionsObjectThe local participant's permissions object, as returned from participants()

Sample code