Skip to content

Game Catalog & Assets

The Game Aggregator module abstracts away the complexities of dealing with multiple game providers (Pragmatic Play, Evolution, NetEnt). The frontend interacts with a single, unified catalog.

Fetching Categories & Providers

To build your lobby filters or navigation menus, fetch the metadata configured by the operator back-office.

javascript
const categories = await sdk.games.getCategories();
const providers = await sdk.games.getProviders();

categories.forEach(cat => console.log(cat.name)); // e.g., "Slots", "Live Casino"

Fetching Games (Paginated & Filtered)

The getGames method supports server-side pagination, search, and filtering.

javascript
const result = await sdk.games.getGames({
  page: 1,
  limit: 20,
  categoryId: 'SLOTS',
  providerId: 'PRAGMATIC_PLAY',
  search: 'Sweet',       // Text search on game name
  isFeatured: true       // Only featured games
});

console.log(`Showing ${result.data.length} of ${result.total} games`);

Paginated Response Interface:

typescript
interface PaginatedGames {
  data: Game[];
  total: number;       // Total matching results in the database
  page: number;        // Current page
  limit: number;       // Items per page
  totalPages: number;  // Total pages available
}

Dynamic Image Assets

Games and categories return an assets object. Because providers supply images in various formats, the backend normalizes them and provides multiple shapes and sizes. You can choose whichever fits your UI design best.

typescript
interface GameAssets {
  square: ImageSet; // Always required (e.g., 200x200)
  circle?: ImageSet; // Optional (e.g., for avatar-style UI)
  wide?: ImageSet;   // Optional (e.g., for banners 400x200)
}

interface ImageSet {
  small: string;
  medium: string;
  large: string;
}

Usage Example:

javascript
const games = await sdk.games.getGames({ limit: 5 });
const thumbnailUrl = games.data[0].assets.square.medium;