Fetches a game's own news/announcements feed - the inbound counterpart to FeedbackClient, built on the shared HttpTransport like every other client here (a game's own HTTPS endpoint, no backend shipped or assumed).
FeedbackClient
HttpTransport
import { NewsClient, NewsSeenTracker } from '@datamoc/mw_games/core';const news = new NewsClient({ endpoint: 'https://example.com/api/news' });const seen = new NewsSeenTracker({ namespace: 'my-game' });const items = await news.fetchItems();const unread = items.filter((item) => !seen.isSeen(item.id));for (const item of unread) seen.markSeen(item.id); Copy
import { NewsClient, NewsSeenTracker } from '@datamoc/mw_games/core';const news = new NewsClient({ endpoint: 'https://example.com/api/news' });const seen = new NewsSeenTracker({ namespace: 'my-game' });const items = await news.fetchItems();const unread = items.filter((item) => !seen.isSeen(item.id));for (const item of unread) seen.markSeen(item.id);
Optional
Fetches a game's own news/announcements feed - the inbound counterpart to
FeedbackClient, built on the sharedHttpTransportlike every other client here (a game's own HTTPS endpoint, no backend shipped or assumed).Example