Hook to set the username of the current user in a stream.

Imports

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

Definition

function useSetUsername(
  streamId: string,
  config?: ActionConfig<Myself['setUsername']>,
): {
    data: void | undefined;
    error: Error | undefined;
    isPending: boolean;
    isSuccess: boolean;
    isError: boolean;
    setUsername: (username: string) => Promise<void>;
}

Source: useSetUsername

Parameters

streamId

  • Type: string

The id of the stream to set the username of.

config

  • Type: ActionConfig<Myself['setUsername']>
  • Optional

Configuration options for the action.

Return Type

The setUsername action and its loading state.

{
    data: void | undefined;
    error: Error | undefined;
    isPending: boolean;
    isSuccess: boolean;
    isError: boolean;
    setUsername: (username: string) => Promise<void>;
}