> 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: getBadge(_id: string) # Method package: wixMembersV2 # Method menu location: wixMembersV2 --> badges --> getBadge # Method Link: https://dev.wix.com/docs/velo/apis/wix-members-v2/badges/get-badge.md # Method Description: Retrieves information about a badge. The `getBadge` function returns a Promise that resolves when the badge information is retrieved. The `_id` parameter must be an ID from your site's `Members/Badges` collection. Typically, you retrieve the ID from the collection using a query or through a dataset. 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. ## Get badge details. ```javascript import { badges } from 'wix-members.v2'; import { elevate } from 'wix-auth'; /* Sample _id value: '50dca3d3-f142-44ca-87e9-d9302e1d4dd5' */ export async function myGetBadgeFunction(_id) { try { const elevatedGetBadge = elevate(badges.getBadge); const badge = await elevatedGetBadge(_id); console.log('Retrieved badge: ', badge); return badge; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * { * "_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" * } */ ``` ## Get badge details. (export from backend code) ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { badges } from 'wix-members.v2'; import { elevate } from 'wix-auth'; /* Sample _id value: '50dca3d3-f142-44ca-87e9-d9302e1d4dd5' */ export const myGetBadgeFunction = webMethod(Permissions.Anyone, async (_id) => { try { const elevatedGetBadge = elevate(badges.getBadge); const badge = await elevatedGetBadge(_id); console.log('Retrieved badge: ', badge); return badge; } catch (error) { console.error(error); // Handle the error } }); /* Promise resolves to: * { * "_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" * } */ ``` ---