Skip to content
Cloudflare Docs

Session Lifecycle

In default meeting ui, we have seen how to initialize the SDK and join a session and render the default meeting ui component.

This bags the question of what happens to a peer as they move through a session, when do they go to setup screen, waitlist screen, ended screen or any other screen, and how you can hook into these events to perform custom actions.

Before diving into how the UI states work under the hood, let's first understand the lifecycle of a peer in a session to understand the events that are triggered.

Lifecycle of a Peer in a Session

Peer Lifecycle In a Session

Here’s how the peer lifecycle works:

  1. Initialization state: When the SDK is initialized, the peer first sees a Setup Screen, where they can preview their audio and video before joining.
  2. Join intent: When the peer decides to join, one of two things happens:
    • If waitlisting is enabled, they are moved to a Waitlist and see a Waitlist screen.
    • If not waitlisted, they join the session and see the main Meeting screen (Stage), where they can interact with others.
  3. During the session: The peer can see and interact with others in the main Meeting screen (Stage).
  4. Session transitions:
    • If the peer is rejected from the waitlist, they see a dedicated Rejected screen.
    • If the peer is kicked out, they see an Ended screen and the session ends for them.
    • If the peer leaves voluntarily, or if the meeting ends, they see an Ended screen, and the session ends for them.

Each of these screens is built with UI Kit components, which you can fully customize to match your app’s design and requirements.

The UI Kit SDKs automatically handle which notifications or screens to show at each state, so you don’t have to manage these transitions manually.

In upcoming pages, we will see how to hook into these events to perform custom actions and to build your own custom meeting experience.