Skip to main content

Methods

Get Room ID

Returns the 12 digit unique ID of the room, eg: afuxxx-rusxxx.

const id = await plugin.room.getID();

Get ID of plugin Initiator

Returns the id of the user that enabled the plugin.

const host = await plugin.room.enabledBy();

Get Room Name

Returns the name (meeting title) of the room.

const name = await plugin.room.getName();

Get All Peers

Returns a list of all the participants in the meeting (excluding self).

const peers = await plugin.room.getPeers();

Get Peer

This method returns the participant object, It takes an optional ID param. A user can get his details by not passing an ID.

const id = '..,';
const participant = await plugin.room.getPeer(id);
const self = await plugin.room.getPeer();
note

The getPeer method returns undefined if the peer with given ID has left the meeting.

Send Chat Message

Sends a text, image or file message to the meeting.

ParamTypeDescriptionDefault ValueRequired
messageChatMessageChat message payload.-true
type ChatMessage =
| { type: 'text'; message: string }
| { type: 'image'; image: File }
| { type: 'file'; file: File };
const message: ChatMessage = {
type: 'text',
message: 'Hello everyone',
};

await plugin.room.sendChatMessage(message);