A hook that allows you to create a new group direct message (GDM).

Imports

import { useCreateGdm } from '@river-build/react-sdk'

Definition

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?: PlainMessage<StreamSettings> | undefined) => Promise<{
        streamId: string;
    }>;
}

Source: useCreateGdm

Parameters

config

  • Type: ActionConfig<Gdms['createGDM']>
  • Optional

The action config.

Return Type

An object containing the createGDM action and the rest of the action result.

{
    data: {
        streamId: string;
    } | undefined;
    error: Error | undefined;
    isPending: boolean;
    isSuccess: boolean;
    isError: boolean;
    createGDM: (userIds: string[], channelProperties?: EncryptedData | undefined, streamSettings?: PlainMessage<StreamSettings> | undefined) => Promise<{
        streamId: string;
    }>;
}