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

Imports

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

Definition

function useDm(
  streamId: string,
  config?: ObservableConfig.FromData<DmModel>,
): ObservableValue<DmModel>
Source: useDm

Parameters

streamId

  • Type: string
The id of the DM to get the data of.

config

  • Type: ObservableConfig.FromData<DmModel>
  • Optional
Configuration options for the observable.

Return Type

The DmModel of the DM.
ObservableValue<DmModel>