MMOLove Docs
Referral Kit

All languages at a glance

A concise side-by-side of the referral flow across PHP, Node/JS, Python, .NET/C#, and cURL — pick your stack, then jump to the full SDK guide.

This is the one-screen overview: the same three calls in every supported stack, so you can see the shape of the integration before committing. Each tab is deliberately minimal — for the complete, copy-paste version with error handling, the mmref capture, and a worked example, jump to your stack's full guide:

The flow is always the same three steps against POST /api/referral/events:

  1. Capture the mmref token at registration.
  2. Report registered to mint the anchor (first-touch).
  3. Report qualified at your milestone — then grant the reward in-game.

Every snippet builds the JSON body once, signs it with HMAC-SHA256 over "<t>.<rawBody>", and POSTs it with the X-MMOLove-Signature: t=<t>,v1=sha256=<hex> header.

Sign the exact body string you send — don't re-encode it after signing. That's the #1 integration bug.

The signing core, side by side

This is the bit every stack must get right: HMAC-SHA256 over "<t>.<rawBody>", lower-case hex, in the X-MMOLove-Signature header.

$t   = time();
$mac = hash_hmac('sha256', $t . '.' . $raw, $secret);
$sig = "t={$t},v1=sha256={$mac}";   // X-MMOLove-Signature

Reporting an event, side by side

The registered call (the qualified call is identical bar the event name and a new server_event_id):

mmolove_send_event($SECRET, $SERVER_ID, 'registered', [
    'token'            => $mmref,
    'referee_identity' => $playerId,
    'server_event_id'  => 'reg-' . $playerId,
]);

Then go deep

Ready to wire it for real? Each guide is a complete, copy-paste integration:

Your signing secret is server-side only — never ship it to the browser or a game client. Sign on your backend.

On this page