How to create channel id

const [channelId, setChannelId] = useState(DEFAULT_CHANNEL_ID);
const [overlay, setOverlay] = useState(true);

const newChannel = {
avatarFileId: ‘fileId’,
displayName: ‘Umair’,
tags: [‘tag’],
type: ‘conversation’,
userIds: [‘umair’],
metadata: {
data: ‘anything’,
},
};

const createChannelId = async () => {

try {

  const channel = await ChannelRepository.createChannel(newChannel);
  console.log('channel', channel)
  console.log('channelID', channel.channelId)

} catch (error) {
  console.log('error', error)
}

}

Hello, for ‘Conversation’ type - the channel ID for these channels will always be generated by the SDK, so you don’t have to assign any specific ID for these channels. Please refer to this section for more detail: Create Channel - Amity Docs

it is not return me channel id when we create new channel

Are you using ts sdk? May I know your current sdk version pls?

i am using this version
@amityco/js-sdk”: “^5.36.0”,

Hello, may I confirm a few things,

  • When you create a conversation channel, does it return that it’s successfully created?
  • From the screenshot you have provided, it’s showing “channelId: undefined”, you received that when you tried to query the channel, is that correct?