Metadata Methods
Retrieve badge and category definitions without user context.
Available Methods
Method
Description
getBadgeDefinitions()
Get all badge definitions
getCategoryDefinitions()
Get all category definitions
getBadgeDefinitions()
Retrieves all available badge definitions. Useful for displaying all possible badges or building badge showcase UIs.
Usage
const definitions = await client.getBadgeDefinitions();Parameters
None required.
Response Type
interface BadgeDefinitions {
badges: BadgeDefinition[];
}
interface BadgeDefinition {
key: string;
title: string;
shortDescription: string;
longDescription: string;
metric: string;
imageUrl?: string;
levels: BadgeLevel[];
}
interface BadgeLevel {
level: number;
key: string;
value: number;
title: string;
shortDescription: string;
longDescription: string;
}Example
Use Cases
Badge Showcase: Display all badges a user could earn
Progress Tracking: Show requirements for unearned badges
Gamification UI: Build achievement systems
Documentation: Auto-generate badge documentation
getCategoryDefinitions()
Retrieves all scoring category definitions with detailed scoring criteria.
Usage
Parameters
None required.
Response Type
Example
Building a Score Improvement Guide
Caching Recommendations
Badge and category definitions change infrequently. Cache these responses to reduce API calls:
Error Handling
Related
Last updated
