Developer docs
Vote rewards and callbacks β reward your players for voting in about ten minutes.
Every vote for your game mints a one-time code tied to that player. Your server redeems the code with one verify call, which returns the reward and marks the code claimed. Trigger it automatically when someone votes (A) or when the player types their code into your game (B).
Your secret, a Send test callback button, the delivery log and embeddable badges are in your game's π Rewards panel: Your account β My games β π Rewards.
The verify call β redeems and marks claimed
This is the one call that credits a code and flips it to claimed on our side. It is idempotent: the first call for a token redeems it; any repeat returns already: true, so you never reward twice.
POST https://qllctbcarqyfaeuxuqym.supabase.co/functions/v1/vote-reward
Content-Type: application/json
{
"action": "verify",
"game_id": "<your game id>",
"secret": "<your secret>",
"token": "<player's code>"
}First call β { ok: true, player_ref, reward } (now marked claimed). Repeat β { ok: true, already: true, player_ref, reward, claimed_at } β treat that as "already redeemed" and don't grant the reward again.
A Β· Automatic β credit on vote (recommended)
Set a callback URL in your Rewards panel. The moment someone votes, we POST a signed payload to it β the player does nothing:
{ "game_id", "token", "player_ref", "reward", "ts", "signature" }
signature = HMAC_SHA256(secret, token + "." + player_ref + "." + ts)In your handler, check the signature with your secret, then make the verify call above with the token, and grant the reward only when the response is not already: true. That credits the player and marks the code claimed here, so nothing is left pending.
B Β· Manual β the player enters the code
Prefer letting players opt in? Show the voter their one-time code; when they paste it into your game, your server makes the same verify call with that token, then grants the reward. No callback URL needed.
Good to know
- Use one trigger per vote β automatic or manual β so each code is redeemed once. The idempotent
verifycall is your safety net either way. - The delivery log in your Rewards panel shows every callback attempt with its status and response time.
- Keep your secret on your server. If it leaks, regenerate it in the Rewards panel β the old one stops working immediately.