Skip to main content

Home Feed

The Home Feed is a vital component of many applications, providing users with a centralized hub to discover and engage with various content, including chatrooms, discussions, and other interactive features. In the context of the React SDK, the Home Feed serves as a customizable and dynamic feed that can be tailored to suit your application's needs.

This guide provide step-by-step instructions, code snippets, and best practices for integrating the Home Feed and fetching community chatrooms in your React app.

Let's dive into the world of Home Feed integration with the React SDK and unlock the potential for vibrant chatroom communities within your application.

Steps to fetch chatrooms in Homefeed

  1. To fetch HomeFeed in groupchat, use the method getHomeFeed() provided by the client.
  2. Pass the required parameter page.
  3. Process the response as per your requirement.
const payload: any = {
page: 1,
};
const response = await lmChatClient.getHomeFeed(payload);

if (response.success) {
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response);
}

Get Home Feed Request

VariableTypeDescriptionOptional
pageintpage

Get Home Feed Response

VariableTypeDescription
successbooleanAPI success status
error_messagestringError message in case of failure
my_chatroomsobjectList of chatrooms

Search Chatrooms

LikeMinds React Chat SDK provides you with the ability to search for the chatroom. This enables you to avoid scrolling down that bottomless list of feeds and rebustly look and open that long lost conversation you once had.

Steps to search chatrooms on home feed

  1. To search for the desired chatroom use the searchChatroom() function provided by the SDK.
  2. Pass in the required parameters.
  3. Parse the response as per your requirement.
const payload: any = {
followStatus: true,
search: "chatroom name",
pageSize: 10,
page: 1,
searchType: "header",
};
const response = await lmChatClient.searchChatroom(payload);

if (response.success) {
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response);
}

Search Chatroom payload

List of parameters provided by the searchChatroom()

VariableTypeDescriptionOptional
followStatusbooleanValues: true for followed chatrooms and false for unfollowed.
pagenumberPage
pageSizenumberQueries returned in each pagesize
searchTypestringCan take two values, header or title string
searchstringKey to search for

Search Chatroom Payload

List of parameters in the response.

VariableTypeDescription
successbooleanAPI success status
error_messageStringError message in case of failure
chatroomsListList of chatrooms