PlaygentDocs

Players and resultsResults

Results

When a player finishes a puzzle, the game records a result: won or not, how long it took and how many hints it needed. Results fill your leaderboards, and with a webhook they reach your own server, so you can reward readers.

What a result holds

WonWhether the player solved it. Showing the solution counts as not won.
TimeHow long the puzzle took, with any hint time added.
HintsHow many hints the player used.
Game numbersWhat the game itself counts, such as guesses, moves or score.
RankThe player's place on the board, and how many ranked.

When results are made

  • On Daily and Pinned games, when a player finishes: won, lost or with the solution shown. Random games make no results.
  • Only on the published game, on your sites and share links. Previews in Studio never make results.
  • Only the first finished try at each puzzle counts, per player and level. Replays get the first result back.
  • On a Daily game, only today's puzzle counts. Puzzles opened from past days don't.

Guests and signed-in readers

Guests are players your site doesn't know. Each device gets its own made-up name. Their results rank on the board, and their first try counts per device.

Signed-in readers are players your site tells the game about. If your site has accounts, you can pass in who is playing. Then:

  • The board shows the reader's own name.
  • Their first try counts on every device.
  • Their saves and streaks follow them.
  • Their results can be sent to your server with the results webhook.

Signed-in readers

Add one line before the embed script, then tell the game who is playing:

HTML
<script>window.Playgent=window.Playgent||{q:[]};"identify logout on off".split(" ").forEach(function(m){Playgent[m]=Playgent[m]||function(){Playgent.q.push([m,arguments])}})</script>
<script>Playgent.identify({ id: 'u_8f3a2c', name: 'Dana K.', sig: 'SIGNATURE' });</script>
<script async src="https://play.playgent.com/embed/v1.js"></script>
FieldRules
idRequired. Your own id for the reader: 1 to 128 plain characters. Never an email address or phone number.
nameOptional. Shown on public leaderboards, up to 40 characters. Use a display name like "Dana K.", not a full name.
sigOptional. Proves the id came from your server. Without it, results arrive marked as not verified.

When the reader signs out, call Playgent.logout(). The same code is in Studio, in the game's Embed dialog under Advanced › Signed-in readers.

Make the signature

Your server signs the reader's id with your signing secret. Find the secret in SettingsEmbedSigning secret and keep it on your server only.

JavaScript
import { createHmac } from 'node:crypto'

const sig = createHmac('sha256', process.env.PLAYGENT_SIGNING_SECRET).update(user.id).digest('hex')
  • Use the whole secret as the key, including its pgs_ start.
  • Sign exactly the text you pass as id. For a number, sign it as text.
  • Don't put a signed page in a shared cache, where other readers could get it.

Check your signatures with the signature checker.

Rotate the signing secret

Press Rotate secret in SettingsEmbedSigning secret. Signatures made with the old secret keep working for 7 days, so you have time to update your server. Press Stop the old secret now to end that early.

Leaderboard data

Each live leaderboard is also a public file with its top 10, so you can show it your own way. Find its address in the game's Embed dialog under Advanced › Leaderboard data. It looks like this:

Text
https://p.playgent.com/lb/pg_7hk2qp0azx/d20261024/-.json
  • For Daily games, the middle part is d and the date. Use the reader's local date.
  • The last part is the level, or - for games without levels.
  • The file updates every minute or two. Read it at most once a minute.
JSON
{
  "v": 1,
  "gameId": "pg_7hk2qp0azx",
  "game": "worday",
  "puzzle": "d20261024",
  "day": "20261024",
  "level": "-",
  "open": true,
  "verified": false,
  "total": 1204,
  "updated": "2026-10-24T13:05:12Z",
  "top": [
    { "rank": 1, "i": 17, "name": "Rustic Raven 62", "verified": false, "won": true, "ms": 61234, "hints": 0, "stats": { "guesses": 3 } }
  ]
}

total is how many ranked. open turns false once the board stops taking results. The file holds names but never reader ids. A 404 means no results yet.

Send results to your server

With the results webhook, each signed-in reader's first result for a puzzle arrives on your server as it happens, signed so you know it came from Playgent. See Webhooks.

Remove a reader's results

Go to SettingsEmbedDelete a reader’s results, enter the Reader id and press Delete results. Their rows leave every leaderboard within an hour. Guests' results can't be looked up this way: they are removed after 90 days.