> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: listMembers(options: ListMembersOptions) # Method package: wixMembersV2 # Method menu location: wixMembersV2 --> members --> listMembers # Method Link: https://dev.wix.com/docs/velo/apis/wix-members-v2/members/list-members.md # Method Description: 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. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## List all site members with full parameters (export from backend code) ```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 * } * } */ ``` ## List site members with no options parameters (export from backend code) ```javascript import { members } from 'wix-members.v2'; import { webMethod, Permissions } from 'wix-web-module'; /* Sample options value * * { * "options": null * } */ 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 * } * } */ ``` ## List site members (dashboard page code) ```javascript import { members } from 'wix-members.v2'; /* Sample options value * * { * "options": null * } */ export async function myListMemberFunction(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 * } * } */ ``` ---