Commands API for Redux SDK

Commands are functions that your app can dispatch to perform PubNub server operations and process the response. When you dispatch a command, the command returns an action that the process has begun. After the operation is performed on the PubNub server, the command dispatches an action that acknowledges either the success or failure of the operation. The reducer that responds to each action updates the application state in your store.

The commands for each feature fall into the following operational categories:

Fetch operations

Command NameDescription
fetchUserData
Returns the specified user object, optionally including the user's custom data object.
fetchAllUserData
Returns a paginated list of user objects, optionally including each user's custom data object.
fetchChannelData
Returns the specified channel object, optionally including the channel's custom data object.
fetchAllChannelData
Returns a paginated list of channel objects, optionally including each channel's custom data object.
fetchMemberships
Returns a list of channel memberships for a specified user.
fetchChannelMembers
Returns a list of members in a specified channel.
fetchMessageHistory
Fetch historical messages of a channel.
fetchHereNow
Obtain information about the current state of a channel, including a list of unique userIds currently subscribed to the channel and the total occupancy count of the channel.
fetchPresenceState
Get the current state information based on the current uuid for either specified channels or channelGroups.

Set operations

Command NameDescription
setUserData
Set data associated with a UUID.
setChannelData
Set data associated with a channel.
setMemberships
Set user memberships for a list of channels.
setChannelMembers
Set channel memberships for a list of users.

Delete operations

Command NameDescription
removeUserData
Deletes the specified user object.
removeChannelData
Deletes the specified channel object.
removeMemberships
Remove a user from a list of channel.
removeChannelMembers
Remove a list of members from a channel.

Send operations

Command NameDescription
sendMessage
Send a message packaged in a request object.

External References

For more details about the concepts discussed in the PubNub Redux framework documentation, you should review the following references:

Last updated on