What are Objects?
The Objects feature provides easy-to-use, serverless storage to store metadata for users, channels, and memberships without the need of setting up your own database. You can optionally store metadata, including custom properties, for your users in applications. PubNub triggers events when object data is set or removed from the database, which means that you can receive these events in real time and update your front-end application accordingly.
The Metadata API for PubNub can be used to get and set metadata for users, channels, channel memberships, and channel members. This API can also set the filtering language definition to filter for specific metadata in the database, and is similar to the stream filtering language.
Watch the video below or follow the step-by-step instructions to learn how to enable Objects in your PubNub keyset. Need extra information? You can also check out PubNub’s official documentation on Objects to learn more about how you can implement Objects in your own application.
Login to the Admin Portal.
Click on the apps tab on the left hand side of the portal.
Click on an application. You will be brought to the keysets page for this application.
Create a new keyset by clicking on the “Create New Keyset” button. You will be brought to the configuration page for this keyset.
Enable the Objects feature by clicking the slider.
The Region setting is the region where your objects are stored. Please note that the region cannot be modified after saving changes to the keyset.
If the User and Channel Metadata Events settings are enabled, the user and channel metadata events are triggered when user or channel metadata is set or removed in the objects database respectively.
When the Membership Events setting is enabled, membership events are triggered when memberships are added, updated, or removed in the objects database.
The final two settings Disallow Get All Channel and User Metadata settings do not allow the “Get All Channel/User Metadata” calls, if enabled respectively.
These calls return a paginated list of channel/user metadata objects.
Click on Save Changes to save these updated changes.