Skip to main content
This guide covers migrating from Calls SDK v4 to v5 for JavaScript (React, Vue, Angular, etc.).

Drop-in Compatibility

Calls SDK v5 is a drop-in replacement for v4. All v4 APIs are preserved as deprecated methods that internally delegate to the new v5 implementations. You can update the package version and your existing code will compile and run without changes.
If you’re using CometChat UI Kits, simply updating the Calls SDK version is sufficient. The UI Kit will continue to work with v5 through the deprecated compatibility layer.

Why Migrate to v5 APIs?

While v4 APIs will continue to work, migrating to v5 APIs gives you:
  • Granular event listeners — subscribe to specific events like onParticipantJoined or onSessionLeft instead of one monolithic OngoingCallListener
  • Dedicated login() method — the Calls SDK now handles its own authentication instead of depending on the Chat SDK’s auth token or REST APIs
  • Simplified initialization — pass plain objects to init() and joinSession() instead of using builder classes
  • Strongly-typed enumsLayoutType, SessionType instead of raw strings

Initialization

v5 accepts a plain object instead of requiring CallAppSettingsBuilder.
CallAppSettingsBuilder still works in v5 — it’s deprecated but functional.

Authentication

In v4, the Calls SDK had no dedicated authentication step. It relied on the Chat SDK’s auth token (CometChat.getUserAuthToken()) or a REST API to obtain an auth token, which you then passed manually to generateToken(). v5 introduces its own login() method. After calling login(), the SDK caches the auth token internally.
Call CometChatCalls.login() once after your user authenticates. The SDK stores the auth token internally, so subsequent calls like generateToken() and joinSession() use it automatically.

Session Settings

CallSettingsBuilder is replaced by passing a plain SessionSettings object directly to joinSession().

Settings Property Mapping


Joining a Session

startSession() is replaced by joinSession().

Session Control (Actions)

Static methods remain on CometChatCalls but some have been renamed.

Event Listeners

The single OngoingCallListener is replaced by addEventListener() with specific event types.

v4: Single Listener Object

v5: Granular Event Subscriptions

addEventListener() returns an unsubscribe function. Call it to remove the listener. You can also pass an AbortSignal for cleanup.

Event Mapping


Deprecated Classes Summary