A hook that allows you to create a new group direct message (GDM).
import { useCreateGdm } from '@towns-protocol/react-sdk'
function useCreateGdm( config?: ActionConfig<Gdms["createGDM"]>, ): { data: { streamId: string; } | undefined; error: Error | undefined; isPending: boolean; isSuccess: boolean; isError: boolean; createGDM: (userIds: string[], channelProperties?: EncryptedData | undefined, streamSettings?: { disableMiniblockCreation: boolean; lightStream: boolean; } | undefined) => Promise<{ streamId: string; }>; }
Source: useCreateGdm
ActionConfig<Gdms["createGDM"]>
The action config.
An object containing the createGDM action and the rest of the action result.
createGDM
{ data: { streamId: string; } | undefined; error: Error | undefined; isPending: boolean; isSuccess: boolean; isError: boolean; createGDM: (userIds: string[], channelProperties?: EncryptedData | undefined, streamSettings?: { disableMiniblockCreation: boolean; lightStream: boolean; } | undefined) => Promise<{ streamId: string; }>; }
Was this page helpful?