Skip to main content
This guide covers how to create and manage connections to Jitsi Meet servers using the JitsiConnection class.

Overview

The JitsiConnection class provides access to the Jitsi Meet server-side video conferencing service. It handles XMPP connection establishment, authentication, and provides the foundation for creating conferences.

Creating a Connection

1

Initialize JitsiMeetJS

First, initialize the library with your configuration:
2

Configure connection options

Define your connection options:
3

Create the connection instance

Instantiate a new connection:
4

Register event handlers

Set up event listeners before connecting:
5

Connect to the server

Initiate the connection:

Connection Options

Required Options

Optional Options

Authentication

Anonymous Connection

Connect without credentials:

Authenticated Connection

Connect with username and password:

JWT Token Authentication

Provide a JWT token during connection creation:

Event Handlers

Managing Connections

Disconnect

Properly close the connection:

Refresh Authentication Token

Renew JWT tokens before expiration:

Get Connection Info

Retrieve connection details:

Feature Management

Advertise client capabilities:

Attaching to Existing Sessions

For optimized reconnection, attach to an existing XMPP session:

Best Practices

Implement exponential backoff for reconnection attempts:
Use connection statistics to monitor quality:
Always remove event listeners when done:

Next Steps

Managing Conferences

Learn how to create and manage conferences

Handling Media Tracks

Work with audio and video tracks