uid that you assign during creation and cannot change afterward.
How Users connect to other resources
- Auth Tokens — A User needs an auth token to log in via the SDK. You can generate one during creation (
withAuthToken: true) or separately via the Auth Tokens API. - Groups — Users can join up to 2,000 Groups and participate in group messaging and calling.
- Messages — Users send and receive Messages in 1-on-1 or group conversations.
- Friends — Users can add up to 1,000 Friends. Friendships are bidirectional.
- Roles — Users can be assigned a Role that controls permissions. If no role is set, the default role applies.
- Blocked Users — Users can block other users to prevent all direct communication in both directions.
Common workflow
- Create a User with
withAuthToken: trueto get an auth token in the same call. - Use the auth token to initialize the CometChat SDK on the client.
- The user can now send messages, join groups, and make calls.
UIDs are automatically converted to lowercase during creation. For example,
CometChat-UID-1 becomes cometchat-uid-1.Available operations
User properties
The following table lists the properties that the User object supports.Error handling
When API calls fail, CometChat returns structured error responses. The most common errors for User operations:
For the complete list of error codes, see Error Guide.
For all system limits (metadata size, tag counts, ID length, etc.), see Properties and Constraints.