Search.../

getBadge( )

Developer Preview

Retrieves information about a badge.

Description

The getBadge function returns a Promise that resolves when the badge information is retrieved.

Syntax

function getBadge(_id: string): Promise<GetBadgeResponse>

getBadge Parameters

NAME
TYPE
DESCRIPTION
_id
string

Badge ID.

Returns

Return Type:

Promise<
GetBadgeResponse
>
NAME
TYPE
DESCRIPTION
badge
Badge

Badge.

Was this helpful?

getBadge example

Copy Code
1import { badges } from 'wix-members.v2';
2
3 async function getBadge(id) {
4 try {
5 const result = await badges.getBadge(id);
6
7 return result;
8 } catch (error) {
9 console.error(error);
10 // Handle the error
11 }
12 }
13