Documentation Index
Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
AI Integration Quick Reference
AI Integration Quick Reference
Real-time Presence
Configure presence subscription inAppSettings during SDK initialization. The AppSettingsBuilder provides three subscription options:
| Method | Description |
|---|---|
subscribePresenceForAllUsers() | Receive presence updates for all users |
subscribePresenceForRoles(roles) | Receive presence updates only for users with specified roles |
subscribePresenceForFriends() | Receive presence updates only for friends |
You must configure presence subscription in
AppSettings during
CometChat.init() before any presence events will be delivered. See Setup
SDK for details.UserListener to receive presence events:
- User Listener
- TypeScript
| Parameter | Description |
|---|---|
listenerID | An ID that uniquely identifies that listener. |
User class in the listener methods.
We recommend you remove the listener once the activity or view is not in use.
We suggest adding this method when not in use.
- Remove User Listener
| Parameter | Description |
|---|---|
listenerID | Unique identifier for the listener |
User object with presence information.
Relevant fields to access on returned users:
| Field | Getter | Return Type | Description |
|---|---|---|---|
| status | getStatus() | string | Online status of the user ("online" or "offline") |
| lastActiveAt | getLastActiveAt() | number | Timestamp when the user was last active |
- TypeScript
- JavaScript
User List Presence
When fetching users viaUsersRequest, each User object includes presence fields:
| Field | Description |
|---|---|
status | "online" or "offline" |
lastActiveAt | Timestamp of last activity (useful for “Last seen” display) |
Next Steps
Retrieve Users
Fetch user lists with filtering and pagination.
User Management
Create and update users programmatically.
Connection Status
Monitor SDK connection to CometChat servers.
All Real-time Listeners
Overview of all available real-time listeners.