Channel Initialization

Last Edit: Jan 15 2021

Here’s how you can initialize a single channel for later use. Please note that this will only create a channel object without making any API call. Once the channel is initialized you can use one of these methods: query, watch, create.

const conversation ='messaging', 'channel-name', {
    name: 'Founder Chat',
    image: '',
    members: ['thierry', 'tommaso'],

await conversation.create();

conversation =
    'messaging', 'thierry-tommaso-1', 
    data: {
      'name'   => 'Founder Chat',
      'image'  => '',
      'members => ['thierry', 'tommaso'],

final channel =
  id: "travel",
  extraData: {
    "name": "Founder Chat",
    "image": "",
    "members": ["thierry", "tommaso"],

$channelConf = [ 
	'name' => 'Founder Chat',
	'image' => '',
  'members' => ['thierry', 'tommaso']

$channel = $client->Channel("messaging", "thierry-tommaso-1", $channelConf);

val channelController =, channelId)

val extraData = mutableMapOf<String, Any>()
val members: MutableList<String> = ArrayList()

extraData["name"] = "Founder Chat"
extraData["image"] = ""


    .create(members, extraData)
    .enqueue {  result ->
        if (result.isSuccess) {
            val channel =
        } else {
            val error = result.error()

// Create an extra data for a channel.
// ChannelExtraDataCodable is an extension of Codable that makes sure you have common fields 
// used by the UI library (name and imageURL)
struct MyChannelData: ChannelExtraDataCodable {
    var name: String?
    var imageURL: URL?
    let info: String // this is our custom field :)

// Register once your channel extra data type, we'll need it for decoding
Channel.extraDataType = MyChannelData.self

let data = MyChannelData(name: "Travel", imageURL: nil, info: "Awesome channel about traveling")
let channel = .messaging, id: "travel", extraData: data)

// Create the channel
channel.create { (result) in
    // handle result

ChannelController channelController =, channelId);

Map<String, Object> extraData = new HashMap<>();
List<String> members = new ArrayList<>();

extraData.put("name", "Founder Chat");
extraData.put("image", "");


channelController.create(members, extraData).enqueue(result -> {
    if (result.isSuccess()) {
        Channel channel =;
    } else {
        ChatError error = result.error();
    return Unit.INSTANCE;

Channel Initialization Parameters

Name Type Description Default Optional
type string The channel type. Default types are livestream, messaging, team, gaming and commerce. You can also create your own types. -
id string The channel id (optional). If you don't specify an ID the ID will be generated based on the list of members. (max length 64 characters) -
channel data string Extra data for the channel. Must not exceed 5KB in size. default
The channel data can contain any number of custom fields. However, there are a few reserved fields that Stream uses:

Reserved Fields for Custom Channel Data

Name Type Description
name string The channel name. No special meaning, but by default the UI component will try to render this if the property is present.
image string The Channel image. Again there is no special meaning but by default, the UI component will try to render this if the property is present.
members array The members participating in this Channel. Note that you don't need to specify members for a live stream or other public chat. You only need to specify the members if you want to limit access of this chat to these members and subscribe them to future updates