@web-engine-dev/discovery
Game discovery and marketplace for web-engine-dev.
Features
- Game Catalog: Browse and search games
- Categories: Genre and tag filtering
- Featured Games: Curated selections
- Recommendations: Personalized suggestions
- Search: Full-text game search
- Trending: Popular games tracking
Installation
bash
npm install @web-engine-dev/discovery
# or
pnpm add @web-engine-dev/discoveryQuick Start
typescript
import { DiscoveryService } from '@web-engine-dev/discovery';
const discovery = new DiscoveryService({
apiUrl: 'https://api.platform.com',
});
// Search games
const results = await discovery.search('platformer', {
categories: ['action'],
tags: ['multiplayer'],
sortBy: 'popularity',
});
// Get featured games
const featured = await discovery.getFeatured();
// Get recommendations
const recommended = await discovery.getRecommendations(userId);API Overview
Search
typescript
const results = await discovery.search(query, {
categories: ['action', 'puzzle'],
tags: ['multiplayer', 'coop'],
minRating: 4.0,
sortBy: 'popularity', // 'relevance', 'newest', 'rating'
page: 1,
limit: 20,
});
for (const game of results.items) {
console.log(game.title);
console.log(game.description);
console.log(game.thumbnail);
console.log(game.rating);
}Categories
typescript
// Get all categories
const categories = await discovery.getCategories();
// Get games by category
const actionGames = await discovery.getByCategory('action');Featured
typescript
// Get featured games
const featured = await discovery.getFeatured();
// Get trending games
const trending = await discovery.getTrending({
period: 'week',
limit: 10,
});
// Get new releases
const newGames = await discovery.getNewReleases();Recommendations
typescript
// Personalized recommendations
const recommended = await discovery.getRecommendations(userId);
// Similar games
const similar = await discovery.getSimilar(gameId);
// Because you played...
const becauseYouPlayed = await discovery.getRelated(gameId);Game Details
typescript
const game = await discovery.getGame(gameId);
console.log(game.title);
console.log(game.description);
console.log(game.screenshots);
console.log(game.videos);
console.log(game.reviews);
console.log(game.rating);
console.log(game.playCount);