For AI agents: this page in Markdown: https://www.pubnub.com/docs/chat/unreal-chat-sdk/learn/chat-entities/user.md. Documentation index: https://www.pubnub.com/llms-full.txt.
User object
User represents a single user in a chat.
Properties
The User object has the following properties:
Id#- Unique identifier for the user. Access using
GetUserID(). UserData#- Additional data. Access using
GetUserData(). - property of UserData:
UserName# - Display name for the user (must not be empty or consist only of whitespace characters).
- property of UserData:
ExternalID# - User's identifier in an external system. You can use it to match
idwith a similar identifier from an external database. - property of UserData:
ProfileUrl# - URL of the user's profile picture.
- property of UserData:
Email# - User's email address.
- property of UserData:
Custom# - JSON providing custom data about the user. Values must be scalar only; arrays or objects are not supported. Filtering App Context data through the
customproperty is not recommended in SDKs. - property of UserData:
Status# - Tag that lets you categorize your app users by their current state. The tag choice is entirely up to you and depends on your use case. For example, you can use
statusto mark users in your chat app asinvited,active, orarchived. Maximum length is 50 characters. - property of UserData:
Type# - Tag that lets you categorize your app users by their functional roles. The tag choice is entirely up to you and depends on your use case. For example, you can use
typeto group users by their roles in your app, such asmoderator,player, orsupport-agent. Maximum length is 50 characters.
API limits
To learn about the maximum length of parameters used to set user metadata, refer to REST API docs.
Methods
You can call the following methods on the User object.
Click on each method for more details.
Delete()GetChannelRestrictions()GetChannelsRestrictions()GetLastActiveTimestamp()GetMembership()GetMemberships()GetUserData()GetUserID()IsActive()IsMemberOn()IsPresentOn()SetRestrictions()Update()WherePresent()
Streaming
Call these methods to subscribe to or unsubscribe from real-time events on this User object.
StreamInvitations()StopStreamingInvitations()StreamMentions()StopStreamingMentions()StreamRestrictions()StopStreamingRestrictions()StreamUpdates()StopStreamingUpdates()StreamUpdatesOn()
Use case
User methods enable:
- Creating and managing users
- Configuring channel memberships
- Mentioning others in conversations
- Checking user presence status