mwg API
    Preparing search index...

    Interface NewsItem

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

    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);
    interface NewsItem {
        body: string;
        id: string;
        publishedAt?: number;
        title: string;
    }
    Index
    body: string
    id: string
    publishedAt?: number
    title: string