Channel Member Data

Member Specific Data

You can set member specific information.

  • You can store data in memberInfo and privateData fields in the form of a map.

  • privateTag field can be used as a search filter when retrieving list of channels.

  • privateData is only visible to the current user while memberInfo is publicly visible to anyone.

  • You can enter up to 5 key-value pairs in memberInfo and privateData fields. The maximum size of key is 128 characters and the maximum size of value is 1024 characters. Both key and value must be strings.

// update memberInfo
const memberInfo = await client.updateChannelMemberInfo({channelId: 'my_channel_id', memberInfo: {"profileImage": "my public profile fo this channel"}});

// you can retrieve memberInfo from member object.
const member = await client.getChannelMember({channelId: 'my_channel_id', userId: 'my_user_id'});

// update member specific private data
// updated member private data is available as 'privateData' in channel object
const channelObjResponse = await client.updatePrivateData({channelId: 'my_channel_id', privateData: {"username": "my fake username"}});

// see 'privateData' field in channel object
await client.getChannel({channelId: 'my_channel_id'});

Channel Private Tag

You can put a private tag on channel to help with channel search.

//  update channel tag
await client.updateChannelPrivateTag({channelId: 'my_channel_id', privateTag: 'tag1'});

// see 'privateTag' field in channel object
await client.getChannel({channelId: 'my_channel_id'});

// get channels that match the private tag
await client.getChannels({privateTag: 'tag1'});

Last updated