Mr. Doge
Mr. Doge SDKHooks

useTrendingMatches

Today's most-viewed matches, ranked server-side by views. One-shot, not a subscription.

Wraps matches.trending(): today's matches with views > 0, ordered by views descending.

Installation

pnpm dlx shadcn@latest add https://mrdoge.co/r/use-trending-matches.json

Also requires MRDOGE_ODDS_API_KEY. Set it in your own environment after installing.

Installing this pulls in two files: the hook itself (a thin re-export from @mrdoge/react, which does the real work) and a Next.js route at app/api/mrdoge/token/route.ts that mints short-lived tokens using @mrdoge/node and your own MRDOGE_ODDS_API_KEY. The browser client never sees the raw key.

Usage

import { useTrendingMatches } from "@/hooks/use-trending-matches"

const matches = useTrendingMatches({ sports: ["soccer"], limit: 5 })

Takes a single options object, like every real SDK method it wraps (matches.trending(params)), not positional arguments. Only resolves which matches; pair it with useLiveMatch or useMatch to actually fetch one.

Parameters

Prop

Type

Returns

Match[] | null | undefined: undefined while the request is in flight, null if it failed (no fallback data), otherwise the ranked list. One-shot: this doesn't push live updates the way useLiveMatch/useOdds do; call it again (or remount) to refresh.

On this page