Hiyve Components - v1.0.0
    Preparing search index...

    Function useUserChat

    • Hook for global chat via CloudClient.

      Returns {
          activeMessages: UserChatMessage[];
          activeRoomName: string | null;
          conversations: ChatConversation[];
          error: string | null;
          fetchConversations: (userId: string) => Promise<void>;
          fetchHistory: (roomName: string, cursor?: string) => Promise<void>;
          isLoading: boolean;
          isLoadingHistory: boolean;
          loadMore: () => void;
          nextCursor: string | null;
          sendMessage: (
              roomName: string,
              message: string,
              userId: string,
          ) => Promise<void>;
          setActiveConversation: (roomName: string) => void;
      }

      Object with chat state and actions

      Uses useCloudClient() to access the CloudClient instance. Manages conversations, message history, sending, and SSE subscriptions. The SSE connection auto-connects when activeRoomName changes.