Create Room Member Token (private) for Broadcast Room
Use: Streamer/Broadcaster
Issue Room Member Tokens to grant users specific permissions within a broadcast room.
Joining a broadcast room that belongs to an event is almost exactly the same as joining a normal room, except requiring to set mcuStream in metadata to true.
When a member joins a broadcast room with mcuStream=true in the metadata that member’s video and audio will be used to stream/broadcast to all viewers.
In production, call this from your backend using your company’s API key. For development and testing, you can run it in your frontend to verify your integration without backend setup.
Example
file.ts
export const createEventRoomMemberToken = async () => {
const opts = {
method: 'POST',
headers: {
'content-type': 'application/json',
'Authorization': `Bearer ${'your-api-key'}`
},
body: JSON.stringify({
arguments: [
{
user_id: '8ae5a0b9-9206-44ca-950b-5a0b51f82d4e',
room_id: 'c2ed3890-716d-4380-a597-d860ecacada0',
metadata: {
note: 'temporary moderator',
mcuStream: 'true'//any member with mcuStream=true joining a broadcast room will stream
},
permissions: [
"PermissionRoom"
]
}
]
})
};
const res = await fetch('https://room.dev.zu.casa/room.tokens.private.v1.Service/Create', opts).then(r => r.json());
return res.tokens[0];
};Sample Response
file.json
{
"tokens": [
"52jAQLH01rJTSUaAdFFvnHY6sqBTyMn1PYrlk4Mtz4-VskjLxmQcXGgarceWIaVjLzzrnza_MUkHpFoLur4eqiEUcUUSMdMlSAxgHb7aiBAq-kp89pyFO-nNE2oDaPAJ6AVLcdVL_YRgjjY73Tfh5mv91zaDc0SIAB6XciLuBVVO_itpj43d9aEZ3FfW1kBlFer46iWpazgFo1MOhZMj7EI0oBciAjUxpDWzdPd2FSwLsKXa31c4LE6-hhmIDZE5xiqcfmZp2a3tv3QVa_Pfp75pZ8lWDAEfRpq3uzGHvjcj_jzWzvKpxV4cOlzTK5CR7ojcp0C8WydAvVD-H6zTDK4R-CkYW7fn-D046PDmSvNq5xEPccUk"
]
}Permission
Below are all available permissions and what they do. Names match the API exactly.
Chat permissions (100–199)
| Permission | Implied By | Description |
|---|---|---|
PermissionChat | — | Grants all chat capabilities below. |
PermissionChatBlock | PermissionChat | Block a member from using chat. |
PermissionChatUnblock | PermissionChat | Remove a chat block for a member. |
PermissionChatMute | PermissionChat | Mute a member (they cannot send messages). |
PermissionChatUnmute | PermissionChat | Unmute a member. |
PermissionChatMessageDelete | PermissionChat | Delete messages in chat. |
PermissionChatKick | PermissionChat | Kick a member out of the chat. |
permissionChatSlowmodeBypass | PermissionChat | Bypass slowmode restrictions when sending messages. |
Room permissions (200–299)
| Permission | Implied By | Description |
|---|---|---|
PermissionRoom | — | Grants general room management capabilities below. |
PermissionRoomBlock | PermissionRoom | Block a member from the room (deny access). |
PermissionRoomUnblock | PermissionRoom | Remove an room-level block for a member. |
PermissionRoomKick | PermissionRoom | Kick a member from the room (one-time removal). |