Hook to get data about a channel. You can use this hook to get channel metadata and if the user has joined the channel.

Imports

import { useChannel } from '@towns-protocol/react-sdk'

Definition

function useChannel(
  spaceId: string,
  channelId: string,
  config?: ObservableConfig.FromObservable<Channel>,
): ObservableValue<ChannelModel>

Source: useChannel

Parameters

spaceId

  • Type: string

The id of the space the channel belongs to.

channelId

  • Type: string

The id of the channel to get data about.

config

  • Type: ObservableConfig.FromObservable<Channel>
  • Optional

Configuration options for the observable.

Return Type

The ChannelModel data.

ObservableValue<ChannelModel>