Skip to main content
There are two supported ways to call the API from TypeScript. Use the official SDK if you want a polished client; generate types if you’d rather keep your own HTTP code.
The package is ESM-only, Node 22+, server-to-server. It uses got under the hood, ships zero runtime deps beyond that, and exposes:
  • sdk.account, sdk.users, sdk.trades — merchant-only
  • sdk.profile, sdk.tradeUrls, sdk.wallet, sdk.deposits, sdk.market — actor-context
  • sdk.as(ref) — async, validates the ref and returns a sub-user-bound view
  • sdk.health(), sdk.newIdempotencyKey(), sdk.request<T>(...) — utilities
  • verifyWebhook(rawBody, headers, { secret }) — signature verification (zero deps beyond node:crypto)
  • meta(response) — read requestId, status, headers, rateLimit from any successful response

Type-only imports

For UI/server code that just needs the wire types without the runtime client, import from the /types subpath:

Errors

A single SkinsharkError class is thrown for every failure. Branch on the discriminated key:
See Error handling for retry strategy and the full key catalogue at reference/errors.

Option 2 — generate types from the OpenAPI spec

If you’d rather not pull in the SDK runtime — for example, you’re calling from a non-Node runtime or already have an HTTP client you’re happy with — generate a paths type from the spec and pair it with a tiny fetch wrapper.

A typed fetch helper

Zero runtime dependencies, types drift automatically as the spec evolves, and the wrapper is ~30 lines. Pin the spec to a git tag (or a vendored copy) for stable types between releases.

Webhook signature verification

The SDK ships a verifyWebhook(rawBody, headers, { secret }) helper that follows Standard Webhooks — see the Webhooks guide for the full shape and example handlers. If you’re not using the SDK, the verification is ~30 lines of node:crypto — copy from the same guide, or use any Standard Webhooks library from npm.