Mr. Doge
Mr. Doge SDKHooks

useMatch

One-shot fetch of a single match, no live updates, unlike useLiveMatch.

Wraps matches.get(). Fetches once and never updates after that: call again or remount to refresh. Use this instead of useLiveMatch when live score/status changes would be unwanted noise.

Installation

pnpm dlx shadcn@latest add https://mrdoge.co/r/use-match.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 { useMatch } from "@/hooks/use-match"

const match = useMatch({ matchId })

Takes a single options object, like every real SDK method it wraps (matches.get(params)), not positional arguments.

Parameters

Prop

Type

Returns

MatchDetail | null | undefined: undefined while loading (or while matchId is undefined), null if the fetch failed (no fallback data; an honest empty state beats a fake one), otherwise the match as of the initial fetch. Never updates after that: call again / remount to refresh. Feed it into matchToMatchCardProps for component props.

On this page