The first-party progression plugin (plugins/progression, providerType: progression, plugin API 1.3) adds levels and XP, achievements and missions to Poker Engine. Players earn XP for every hand and tournament finish, unlock achievements, complete daily, weekly and one-time missions for chips, tickets or bonuses, and compete on a weekly and an all-time XP leaderboard.
It’s sold separately as progression-<version>.tgz; Poker Engine releases don’t include it. Install it with Upload plugin on Extensions › Plugins, which shows the consent dialog (see Installing the First-Party Plugins). The admin side is described in Progression (admin).
For operators
What players see
| Where | What |
|---|---|
Header (layout.main.header.end) | A level chip (Lv 3 · 1,240 XP), live over the socket, that opens the profile’s Progression tab; on phones (below 640px) it sits at the top of the menu drawer. Level-up, unlock and mission toasts appear on every page, the table included. |
Table seat (table.seat.badge) | Each seated player’s level. Levels are fetched in one batched request per table. |
Table rail (table.hud.panel) | The hero’s level bar, the XP of the last hand and the active missions. |
Hand result (table.hand-result.after) | +N XP for the hand just played, while the winners show. |
Profile header (profile.header.badges) | Level and up to three showcased achievements, on the player’s own profile and on every public profile /players/:username. |
Own profile, Progression tab (profile.tabs) | The full dashboard: level and XP bar, weekly XP, login streak, missions, every achievement with progress, recent history. Opens with /profile?tab=plugin:progression. |
Public profile /players/:username, Progression tab | Read-only: the player’s level and XP bar, how many achievements they unlocked, and the unlocked achievements. No missions, history, streak or rewards. Anyone can open it, signed out too. |
Leaderboard, XP tab (leaderboard.tabs) | This week and all time. Opens with /leaderboard?tab=plugin:xp. |
Lobby (lobby.sidebar) | Today’s missions, with an All progress link to the profile tab. |
/ext/progression/progression | The old dashboard page. Since plugin API 1.3 it redirects to /profile?tab=plugin:progression (links in notifications already sent keep working), and the plugin adds no entry to the player navigation. |
| Notifications | An in-app message for each level-up, unlock and completed mission, linking to the profile tab. Push too for level-ups and unlocks when Push notifications is on. Players switch each kind per channel in Settings → Notifications (see below). |
Notification categories
The plugin registers three categories (plugin API 1.3), listed under Progression in the player’s Settings → Notifications grid. All are on by default; none is marketing.
| Category | Label | Channels | Sent |
|---|---|---|---|
level-up | Level-ups | In-app, push | When the player reaches a new level |
achievements | Achievements | In-app, push | When the player unlocks an achievement |
missions | Missions | In-app | When the player completes a mission |
Push is only sent while Push notifications (pushOnUnlock) is on; a player who switched a category off for a channel gets nothing on that channel, and the toasts on screen are unaffected.
Admin overview
Progression overview (/admin/plugins/progression/progression/overview) is listed under Players in the admin sidebar: it finds a player, shows their level and badges, grants XP and recomputes their progress, next to the other per-player tools. It also shows totals, the all-time top players, the catalog state and the scheduled jobs.
Settings
Every setting is optional; an empty value uses the default.
| Setting | Default | Meaning |
|---|---|---|
xpPerHand | 10 | XP for each hand played. |
xpPerHandWon | 0 | Extra XP for each hand in which the player wins a pot (1.1.0). |
xpPerBigBlindWon | 1 | Extra XP per big blind of net winnings in a hand, capped at 500 XP per hand. |
xpShowdownWinBonus | empty | Extra XP for winning at showdown. Empty uses xpPerHand (the behaviour before 1.1.0); 0 turns it off. |
xpTournamentFinishBase | 100 | Tournament finish XP is base x (1 + (field - position) / field): the runner-up of two gets 100, the winner 150; the winner of ten gets 190. |
xpDailyLogin | 20 | XP for the first login of a UTC day, plus 5 per streak day up to a week. 0 turns it off (1.1.0). |
levelCurve | quadratic | quadratic: level n needs 100 x (n-1)^2 XP (level 2 at 100, level 5 at 1,600, level 10 at 8,100). linear: 250 XP per level. arithmetic (shown as "Growing", 1.1.0): going from level L to L+1 needs levelCurveBase + levelCurveStep x L XP. |
levelCurveBase, levelCurveStep | 100, 60 | The growing curve’s numbers: with the defaults level 2 needs 160 XP, level 3 another 220 (380 in total). |
levelCount | 50 | Highest level (2 to 1000). XP keeps counting past it. |
levelUpChipsPerLevel | 0 | Virtual chips paid on reaching a level: this amount times the new level (20,000 pays 40,000 at level 2 and 60,000 at level 3). 0 turns it off. Paid on top of levelRewards, with its own idempotency key level-chips:<level>:<userId> (1.1.0). |
missionClaimMode | auto | auto pays a mission when it completes. claim waits until the player presses Claim (the plugin’s mission lists show the button; themes call POST /missions/:id/claim). An unclaimed mission expires when its period resets (1.1.0). |
stakeLevels | empty | Level-locked stakes (1.1.0): [{ smallBlind, bigBlind, level, modes? }]. A player below level cannot join a cash table with those blinds: the plugin refuses the join through the player:eligibility filter (plugin API 1.4, capability player:eligibility) with reason LEVEL_REQUIRED and details.requiredLevel. modes defaults to play-chip tables (VIRTUAL_CHIPS); add REAL_MONEY to lock real-money tables too. Tournaments and private tables are never locked. GET /me lists the locks for themes. An invalid value locks nothing and turns the health check unhealthy. |
tournamentLevels | empty | Level-locked tournaments (1.1.0): [{ minBuyIn, level, currencies? }]. Registering for a tournament whose buy-in is at least minBuyIn needs level (the highest matching entry wins); refused with LEVEL_REQUIRED like the stakes. currencies defaults to play-chip tournaments (VIRTUAL_CHIPS); a freeroll is locked only by an entry with minBuyIn: 0. Sit & Gos (Jackpot Spin games included) count as tournaments. GET /me lists it. An invalid value locks nothing and turns the health check unhealthy. |
achievementsCatalog | built-in | JSON array of achievements. Empty means the built-in catalog. |
missionsCatalog | built-in | JSON array of missions. |
levelRewards | built-in | JSON array of { level, reward }. |
rewardsRealMoneyEnabled | off | Allows rewards of type real and bonuses of type USD. While off they are recorded as skipped. The plugin’s daily real-money cap (Wallet daily caps in its details on Extensions › Plugins) still applies, and it is 0 until an admin raises it. |
leaderboardResetCron | 0 0 * * 1 | When the weekly leaderboard is snapshotted and restarted (cron, UTC). Takes effect when saved. |
announceUnlocksInTableChat | off | Shows other players at the table when someone unlocks an achievement (in the table rail and as a toast). |
pushOnUnlock | off | Also sends a push notification for level-ups and unlocks. |
The engine checks the three catalog settings against the JSON schema in the manifest when you save them. The plugin then validates them more strictly (known metrics, unique ids). If a catalog is invalid the built-in one is used, the health check turns unhealthy and the admin overview shows the error.
Daily XP, achievement progress and mission progress persist in plugin storage. Deleting the plugin deletes them.
XP sources
| Event (hook) | XP |
|---|---|
Hand completed (game:hand:completed) | xpPerHand, plus big blinds won, plus the showdown-win bonus. |
Tournament finish (tournament:player:eliminated, tournament:finished) | Position based (see above). An elimination is credited at once; the final standings top it up, so nothing is paid twice. |
First login of the UTC day (auth:user:login) | 20, plus 5 per consecutive day up to 7 days (50). |
| Unlocking an achievement | The achievement’s xp. |
| Completing (auto) or claiming (claim mode) a mission | The mission’s xp (1.1.0). |
| Another plugin’s event named in a catalog | None; it counts for conditions (see "Other plugins’ events"). |
| Admin grant | Any amount (admin overview). |
Built-in achievements
| Id | Title | Condition |
|---|---|---|
first-hand | First hand | Play 1 hand |
hands-100 / hands-1000 / hands-10000 | Regular / Grinder / Iron butt | Play 100 / 1,000 / 10,000 hands |
daily-grinder | Daily grinder | Play 50 hands in one UTC day (repeatable) |
first-win | First win | Win a pot |
wins-100 | Pot collector | Win 100 pots |
big-pot / monster-pot | Big pot / Monster pot | Win a pot of 100 / 500 big blinds |
straight-winner, flush-winner, full-house-winner, quads-winner, straight-flush-winner, royal-flush | Win with that hand (from the winner’s handRank). royal-flush is hidden until unlocked. | |
showdown-streak-5 | Hot streak | Win 5 showdowns in a row |
showdown-wins-50 | Showdown specialist | Win 50 showdowns |
variety-3 | Variety player | Play 3 game types |
bluff | Bluff master | Bet or raise on the river and win without a showdown |
all-in-survivor | All-in survivor | Go all in and still have chips after the hand |
first-tournament / tournaments-25 | First tournament / Tournament regular | Finish 1 / 25 tournaments |
final-table | Final table | Finish 9th or better |
in-the-money | In the money | Finish with a prize |
tournament-win | Champion | Win a tournament (1 ticket) |
login-streak-7 / login-streak-30 | Week streak / Month streak | Log in on 7 / 30 consecutive days |
first-deposit | First deposit | First confirmed deposit |
level-5 / level-10 / level-25 | Rising star / Seasoned / Veteran | Reach that level |
Built-in missions and level rewards
| Id | Period | Goal | Reward |
|---|---|---|---|
daily-play-1 | daily | Play 1 hand | 100 virtual chips |
daily-win-3 | daily | Win 3 pots | 250 virtual chips |
daily-hands-25 | daily | Play 25 hands | 500 virtual chips |
weekly-tournament | weekly | Finish a tournament | 1 ticket |
weekly-hands-200 | weekly | Play 200 hands | 1,000 virtual bonus |
welcome-tournament | once | Finish your first tournament | 200 virtual chips |
deposit-match | once | First deposit | 100% USD bonus up to 50, 10x wagering, 30 days (needs rewardsRealMoneyEnabled) |
Level rewards: level 5, 500 virtual chips; level 10, 1 ticket; level 20, 2,500 virtual chips; level 25, a 5,000 virtual bonus; level 50, 5 tickets.
Daily missions reset at 00:00 UTC, weekly missions on Monday 00:00 UTC (ISO weeks).
Presets
plugins/progression/presets/social-casino.json (shipped in the plugin archive) is a complete set of settings for a social-casino economy: 5 XP per hand dealt and 10 more per pot won, no big-blind, showdown or login XP, the growing curve 100 + 60 x level up to level 100, 20,000 chips times the new level on every level-up (no level rewards list), level-locked play-chip stakes (500/1,000 from level 2 up to 50,000/100,000 from level 25), claimable daily missions (Win 3 hands: 30,000 chips and 60 XP; See 10 flops: 20,000 chips and 40 XP; Play 1 Jackpot Spin: 40,000 chips and 80 XP) and eight trophies (First pot, 10 pots won, Flush, Four of a kind, Jackpot win, 10x Spin, Sit & Go win, 7-day streak). The Jackpot Spin mission and trophies count the events plugin:jackpot-spin:played and plugin:jackpot-spin:won (value: the multiplier), so they need a Jackpot Spin plugin that fires them; "Sit & Go win" counts any tournament win and "7-day streak" the login streak.
To apply it, copy each value under settings into the plugin’s settings (Extensions › Plugins, Settings on the Progression row) (JSON values into the JSON fields), or send the object to the settings API with every value as a string:
jq '{settings: (.settings | map_values(if type == "string" then . else tojson end))}' \
plugins/progression/presets/social-casino.json > /tmp/progression-settings.json
# PUT /api/v1/admin/plugins/progression/settings with that body (super-admin session and CSRF token)
Saving merges: settings the preset does not name keep their values.
For developers
Catalog format
{
"id": "big-pot",
"title": "Big pot",
"description": "Win a pot worth 100 big blinds or more.",
"icon": "💎",
"category": "wins",
"condition": { "type": "threshold", "metric": "biggest_pot_bb", "target": 100 },
"xp": 100,
"reward": { "type": "virtual", "amount": 500 },
"hidden": false,
"repeatable": false,
"showcase": true
}
Ids are ^[a-z0-9][a-z0-9_-]{0,39}$. Missions take period: daily | weekly | once, a required reward and (1.1.0) an optional xp granted with it; they have no window.
Condition type | Compares | Metrics |
|---|---|---|
counter | An all-time counter, or with `window: daily | weekly` the count in the current UTC day or ISO week |
threshold | The highest value seen | biggest_pot_bb, game_types, level, total_xp, or another plugin’s event plugin:<providerType>:<event> (its highest value, 1.1.0) |
streak | The best consecutive run (missions use the current one) | login_streak, showdown_win_streak, win_streak |
event | How often a named event happened | deposit:first, deposit, login, tournament:win, level-up, or another plugin’s event plugin:<providerType>:<event> (1.1.0) |
Rewards: { type: 'virtual' | 'real' | 'tickets' | 'bonus', amount, bonusType?: 'VIRTUAL' | 'USD' | 'TICKETS', wageringMultiplier?, wageringDeadlineDays?, matchPercent?, maxAmount? }. With matchPercent the plugin pays that percentage of the triggering amount (the deposit), capped at maxAmount (else amount). Wagering applies to USD bonuses only (until it is met the player cannot withdraw); on VIRTUAL and TICKETS bonuses wageringMultiplier has no effect and is ignored (the server logs a warning), so leave it out there. The deadline in days is recorded with the bonus but does not end the requirement: when it passes, the bonus is not taken back and the player still needs to finish the wagering before withdrawing.
Every reward goes through registry.wallet or registry.bonus with an idempotency key: achievement:<id>:<userId> (plus :<n> for repeats), mission:<id>:<periodKey>:<userId> (period key 2026-11-07, 2026-w45 or once), level:<n>:<userId>, level-chips:<n>:<userId> (levelUpChipsPerLevel). A retry never pays twice. A failed payment is recorded on the achievement or mission and retried by the admin Recompute action.
Hooks and capabilities
The manifest declares storage, wallet:credit-virtual, wallet:credit-real, wallet:credit-tickets, bonus, realtime, scheduler, notify:in-app, notify:push, hooks:player-actions, users:read (leaderboard names) and (1.1.0) player:eligibility (level-locked stakes; installs upgrading from 1.0.0 grant it in the consent dialog, and without it nothing is locked), plus hooks.optIn: ['game:player:action']. Player actions only feed the bluff and all-in flags. Without them, all-in is derived from contributed >= startingStack and bluffs are not counted.
Listened to: game:hand:completed, game:player:action, tournament:player:eliminated, tournament:finished, auth:user:login, cashier:deposit:confirmed, plugin:settings:saved, server:routes:admin, and every plugin:<providerType>:<event> a catalog condition names.
Fired for other plugins (1.1.0): plugin:progression:level-up with { userId, from, level, totalXp } after every level-up (the social plugin’s invite reward listens to it).
Other plugins’ events
A condition can name another plugin’s event as its metric: plugin:<providerType>:<event> (not plugin:progression:*). The plugin subscribes to every such hook when it starts and when its settings are saved. The other plugin fires it with registry.doAction('plugin:<providerType>:<event>', { userId, value? }); only that plugin can fire its own namespace. An event condition counts how often it fired for the player (within the mission’s period for missions); a threshold condition compares the highest value it carried, such as a multiplier:
{ "type": "event", "metric": "plugin:jackpot-spin:played", "target": 1 }
{ "type": "threshold", "metric": "plugin:jackpot-spin:won", "target": 10 }
Payloads without a valid userId are ignored; value must be a finite number.
Flops seen and VPIP
From the opt-in game:player:action hook (1.1.0): flops_seen counts a hand in which the player did not fold preflop and the flop was dealt (someone acted after it, or the hand ran out to a showdown the player was in); vpip_hands counts a hand in which the player called, bet, raised or went all in preflop. Only board games count flops. Both are counter metrics for catalogs and appear in GET /me stats. They start counting when the plugin is installed.
Claiming missions
With missionClaimMode: claim, a completed mission’s reward waits for POST /missions/:id/claim in its period. The claim takes a first-writer marker (mclaim:<id>:<periodKey>, one atomic merge), so two tabs, a double click or two nodes claim once and grant the mission’s XP once; the payment carries the mission’s idempotency key mission:<id>:<periodKey>:<userId>, so a retry after a refused payment (a daily cap: 502 REWARD_FAILED, the claim stays open) moves the chips at most once. Errors: 409 CLAIM_DISABLED (auto mode), 404 NOT_FOUND, 409 NOT_COMPLETED, 409 ALREADY_CLAIMED.
Storage layout
Per player (storage.user(userId)): xp ({ total, level, streak, name?, updatedAt }, the all-time leaderboard row), xp-weekly ({ season, xp, level, name? }), metrics, periods, achievements, missions (with claimedAt in claim mode), level-rewards, level-chips, mclaim:<missionId>:<periodKey>, game-types, tournaments, history (last 30 entries).
Global (storage.global): leaderboard:season, leaderboard:snapshot:<n> (top 100 of season n), leaderboard:last-snapshot, missions:rollover, stats.
Achievement and mission entries are written with merge (only the changed entries). A per-player lock serialises the read-modify-write of one player on a node. A player’s hands and logins are handled by the node they are connected to, so concurrent writes for one player from two nodes are not expected. The global stats counters are best effort under multi-node load.
Display names: hook payloads carry user ids only. The leaderboard looks up every row’s current username with users:read when it is read, so players who earned XP from an admin grant or never opened the web client still show by name and link to /players/<username>. The plugin also records a player’s username when their client loads GET /me; that stored name is only used when users:read has not been granted (Player <id> when there is none).
Scheduled jobs
| Job | Schedule | Does |
|---|---|---|
missions:rollover | 0 0 * * * UTC | Clears last period’s daily and weekly mission entries and records the run (missions:rollover). Reads are period-keyed, so missions are correct without it. |
leaderboard:weekly-reset | leaderboardResetCron | Saves the top 100 of the current weekly season to leaderboard:snapshot:<n> and starts season n+1. Weekly XP is keyed by season, so no per-player writes are needed. |
Both run once per cluster through the scheduler’s database lease.
Realtime events
To the player (realtime.toUser): xp { total, level, gained, reason, tableId?, handNumber?, info }, level-up { from, level }, achievement-unlocked { id, title, icon, times }, mission-completed { id, title, reward }, mission-claimed { id, periodKey } (claim mode). To the table (realtime.toTable): seat-level { userId, level } after a level-up during a hand, and announcement when announceUnlocksInTableChat is on. The core has no plugin API for table chat, so the announcement is shown by the plugin’s own table rail and toast, not in the chat log.
HTTP API
Player routes, under /api/v1/plugins/progression:
| Route | Access | Returns |
|---|---|---|
GET /me | signed in | Level info, weekly XP, streak, every achievement with progress, missions with progress, resetsAt, xp, claimable and claimedAt, history, stats (handsPlayed, handsWon, flopsSeen, vpipHands, showdowns, showdownWins, tournamentWins, biggestPotBb), stakeLevels, tournamentLevels and missionClaimMode. Themes read this one route for the level chip, missions and trophies |
POST /missions/:id/claim | signed in | Claim mode: pays a completed mission of the current period once; { missionId, periodKey, reward, rewardStatus, xp, xpInfo } |
GET /leaderboard?period=weekly|alltime | public | { period, season, rows: [{ rank, userId, name, level, xp }] } (top 50) |
GET /users/summaries?ids=a,b,c | public | { [userId]: { level, total } }, at most 50 ids (seat badges) |
GET /users/:id/summary | public | { level, total, badges, showcase } |
GET /users/:id/public | public | Public progression for the public profile tab: { userId, xp, achievementCount, unlockedCount, showcase, achievements }, where achievements lists unlocked achievements only (id, title, description, icon, unlockedAt, times). Never missions, history, streaks, weekly XP, rewards or locked progress. |
GET /catalog | public | Achievements (hidden ones masked), missions, level thresholds and levelUpChipsPerLevel |
Admin routes, on the engine’s admin router (authenticate + requireAdmin + CSRF), under /api/v1/admin:
| Route | Body | Does |
|---|---|---|
GET /progression/stats | Player count, top 10, totals, unlocks per achievement, catalog state, jobs, last rollover, current season | |
POST /progression/users/:id/grant-xp | { amount: 1..1000000, reason? } | Adds XP with every side effect (level-up, rewards, notifications) |
POST /progression/recompute/:userId | Re-evaluates the player against the current catalog and retries failed rewards |
Client
src/client/plugin.tsx registers the fills (the profile tab with audience: 'everyone': the full dashboard when isOwnProfile, the public view otherwise), the admin page (nav.section: 'users') and the redirect engine.pages.redirect({ providerType: 'progression', from: '/progression', to: '/profile?tab=plugin:progression' }), also declared in the manifest redirects so it works before the bundle loads; store.ts holds /me, the per-table hand XP and cached seat levels, and listens on engine.socket.for('progression'). Strings go through engine.i18n.for('progression').t with src/locales/en.json (shipped as dist/locales/en.json).
Test ids for end-to-end tests: progression-level-chip (data-level, data-xp), progression-seat-badge (data-user-id, data-level), progression-hand-xp (data-xp), progression-hud, progression-hud-last-hand, progression-hud-mission-<id>, progression-achievement-<id> (data-unlocked), progression-mission-<id> (data-completed), progression-lobby-missions, progression-lobby-mission-<id>, progression-leaderboard, progression-leaderboard-row (data-user-id), progression-tab (data-own), progression-public (data-user-id), progression-public-summary (data-level, data-xp), progression-public-achievement-<id>, progression-summary, progression-history, progression-profile-badges, progression-showcase-<id>, progression-announcement, progression-admin-overview, progression-admin-totals, progression-admin-catalog (data-valid), progression-admin-search, progression-admin-search-submit, progression-admin-player-row (data-user-id, data-level), progression-admin-grant-amount, progression-admin-grant-submit.
Building and testing
npm run plugin:build progression # sync catalog defaults into the manifest, type-check, bundle
npm run plugin:test progression # vitest: engines, routes, client components
npm run plugin:validate progression
dist/ is committed so auto-discovery works without a build step. sync-manifest.mjs copies src/catalog/*.json into the manifest’s json field defaults, and a test fails if they drift.