Docs

Integration guide

Connect a server to Minetric: its addresses, an API key, two calls, and the welcome gift.

01 Add your server and its addresses

In your studio, under Servers, add the server with its platform and the addresses players type to reach it (playhideout.com). Turn on partner addresses for the address your partners' own are made under.

Each partner then gets their address, SLUG.YOUR-ADDRESS (saphir.playhideout.com). Point a wildcard DNS record (*.playhideout.com) at the same server as the address itself: every partner address reaches your server, with nothing to change when a partner joins.

Your server must see the address the player typed. Minecraft sends it when a player connects, and proxies such as Velocity and BungeeCord pass it on; Minetric cleans what Forge, FML or TCPShield add to it.

02 Create an API key

In your studio's settings, under API keys, create a key, limited to one server if you like. Send it on every call as Authorization: Bearer mtr_....

A key is a secret for your servers: keep it out of game clients and of anything players download.

03 Read your partners

GET /v1/partners lists the server's active partners with their addresses, store codes and welcome gifts, and your sources.

GET /v1/partners
curl https://minetric.com/v1/partners?game=hideout \
  -H "Authorization: Bearer $MINETRIC_API_KEY" \
  -H 'If-None-Match: "<the ETag of your last answer>"'

Keep the answer and ask again every 30 to 60 seconds with If-None-Match: Minetric answers 304, without a body, while nothing changed. With this list your server knows which partner sent a player as soon as they join, and can show their gift at once.

04 Send what players do

POST /v1/events takes up to 500 events at once. Send player.joined on every join, with the address typed and the player's IP (hashed on arrival, never stored), player.session when they leave, player.milestone for the steps your qualification rules ask for, and purchase and purchase.status for your store.

POST /v1/events
curl -X POST https://minetric.com/v1/events \
  -H "Authorization: Bearer $MINETRIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "game": "hideout",
    "events": [{
      "id": "join-069a79f4-1764785051",
      "type": "player.joined",
      "at": "2026-12-03T18:04:11Z",
      "player": {"id": "069a79f4-44e9-4726-a5be-fca90e38aaf5", "name": "Notch"},
      "data": {"host": "saphir.playhideout.com", "ip": "203.0.113.7", "auth": "authenticated"}
    }]
  }'

Give each event an id of your own: sending it again within 35 days does nothing, so retries are safe. Events are checked one by one: a bad one is listed in rejected, the others are kept. A queue that sends every few seconds is enough, and the SDKs come with one.

05 Give the welcome gift

When a player who came through a partner joins, claim their gift with POST /v1/claims.

POST /v1/claims
curl -X POST https://minetric.com/v1/claims \
  -H "Authorization: Bearer $MINETRIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"game": "hideout", "player": "069a79f4-44e9-4726-a5be-fca90e38aaf5"}'

Give the reward only after a 200: a 409 means it was already claimed, a 404 that there is nothing to give. If the answer is lost, read the player with GET /v1/players/ID before claiming again.

06 Import your history

Players, playtime and purchases from before Minetric go through POST /v1/import, with the same body as events. They complete your numbers: imported players and purchases book no earnings for partners, and imported players get no welcome gift.

07 Use an SDK

The TypeScript (@minetric/sdk) and Go clients make the same calls: they keep the partners list with its ETag, queue events in batches of 500 and retry with backoff.

TypeScript
import { MinetricClient } from '@minetric/sdk'

const minetric = new MinetricClient({ apiKey: process.env.MINETRIC_API_KEY!, game: 'hideout' })

const { partners } = await minetric.partners()

minetric.track({
  type: 'player.joined',
  player: { id: '069a79f4-44e9-4726-a5be-fca90e38aaf5', name: 'Notch' },
  data: { host: 'saphir.playhideout.com', ip: '203.0.113.7', auth: 'authenticated' },
})

const claim = await minetric.claim('069a79f4-44e9-4726-a5be-fca90e38aaf5')
if (claim.status === 'claimed') give(claim.reward.payload)

A claim is never retried after a lost answer, since a second claim answers already_claimed: read the player first.

Every field, error and example is in the API reference.

API reference