Skip to main content
The CometChat SDK requires browser APIs (window, WebSocket) and cannot run on the server. For SSR frameworks, initialize the SDK only on the client side.

Next.js

Import the SDK dynamically in useEffect (functional components) or componentDidMount (class components).

NuxtJS

Import the SDK dynamically in the mounted lifecycle hook.

Ionic/Cordova

For Ionic and Cordova applications, use the JavaScript SDK directly. Import and initialize in your root component:
The dedicated Ionic Cordova SDK has been deprecated. For new Ionic/Cordova applications, use the JavaScript SDK as shown above. Existing users can refer to the legacy documentation.

Next Steps

Authentication

Log in users with Auth Key or Auth Token

Send Messages

Send your first message