Skip to content
Cloudflare Docs

RealtimeKitClient

The RealtimeKitClient class is the main class of the web core library. An object of the RealtimeKitClient class can be created using await RealtimeKitClient.init({ ... }). Typically, an object of RealtimeKitClient is named meeting.

module.exports ⏏

Kind: Exported class

new module.exports(context, controller)

ParamType
contextIContext
controllerController

module.exports.participants

The participants object consists of 4 maps of participants, waitlisted, joined, active, pinned. The maps are indexed by peerIds, and the values are the corresponding participant objects.

Kind: instance property of module.exports

module.exports.self

The self object can be used to manipulate audio and video settings, and other configurations for the local participant. This exposes methods to enable and disable media tracks, share the user's screen, etc.

Kind: instance property of module.exports

module.exports.meta

The room object stores information about the current meeting, such as chat messages, polls, room name, etc.

Kind: instance property of module.exports

module.exports.ai

The ai object is used to interface with AI features. You can obtain the live meeting transcript and use other meeting AI features such as summary, and agenda using this object.

Kind: instance property of module.exports

module.exports.plugins

The plugins object stores information about the plugins available in the current meeting. It exposes methods to activate and deactivate them.

Kind: instance property of module.exports

module.exports.chat

The chat object stores the chat messages that were sent in the meeting. This includes text messages, images, and files.

Kind: instance property of module.exports

module.exports.polls

The polls object stores the polls that were initiated in the meeting. It exposes methods to create and vote on polls.

Kind: instance property of module.exports

module.exports.connectedMeetings

The connectedMeetings object stores the connected meetings states. It exposes methods to create/read/update/delete methods for connected meetings.

Kind: instance property of module.exports

module.exports.__internals__

The internals object exposes the internal tools & utilities such as features and logger so that client can utilise the same to build their own feature based UI. Logger (internals.logger) can be used to send logs to servers to inform of issues, if any, proactively.

Kind: instance property of module.exports

module.exports.join()

The join() method can be used to join the meeting. A roomJoined event is emitted on self when the room is joined successfully.

Kind: instance method of module.exports

module.exports.leave()

The leave() method can be used to leave a meeting.

Kind: instance method of module.exports

module.exports.joinRoom()

Deprecated

Kind: instance method of module.exports

module.exports.leaveRoom([state])

Deprecated

Kind: instance method of module.exports

ParamType
[state]LeaveRoomState

module.exports.initMedia([options], [skipAwaits], [cachedUserDetails])

Kind: static method of module.exports

ParamTypeDefault
[options]Object
[options.video]boolean
[options.audio]boolean
[options.constraints]MediaConstraints
[skipAwaits]booleanfalse
[cachedUserDetails]CachedUserDetails

module.exports.init(options)

The init method can be used to instantiate the RealtimeKitClient class. This returns an instance of RealtimeKitClient, which can be used to perform actions on the meeting.

Kind: static method of module.exports

ParamDescription
optionsThe options object.
options.authTokenThe authorization token received using the API.
options.baseURIThe base URL of the API.
options.defaultsThe default audio and video settings.

module.exports.setupContext(peerId, options, meetingId, args)

Kind: static method of module.exports

ParamType
peerIdstring
optionsRealtimeKitClientOptions
meetingIdstring
argsany