JitsiConnection represents a connection to the Jitsi Meet XMPP server. It handles authentication, connection management, and provides access to conferences.
Constructor
new JitsiConnection()
Creates a new connection instance.Application identifier for the Jitsi Meet service. For JaaS deployments, use your
vpaas-magic-cookie-* app ID.JWT token for authentication. Can be
null for guest access.Connection configuration options
Connection Management
connect()
Connects to the XMPP server.Connection options
attach()
Attaches to an existing XMPP connection (for connection reuse).disconnect()
Disconnects from the XMPP server.Promise that resolves when disconnection is complete, or boolean for synchronous result
refreshToken()
Renews the JWT token if it’s expiring.The new JWT token
Promise that resolves when token is refreshed
Conference Management
initJitsiConference()
Creates and initializes a new conference.Conference room name (must be lowercase)
Conference configuration options. See JitsiConference for details.
A new JitsiConference instance
Event Management
addEventListener()
Subscribes to connection events.Event name from
JitsiMeetJS.events.connectionEvent handler function
CONNECTION_ESTABLISHED- Connection successfully establishedCONNECTION_FAILED- Connection failed(error: string, msg: string, credentials: object, details: object)CONNECTION_DISCONNECTED- Connection was disconnected(msg: string)WRONG_STATE- Connection is in wrong state for the operation
removeEventListener()
Unsubscribes from connection events.Event name to unsubscribe from
The event handler to remove
Information Methods
getJid()
Returns the JID of the participant associated with the connection.Full JID of the connected participant (e.g.,
user@domain/resource)getConnectionTimes()
Returns connection timing information for diagnostics.Object containing connection timing metrics:
connecting- When connection startedconnected- When connection was established- Various XMPP-specific timings
getLogs()
Retrieves internal connection logs for debugging.Object containing:
metadata- Connection metadata (time, URL, user agent)xmpp- XMPP protocol logs- Jingle session logs
Feature Management
addFeature()
Adds a feature to the local participant’s capabilities.Feature URN to add (e.g.,
urn:xmpp:jingle:apps:dtls:0)If
true, immediately broadcast the updated feature listremoveFeature()
Removes a feature from the local participant’s capabilities.Feature URN to remove
If
true, immediately broadcast the updated feature list