Skip to main content
Quick Reference for AI Agents & Developers
  • The parent View must be sized (flex: 1) — an unsized parent renders the call invisibly
  • CometChatCalls is a singleton: one active session, one mounted Component, and actions take no session id
  • The Component already renders mute / video / camera / layout / leave — do not add your own controls
  • RelatedSession Settings · Events · Actions
This guide covers generating call tokens and joining call sessions using the CometChat Calls SDK.

Generate Token

Before joining a call, you need to generate a call token. The token authenticates the user for the specific call session.
The sessionId should be unique for each call. You can use a UUID, a combination of user IDs, or any unique string that identifies the call session.

Join Session with Component

The CometChatCalls.Component renders the call UI. Pass the generated token and a plain sessionSettings object to join the session. Subscribe to call events with CometChatCalls.addEventListener and unsubscribe on cleanup.
Two equivalent ways to remove a listener. addEventListener returns an unsubscribe function and also accepts an optional AbortSignal:
Call the returned function, or pass { signal } and abort() the controller — one AbortController removes every listener registered with its signal, which is why the examples here use it. Neither supersedes the other; other pages show the unsubscribe form.

Component Props

Complete Example

One Session at a Time

CometChatCalls is a singleton that holds a single active session. Render one CometChatCalls.Component at a time - joining a second session while one is in progress is not supported. Leave the current session first, wait for onSessionLeft, then join the next one.
This is also why leaveSession() and the other actions take no session ID - they always apply to the session that is currently active. See Single Active Session for the full behavior.

Error Handling

Common errors when joining a session: