AI Integration Quick Reference
AI Integration Quick Reference
User object.
The typical flow:
- User registers in your app → Create user in CometChat
- User logs into your app → Log user into CometChat
User deletion is only available via the REST API — there is no client-side SDK method for it.
Creating a User
User creation should ideally happen on your backend via the REST API. For client-side creation (development only), usecreateUser():
- Dart
Parameters
Returns a
User object. See User Class for all available fields.
Response
Response
On Success — A
User object containing all details of the created user:User Object:Error
Error
Updating a User
Like creation, user updates should ideally happen on your backend via the REST API. For client-side updates (development only), useupdateUser():
- Dart
User object has the correct UID set.
Parameters
Returns a
User object. See User Class for all available fields.
Response
Response
On Success — A
User object containing all details of the updated user:Error
Error
Updating Logged-in User
UseupdateCurrentUserDetails() to update the current user without an Auth Key. Note: You cannot update the user’s role with this method.
- Dart
Parameters
The method returns a
User object.
Response
Response
On Success — A
User object containing all details of the updated user:User Object:Error
Error
updateCurrentUserDetails() method one can only update the logged-in user irrespective of the UID passed. Also, it is not possible to update the role of a logged-in user.
Deleting a User
User deletion is only available via the REST API.User Class
Next Steps
Retrieve Users
Fetch and filter user lists with pagination.
User Presence
Monitor real-time online/offline status.
Block Users
Block and unblock users.
Authentication
Log users into CometChat.