Type Definitions

Complete TypeScript type reference for the DotPassport SDK.

Client Types

DotPassportConfig

Configuration options for initializing the client.

interface DotPassportConfig {
  apiKey: string;      // Required: Your API key
  baseUrl?: string;    // Optional: Custom API URL
}

DotPassportError

Custom error class for all API errors.

class DotPassportError extends Error {
  statusCode: number;    // HTTP status code
  response: any;         // Full error response
  message: string;       // Error message

  constructor(message: string, statusCode: number, response?: any);
}

Data Types

UserProfile

User profile information.

UserScores

User reputation scores.

SpecificCategoryScore

Detailed category score with definition.

UserBadges

User badges collection.

SpecificUserBadge

Specific badge with definition.

Definition Types

CategoryDefinition

Category metadata and scoring rules.

CategoryDefinitions

Collection of all category definitions.

BadgeDefinition

Badge metadata and requirements.

BadgeDefinitions

Collection of all badge definitions.

Widget Types

BaseWidgetConfig

Base configuration for all widgets.

ReputationWidgetConfig

Reputation widget configuration.

BadgeWidgetConfig

Badge widget configuration.

ProfileWidgetConfig

Profile widget configuration.

CategoryWidgetConfig

Category widget configuration.

WidgetConfig

Union type of all widget configurations.

WidgetState

Widget internal state.

Enums

Badge Tiers

Theme Modes

Widget Types

Usage Examples

Type Imports

Type Guards

Generic Types

Next Steps

Last updated