ObjectClient reference
Complete reference for the ObjectClient in the Knock JavaScript SDK.
Client for interacting with object channel data operations in the Knock API.
Constructor#
Initializes a new object client instance.
Parameters:
The Knock client instance to use for API requests.
Returns: ObjectClient
Methods#
getChannelData
#Retrieves channel data for a specific object in a collection.
Parameters:
The unique identifier of the object.
The collection that contains the object.
The channel ID to retrieve data for.
Returns: Promise<ChannelData<T>>
Type Parameters:
The expected shape of the channel data. Defaults to GenericData.
Example:
setChannelData
#Sets or updates channel data for a specific object in a collection.
Parameters:
The unique identifier of the object.
The collection that contains the object.
The channel ID to set data for.
The channel data to store for the object.
Returns: Promise<ApiResponse>
Example: