ChannelRepository

ChannelRepository

new ChannelRepository()

Methods

channelForId(channelId) → {LiveObject}

Get channel for id.
Parameters:
Name Type Description
channelId string The channel ID of the requested channel.
Throws:
Will throw an error if a channel ID is not valid.
Type
EkoSDKInvalidParameterError
Returns:
The LiveObject instance of channel models.
Type
LiveObject

allChannels() → {LiveCollection}

Get all channels.
Returns:
The LiveCollection instance of channel models.
Type
LiveCollection

channelsWithTags(tags) → {LiveCollection}

Get channels with tags.
Parameters:
Name Type Description
tags Array.<string> The list of tags to filter channels with.
Throws:
Will throw an error if parameters are wrong.
Type
EkoSDKInvalidParameterError
Returns:
The LiveCollection instance of channel models.
Type
LiveCollection

channelsWithFilters(parameters) → {LiveCollection}

Get channels filtered by defined parameters.
Parameters:
Name Type Description
parameters Object
Properties
Name Type Description
tags Array.<string> The list of tags to filter channels with.
excludeTags Array.<string> The list of tags to exclude from channel filter.
Throws:
Will throw an error if parameters are wrong.
Type
EkoSDKInvalidParameterError
Returns:
The LiveCollection instance of channel models.
Type
LiveCollection

createChannel(parameters) → {LiveObject}

Create a new channel. NOTE: If channel already exists, an error will be thrown.
Parameters:
Name Type Description
parameters Object
Properties
Name Type Attributes Description
channelId string The new channel ID.
type string The channel type.
userIds Array.<string> <optional>
User IDs within the new channel.
Throws:
Will throw an error if parameters are wrong.
Type
EkoSDKInvalidParameterError
Returns:
The LiveObject instance of ChannelModel.
Type
LiveObject

joinChannel(parameters) → {LiveObject}

Join a channel. If channel does not yet exist, it will be automatically created and joined.
Parameters:
Name Type Description
parameters Object
Properties
Name Type Description
channelId string The channel ID of the channel to join.
type string The channel type of the channel to join.
Throws:
Will throw an error if parameters are wrong.
Type
EkoSDKInvalidParameterError
Returns:
The LiveObject instance of ChannelModel.
Type
LiveObject

setDisplayName(parameters) → {Promise.<undefined, EkoSDKError>}

Set the display name of current user in the channel.
Parameters:
Name Type Description
parameters Object
Properties
Name Type Description
channelId string The channel ID of the current channel.
displayName string The new display name.
Throws:
Will throw an error if parameters are wrong.
Type
EkoSDKInvalidParameterError
Returns:
Returns a promise.
Type
Promise.<undefined, EkoSDKError>

setMetadata(parameters) → {Promise.<undefined, EkoSDKError>}

Set meta data for channel.
Parameters:
Name Type Description
parameters Object
Properties
Name Type Description
channelId string The channel ID of the current channel.
metadata Object The meta data object.
Throws:
Will throw an error if parameters are wrong.
Type
EkoSDKInvalidParameterError
Returns:
Returns a promise.
Type
Promise.<undefined, EkoSDKError>

setTags(parameters) → {Promise.<undefined, EkoSDKError>}

Set tags for channel.
Parameters:
Name Type Description
parameters Object
Properties
Name Type Description
channelId string The channel ID of the current channel.
tags Array.<string> Set tags of channel.
Throws:
Will throw an error if parameters are wrong.
Type
EkoSDKInvalidParameterError
Returns:
Returns a promise.
Type
Promise.<undefined, EkoSDKError>