How to fetch user list around 1.5K? And fetch channel list more than 100?

[Problem/Question]
we have customer who have more than 2k users. And I am using React UI KIT.
In this case, is it possible to fetch user list at once regardless of limit?
If not, please let me know best practice code for fetching multi thousand user list with React UI Kit.

And how about channel list? it should be updated periodically but how make it possible to fetch channel list more than 20 or 100?

Hello @BizimplyHan

Welcome to the Sendbird Community!

When fetching a large user list with React UI Kit, it is not recommended to fetch all users at once regardless of the limit. Fetching a large number of users in a single API call can cause performance issues and slow down your application.

Instead, you can use pagination to fetch users in smaller batches. The ApplicationUserListQuery instance provides a limit parameter that allows you to specify the number of users to retrieve in each API call. You can set the limit parameter to a value that suits your needs, such as 100 or 200.

Here’s an example of how you can fetch a multi-thousand user list using pagination with React UI Kit:

const queryParams: ApplicationUserListQueryParams = {
  limit: 100, // Set the limit to the desired value
};

const query = sb.createApplicationUserListQuery(queryParams);
const users = await query.next();

You can then use the next() method of the query instance to fetch the next batch of users. Repeat this process until you have fetched all the users.

Similarly, when fetching channel lists, you can use pagination to fetch channels in smaller batches. The OpenChannelListQuery and GroupChannelListQuery instances provide a limit parameter that allows you to specify the number of channels to retrieve in each API call.

Here’s an example of how you can fetch a channel list with a larger limit:

const openChannelQuery = sb.OpenChannel.createOpenChannelListQuery();
openChannelQuery.limit = 100; // Set the limit to the desired value
const openChannels = await openChannelQuery.next();

const groupChannelQuery = sb.GroupChannel.createMyGroupChannelListQuery();
groupChannelQuery.limit = 100; // Set the limit to the desired value
const groupChannels = await groupChannelQuery.next();

You can then use the next() method of the query instances to fetch the next batch of channels. Repeat this process until you have fetched all the channels.

By using pagination, you can efficiently fetch a large number of users and channels without impacting the performance of your application.

Let me know if this helps in clarifying a few things here.