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 inuseEffect (functional components) or componentDidMount (class components).
- Functional Component
- Class Component
- Chat.js
- CONSTS.js
NuxtJS
Import the SDK dynamically in themounted lifecycle hook.
- index.vue
- chat.vue
- CONSTS.js
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