Skip to main content
The JitsiMeetJS object is the main entry point for the lib-jitsi-meet library. It provides methods for initializing the library, creating connections, conferences, and managing local tracks.

Initialization

init()

Initializes the library. This method must be called before using any other library functionality.
JitsiMeetJS.init(options);
options
object
Configuration options for the library

Connection & Conference

JitsiConnection

Reference to the JitsiConnection class constructor.
const connection = new JitsiMeetJS.JitsiConnection(appId, token, options);

joinConference()

Simplified method to join a conference with minimal configuration. Automatically handles connection and conference setup.
const conference = await JitsiMeetJS.joinConference(
  roomName,
  appId,
  token,
  options
);
roomName
string
required
The name of the conference room
appId
string
default:"''"
Application ID (tenant). For JaaS deployments, use your vpaas-magic-cookie-* app ID
token
string | null
default:"null"
JWT token for authentication
options
object
Configuration options
conference
Promise<JitsiConference>
Promise that resolves to a JitsiConference instance when joined successfully

Local Tracks

createLocalTracks()

Creates local media tracks (audio and/or video).
const tracks = await JitsiMeetJS.createLocalTracks(options);
options
object
Track creation options
tracks
Promise<Array<JitsiLocalTrack>>
Promise that resolves to an array of created local tracks

createLocalTracksFromMediaStreams()

Manually creates JitsiLocalTrack instances from existing MediaStream objects.
const tracks = JitsiMeetJS.createLocalTracksFromMediaStreams(tracksInfo);
tracksInfo
Array<object>
required
Array of track information objects
tracks
Array<JitsiLocalTrack>
Array of created local tracks

Media Devices

mediaDevices

Access to the JitsiMediaDevices API for enumerating and managing media devices.
const devices = await JitsiMeetJS.mediaDevices.enumerateDevices();

isMultipleAudioInputSupported()

Checks if the current environment supports multiple simultaneous audio inputs.
const supported = JitsiMeetJS.isMultipleAudioInputSupported();
supported
boolean
true if multiple audio inputs are supported

getActiveAudioDevice()

Detects which audio device currently has an active audio signal.
const activeDevice = await JitsiMeetJS.getActiveAudioDevice();
activeDevice
object
Object containing information about the active audio device

Utility Methods

isWebRtcSupported()

Checks if WebRTC is supported in the current environment.
const supported = JitsiMeetJS.isWebRtcSupported();
supported
boolean
true if WebRTC is supported

isDesktopSharingEnabled()

Checks if desktop sharing is enabled and supported.
const enabled = JitsiMeetJS.isDesktopSharingEnabled();
enabled
boolean
true if desktop sharing is available

setLogLevel()

Sets the logging level for the library.
JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);
level
string
required
Log level: TRACE, DEBUG, INFO, LOG, WARN, ERROR

setLogLevelById()

Sets the log level for a specific logger by ID.
JitsiMeetJS.setLogLevelById(JitsiMeetJS.logLevels.DEBUG, 'modules/RTC/RTC.js');
level
string
required
Log level to set
id
string
required
Logger ID (usually the module path)

addGlobalLogTransport()

Adds a custom log transport to receive all log messages.
JitsiMeetJS.addGlobalLogTransport((level, msg, context) => {
  console.log(`[${level}] ${msg}`);
});
transport
function
required
Function that receives log messages: (level: string, msg: string, context: object) => void

removeGlobalLogTransport()

Removes a previously added log transport.
JitsiMeetJS.removeGlobalLogTransport(transportFunction);
transport
function
required
The transport function to remove

Audio Processing

createAudioMixer()

Creates an AudioMixer for combining multiple audio streams.
const mixer = JitsiMeetJS.createAudioMixer();
mixer
AudioMixer
AudioMixer instance for mixing audio streams

createTrackVADEmitter()

Creates a voice activity detection (VAD) emitter for an audio track.
const vadEmitter = await JitsiMeetJS.createTrackVADEmitter(
  localAudioDeviceId,
  sampleRate,
  vadProcessor
);
localAudioDeviceId
string
required
Target local audio device ID
sampleRate
number
required
Sample rate for VAD processing (256, 512, 1024, 4096, 8192, or 16384)
vadProcessor
object
required
VAD processor implementing:
  • getSampleLength(): number
  • getRequiredPCMFrequency(): number
  • calculateAudioFrameVAD(pcmSample: Float32Array): number
emitter
Promise<TrackVADEmitter>
Promise resolving to a TrackVADEmitter instance

Network & Diagnostics

setNetworkInfo()

Informs the library about the current network status.
JitsiMeetJS.setNetworkInfo({ isOnline: true });
state
object
required

runPreCallTest()

Runs a pre-call network test to check connectivity and quality.
const results = await JitsiMeetJS.runPreCallTest(iceServers);
iceServers
Array<object>
required
Array of ICE server configurations
results
Promise<object>
Promise resolving to test results including network quality metrics

Constants and Events

events

Event name constants for the library:
JitsiMeetJS.events.conference.CONFERENCE_JOINED
JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED
JitsiMeetJS.events.track.TRACK_MUTE_CHANGED
JitsiMeetJS.events.mediaDevices.DEVICE_LIST_CHANGED
  • conference - JitsiConferenceEvents
  • connection - JitsiConnectionEvents
  • track - JitsiTrackEvents
  • mediaDevices - JitsiMediaDevicesEvents
  • connectionQuality - ConnectionQualityEvents
  • detection - DetectionEvents
  • e2eping - E2ePingEvents

errors

Error constants for the library:
JitsiMeetJS.errors.conference
JitsiMeetJS.errors.connection
JitsiMeetJS.errors.track

constants

Library constants:
JitsiMeetJS.constants.recording
JitsiMeetJS.constants.sipVideoGW
JitsiMeetJS.constants.trackStreamingStatus
JitsiMeetJS.constants.transcriptionStatus

logLevels

Available log levels:
JitsiMeetJS.logLevels.TRACE
JitsiMeetJS.logLevels.DEBUG
JitsiMeetJS.logLevels.INFO
JitsiMeetJS.logLevels.LOG
JitsiMeetJS.logLevels.WARN
JitsiMeetJS.logLevels.ERROR

RTCStats

rtcstats

RTCStats integration for WebRTC debugging:
// Check if trace is available
if (JitsiMeetJS.rtcstats.isTraceAvailable()) {
  // Send identity data
  JitsiMeetJS.rtcstats.sendIdentityEntry({ userId: '123' });
  
  // Send custom stats
  JitsiMeetJS.rtcstats.sendStatsEntry('customStat', { value: 42 });
  
  // Listen to events
  JitsiMeetJS.rtcstats.on('connected', () => {
    console.log('RTCStats connected');
  });
}

Version

version

The library version (git commit hash):
console.log(JitsiMeetJS.version);

Build docs developers (and LLMs) love