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

  1. Badge Showcase: Display all badges a user could earn

  2. Progress Tracking: Show requirements for unearned badges

  3. Gamification UI: Build achievement systems

  4. 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


Last updated