Mr. Doge

Installation

Pick the package that fits your runtime — server, browser, or edge.

The Mr. Doge SDK ships as four packages. Pick one — they all expose the same resource surface; the difference is how you authenticate and what runtime they target.

Which package?

@mrdoge/node

Use on your backend. Authenticates with sk_live_/sk_test_ API keys. Both HTTP and WebSocket.

@mrdoge/client

Use in browsers, React Native, or any client where you must NOT embed an API key. Auth via short-lived JWTs.

@mrdoge/http

Use in serverless / edge runtimes (Lambda, Cloudflare Workers, Vercel Edge). Pure fetch, zero deps.

@mrdoge/protocol

Schemas and TypeScript types only. Useful for codegen, validation, or building tools on top of the protocol.

Install

npm i @mrdoge/node
pnpm add @mrdoge/node
yarn add @mrdoge/node
bun add @mrdoge/node
npm i @mrdoge/client
pnpm add @mrdoge/client
yarn add @mrdoge/client
bun add @mrdoge/client
npm i @mrdoge/http
pnpm add @mrdoge/http
yarn add @mrdoge/http
bun add @mrdoge/http

Create a client

import { MrDoge } from "@mrdoge/node";

const mrdoge = new MrDoge({
  apiKey: process.env.MRDOGE_API_KEY!,
});

const { data: matches } = await mrdoge.matches.list({
  sports: ["soccer"],
  limit: 10,
});
import { MrDoge } from "@mrdoge/client";

const mrdoge = new MrDoge({
  // your backend route that mints short-lived JWTs
  authEndpoint: "/api/mrdoge/token",
});

const sub = await mrdoge.matches.subscribeLive({ sports: ["soccer"] });
sub.on("match.upd", (match) => render(match));
import { createHttpClient } from "@mrdoge/http";

const mrdoge = createHttpClient({
  apiKey: process.env.MRDOGE_API_KEY!,
});

const { data: picks } = await mrdoge.call("ai.picks.list", {
  date: "2026-05-18",
  limit: 20,
});

Get an API key

Head to your dashboard to mint an sk_live_… key. You'll get one for testing (sk_test_…) and one for production. Both share the same tier and rate limit.

Never ship sk_live_… keys in client-side code. For browser or React Native apps, the flow is two packages:

  • Your backend installs @mrdoge/node and exposes a token-mint route that calls mrdoge.tokens.create(). This route is the only place your sk_live_… key ever lives.
  • Your frontend installs @mrdoge/client and points it at that route. The SDK fetches a short-lived JWT, refreshes it before expiry, and never sees the API key.

Full walkthrough in authentication.

Constructor options

Both @mrdoge/node and @mrdoge/client accept a few common options:

OptionTypeNotes
baseUrlstringServer URL override. Default wss://api.mrdoge.co/sdk/v1.
localestringDefault locale, e.g. "en", "pt-BR", "es".
timezonestringDefault timezone (IANA), e.g. "America/Sao_Paulo".
requestTimeoutMsnumberPer-call timeout. Default 10000.
maxReconnectAttemptsnumberReconnect cap. Default Infinity.

Node-specific:

OptionTypeNotes
apiKeystringRequired. sk_live_… or sk_test_….
compressionbooleanpermessage-deflate on WS. Default true.

Client-specific:

OptionTypeNotes
authEndpointstringURL to POST for tokens. Required (or fetchToken).
fetchToken() => Promise<{token, expiresAt}>Custom token fetcher.
authHeadersRecord<string,string>Extra headers on the auth POST.
refreshLeewaySecnumberSeconds before expiry to refresh. Default 30.

Next

On this page

Installation