> 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: listBadges(options: ListBadgesOptions) # Method package: wixMembersV2 # Method menu location: wixMembersV2 --> badges --> listBadges # Method Link: https://dev.wix.com/docs/velo/apis/wix-members-v2/badges/list-badges.md # Method Description: Lists the badges. The `listBadges` function returns a Promise that resolves when the badges are retrieved. Retrieves up to 1000 badges, given the requested paging. Default paging.limit is 100, paging.offset - 0. This function is not a universal function and runs only on the backend. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Lists all badges. ```javascript import { badges } from 'wix-members.v2'; import { elevate } from 'wix-auth'; /* Sample options value: * { * paging: { * limit: 3, * offset: 0 * } * } */ export async function myListBadgesFunction (options) { try { const elevatedListBadges = elevate(badges.listBadges); const myBadges = await elevatedListBadges(options); console.log('List of badges: ', myBadges) return myBadges; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * { * "badges": [ * { * "_createdDate": "2024-01-18T13:53:11.659Z", * "_id": "b657b857-774a-4dde-9b0e-f364d61092ea", * "_updatedDate": "2024-01-18T13:53:11.659Z", * "backgroundColor": "#796EFF", * "description": "Completed challenging tasks and achieved milestones.", * "icon": "https://static.wixstatic.com/shapes/11062b_30b982c4ceb141d884fa15ecfb07d26c.svg", * "permissionsEnabled": false, * "slug": "achievement-unlocked", * "textColor": "#FFFFFF", * "title": "Achievement Unlocked" * }, * { * "_createdDate": "2024-01-18T13:53:37.067Z", * "_id": "e80fed60-687e-4b91-a24c-252c4b32227b", * "_updatedDate": "2024-01-18T13:53:37.067Z", * "backgroundColor": "#FF5C79", * "description": "Recognized for outstanding community contributions and leadership.", * "icon": "https://static.wixstatic.com/shapes/cb523e8b3f9b4908b85a4a1c577af32b.svg", * "permissionsEnabled": false, * "slug": "community-hero", * "textColor": "#FFFFFF", * "title": "Community Hero" * }, * { * "_createdDate": "2024-01-18T10:27:14.878Z", * "_id": "215be5d9-4b32-4861-9eb5-2152930dd0b4", * "_updatedDate": "2024-01-18T10:27:14.878Z", * "backgroundColor": "#13785C", * "description": "Most comments on site.", * "icon": "https://static.wixstatic.com/shapes/11062b_73d6472a03884c758f9d39f83a1218c2.svg", * "permissionsEnabled": false, * "slug": "top-commenter", * "textColor": "#FFFFFF", * "title": "Top commenter" * } * ], * "metadata": { * "count": 3, * "offset": 0, * "tooManyToCount": false, * "total": 3 * } * } */ ``` ## Lists all badges. (export from backend code) ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { badges } from 'wix-members.v2'; import { elevate } from 'wix-auth'; /* Sample options value: * { * paging: { * limit: 3, * offset: 0 * } * } */ export const myListBadgesFunction = webMethod(Permissions.Anyone, async (options) => { try { const elevatedListBadges = elevate(badges.listBadges); const myBadges = await elevatedListBadges(options); console.log('List of badges: ', myBadges) return myBadges; } catch (error) { console.error(error); // Handle the error } }); /* Promise resolves to: * { * "badges": [ * { * "_createdDate": "2024-01-18T13:53:11.659Z", * "_id": "b657b857-774a-4dde-9b0e-f364d61092ea", * "_updatedDate": "2024-01-18T13:53:11.659Z", * "backgroundColor": "#796EFF", * "description": "Completed challenging tasks and achieved milestones.", * "icon": "https://static.wixstatic.com/shapes/11062b_30b982c4ceb141d884fa15ecfb07d26c.svg", * "permissionsEnabled": false, * "slug": "achievement-unlocked", * "textColor": "#FFFFFF", * "title": "Achievement Unlocked" * }, * { * "_createdDate": "2024-01-18T13:53:37.067Z", * "_id": "e80fed60-687e-4b91-a24c-252c4b32227b", * "_updatedDate": "2024-01-18T13:53:37.067Z", * "backgroundColor": "#FF5C79", * "description": "Recognized for outstanding community contributions and leadership.", * "icon": "https://static.wixstatic.com/shapes/cb523e8b3f9b4908b85a4a1c577af32b.svg", * "permissionsEnabled": false, * "slug": "community-hero", * "textColor": "#FFFFFF", * "title": "Community Hero" * }, * { * "_createdDate": "2024-01-18T10:27:14.878Z", * "_id": "215be5d9-4b32-4861-9eb5-2152930dd0b4", * "_updatedDate": "2024-01-18T10:27:14.878Z", * "backgroundColor": "#13785C", * "description": "Most comments on site.", * "icon": "https://static.wixstatic.com/shapes/11062b_73d6472a03884c758f9d39f83a1218c2.svg", * "permissionsEnabled": false, * "slug": "top-commenter", * "textColor": "#FFFFFF", * "title": "Top commenter" * } * ], * "metadata": { * "count": 3, * "offset": 0, * "tooManyToCount": false, * "total": 3 * } * } */ ``` ---