How to add pagination limit in community members query

import { CommunityRepository, CommunityUserSortingMethod } from '@amityco/js-sdk';

const members = CommunityRepository.getCommunityMembers({
  communityId: 'community123',
  memberships: ['member', 'muted'],
  roles: ['roleId1', 'roleId2'],
  sortBy: CommunityUserSortingMethod.FirstCreated,
  search: 'string',

members.on('dataUpdated', models => {
  console.log('Members', models);

// unobserve data changes once you are finished

I am not able to pass limit query on the above function. API is throwing an error. How can I add pagination limit on above function?

Hello, to implement pagination, please refer to this section: Javascript Live Objects/Collections - Amity Docs

Hey, pagination is working fine. But I want to change the page limit from 20 to 10. I am trying to pass limit:10 on the query object but the API is throwing an error. How can I change the page limit?

Got it, thanks for clarifying. I’ll pass this on to our team to check :slight_smile:

Any update on this?

Hi, we’re still checking on this, will let you know once we have the update, thanks.

Hello, thank you for your patience. Following our internal discussion, we want to clarify that there isn’t a limit available for this function by design. In such cases, we recommend utilising pagination.