listMembers( )


Lists site members, given the provided paging and fieldsets.

  • PUBLIC fieldset returns id and profile object. status, privacyStatus and activityStatus are returned as UNKNOWN.
  • FULL fieldset returns all fields.
Permissions
Manage Bookings Services and Settings
Manage Members
Manage Events
Access Verticals by Automations
Set Up Automations
Read Members and Contacts - all read permissions
Read Members
Manage Portfolio
Manage Restaurants - all permissions
Manage Members and Contacts - all permissions
Learn more about app permissions.
Method Declaration
Copy
function listMembers(options: ListMembersOptions): Promise<ListMembersResponse>;
Method Parameters
optionsListMembersOptions

Options for paging, sorting, and specifying fields to return.

Returns
Return Type:Promise<ListMembersResponse>
JavaScript
import { members } from "wix-members.v2"; import { webMethod, Permissions } from "wix-web-module"; /* Sample parameter values: * * { * "options": { * "fieldsets": ["EXTENDED"], * "paging": { * "limit": 20, * "offset": 0 * }, * "sorting": [ * { * "fieldName": "lastName", * "order": "ASC" * } * ] * } * } */ export const myListMemberFunction = webMethod( Permissions.Anyone, async (options) => { try { const memberList = await members.listMembers(options); console.log("Site members:", memberList); return memberList; } catch (error) { console.error(error); // Handle the error } }, ); /* Promise resolves to: * * { * "members": [ * { * "_createdDate": "2024-02-29T11:12:57.000Z", * "_id": "29ae2752-73d2-4a07-8cba-677e1928ed52", * "_updatedDate": "2024-02-29T11:12:57.474Z", * "activityStatus": "ACTIVE", * "contactId": "a2b3c4d5-1234-5678-9876-abcdef123456", * "profile": { * "nickname": "member1", * "slug": "member1_1234" * }, * "privacyStatus": "PUBLIC", * "status": "VERIFIED" * }, * { * "_createdDate": "2024-02-29T11:12:57.000Z", * "_id": "29ae2752-73d2-4a07-8cba-677e1928ed53", * "_updatedDate": "2024-02-29T11:12:57.474Z", * "activityStatus": "ACTIVE", * "contactId": "a2b3c4d5-1234-5678-9876-abcdef123457", * "profile": { * "nickname": "member2", * "slug": "member2_5678" * }, * "privacyStatus": "PUBLIC", * "status": "VERIFIED" * }, * { * "_createdDate": "2024-02-29T11:12:57.000Z", * "_id": "29ae2752-73d2-4a07-8cba-677e1928ed54", * "_updatedDate": "2024-02-29T11:12:57.474Z", * "activityStatus": "ACTIVE", * "contactId": "a2b3c4d5-1234-5678-9876-abcdef123458", * "profile": { * "nickname": "member3", * "slug": "member3_9012" * }, * "privacyStatus": "PUBLIC", * "status": "VERIFIED" * }, * { * "_createdDate": "2024-02-29T11:12:57.000Z", * "_id": "29ae2752-73d2-4a07-8cba-677e1928ed55", * "_updatedDate": "2024-02-29T11:12:57.474Z", * "activityStatus": "ACTIVE", * "contactId": "a2b3c4d5-1234-5678-9876-abcdef123459", * "profile": { * "nickname": "member4", * "slug": "member4_3456" * }, * "privacyStatus": "PUBLIC", * "status": "VERIFIED" * } * ], * "metadata": { * "count": 4, * "offset": 0, * "total": 4, * "tooManyToCount": false * } * } */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?