Skip to content
topgg-api-types

topgg-api-types

TypeScript types and zod/mini runtime validators for the Top.gg API, plus optional REST, OAuth, and webhook clients.

One package, every layer

Use as much or as little as you need — types alone, or the full client.

TypeScript types

Full type coverage for Top.gg's v1 API and the legacy v0 API, kept in sync with the real response shapes.

zod/mini validators

A matching validator for every type, for parsing API responses and verifying incoming webhook payloads at runtime.

REST client

A thin, dependency-free wrapper over native fetch — projects, votes, metrics, and pagination handled for you.

OAuth 2.1 client

Authorization URL building, code/PKCE exchange, token refresh, and revocation for user-facing integrations.

Webhook verification

HMAC signature verification for vote and integration webhooks, built on Web Crypto so it runs anywhere.

v0 and v1, side by side

The deprecated legacy API stays fully typed and supported alongside the current one — no need to drop it to upgrade.

Start building

Install the package and pick the subpath you need — types, validators, or a client.