This guide covers generating call tokens and joining call sessions using the CometChat Calls SDK.Documentation Index
Fetch the complete documentation index at: https://cometchat-22654f5b-v5-calling-sdk-enhancement-react-native.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Generate Token
Before joining a call, you need to generate a call token. The token authenticates the user for the specific call session.| Parameter | Type | Required | Description |
|---|---|---|---|
sessionId | string | Yes | Unique identifier for the call session |
authToken | string | No | User’s auth token (uses logged-in user’s token if not provided) |
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
TheCometChatCalls.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.
Component Props
| Prop | Type | Required | Description |
|---|---|---|---|
callToken | string | Yes | Token generated from generateToken() |
sessionSettings | object | No | Plain session settings object |
Session ID Strategies
Choose a session ID strategy based on your use case:1:1 Calls
For direct calls between two users, create a deterministic session ID:Group Calls
For group calls, use the group ID or a unique identifier:Unique Sessions
For one-time calls, generate a unique ID:Complete Example
Error Handling
Common errors when joining a session:| Error Code | Description |
|---|---|
ERROR_SESSION_ID_MISSING | Session ID is empty or not provided |
ERROR_AUTH_TOKEN_MISSING | User is not logged in or auth token is missing |
ERROR_SDK_NOT_INITIALIZED | SDK not initialized. Call init() first |
Related Documentation
- Session Settings - Configure call settings
- Actions - Control the call programmatically
- Events - Handle call events