Skip to main content

JitsiConnectionEvents

Events related to the XMPP connection lifecycle, authentication, and connection properties.

CONNECTION_ESTABLISHED

Event: connection.connectionEstablished Fires when the connection to the XMPP server has been successfully established.
id
string
The ID of the local endpoint/participant/peer within the context of the established connection
connection.addEventListener(
  JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,
  (id) => {
    console.log('Connected with ID:', id);
  }
);

CONNECTION_FAILED

Event: connection.connectionFailed Fires when the connection attempt has failed.
errType
JitsiConnectionErrors
The type of error associated with the failure
errReason
string
The error message associated with the failure
credentials
object
The credentials used to connect (if any)
errReasonDetails
object
Optional object with details about the error, like shard moving or suspending. Used for analytics purposes.
connection.addEventListener(
  JitsiMeetJS.events.connection.CONNECTION_FAILED,
  (errType, errReason, credentials, errReasonDetails) => {
    console.error('Connection failed:', errType, errReason);
  }
);

CONNECTION_DISCONNECTED

Event: connection.connectionDisconnected Fires when the connection has been disconnected.
msg
string
A message associated with the disconnect, such as the last known error message
connection.addEventListener(
  JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,
  (msg) => {
    console.log('Disconnected:', msg);
  }
);

CONNECTION_REDIRECTED

Event: connection.redirected Fires when the connection is redirected to a visitor node.
connection.addEventListener(
  JitsiMeetJS.events.connection.CONNECTION_REDIRECTED,
  () => {
    console.log('Connection redirected to visitor node');
  }
);

CONNECTION_TOKEN_EXPIRED

Event: connection.token_expired Fires when the connection is trying to resume but the authentication token has expired.
connection.addEventListener(
  JitsiMeetJS.events.connection.CONNECTION_TOKEN_EXPIRED,
  () => {
    console.log('Token expired, need to re-authenticate');
  }
);

DISPLAY_NAME_REQUIRED

Event: connection.display_name_required Fires when the display name is required over this connection and must be supplied when joining the room. This occurs in cases like lobby rooms where display name is mandatory.
connection.addEventListener(
  JitsiMeetJS.events.connection.DISPLAY_NAME_REQUIRED,
  () => {
    console.log('Display name is required to join');
  }
);

PROPERTIES_UPDATED

Event: connection.propertiesUpdated Fires when the connection properties have been updated.
properties
object
All available connection properties (e.g., shard, region)
connection.addEventListener(
  JitsiMeetJS.events.connection.PROPERTIES_UPDATED,
  (properties) => {
    console.log('Connection properties:', properties);
  }
);

Build docs developers (and LLMs) love