Adding Event Listeners
Use theaddEventListener() method to register event listeners. The method returns an unsubscribe function that you should call to remove the listener when no longer needed.
CometChat Calling SDK v5 - Events for JavaScript
addEventListener() method to register event listeners. The method returns an unsubscribe function that you should call to remove the listener when no longer needed.