Capabilities

Last Updated: November 2026 · Plugin API: 1.1 (transfers, users:read and presence: 1.2; game:bot-decide and notify:email-address: 1.3)

A capability is a permission a plugin needs before it can use one of the gated registry namespaces. The plugin declares the capabilities in its manifest. A super-admin grants them when they activate the plugin. If a plugin calls a gated method without the matching capability, the call throws PluginCapabilityError.

Plugins that declare no capabilities keep working unchanged. Every API 1.0 namespace (users apart from the API 1.2 users:read methods, auth, cashier, config, settings, logger, middleware, hooks and routes) is ungated, with three exceptions for hooks added in API 1.1: the opt-in hooks need hooks:player-actions, the game:rake:calculate filter needs game:rake, and the personal and balance fields of the account hooks need hooks:account-data (see Gated hooks). API 1.3 adds game:bot-decide for the game:bot:decide filter and registry.bots (see Bot decisions).

Declaring capabilities

{
  "name": "poker-engine-plugin-progression",
  "version": "1.0.0",
  "pokerEnginePlugin": {
    "providerType": "progression",
    "displayName": "Progression",
    "apiVersion": "1.1",
    "capabilities": ["storage", "wallet:credit-virtual", "bonus"]
  }
}

The capabilities are validated when the plugin is uploaded. An unknown name, or a capabilities value that is not an array, rejects the package. The declared list is stored on Plugin.capabilities, and the full pokerEnginePlugin object is stored on Plugin.manifest.

CapabilityUnlocks
storageregistry.storage (global, per-user, query). See storage.md
wallet:credit-virtualregistry.wallet.creditVirtual
wallet:credit-realregistry.wallet.creditReal (real money; see wallet.md)
wallet:credit-ticketsregistry.wallet.creditTickets
wallet:debit-virtualregistry.wallet.debitVirtual
wallet:transfer-virtualregistry.wallet.transfer with balanceType: 'virtual' (API 1.2; see wallet.md)
wallet:transfer-realregistry.wallet.transfer with balanceType: 'real' (API 1.2). High impact: blocked until an admin sets a daily real transfer cap; KYC, AML, transfer limits and fraud checks apply
any wallet:*registry.wallet.getBalance
bonusregistry.bonus.credit, registry.bonus.listForUser
realtimeregistry.realtime, and inbound plugin:emit events from the plugin’s client channel (see realtime.md)
schedulerregistry.scheduler (see scheduler.md)
notify:in-app, notify:push, notify:emailregistry.notify.inApp, .push, .email, .registerEmailTemplates (notify:email, API 1.2) and .registerCategories (any notify:* plus each listed channel’s capability, API 1.3) (see notifications.md)
notify:email-address (API 1.3)registry.notify.emailAddress: email addresses the admin typed into the plugin’s settings, not player accounts. At most 20 recipients per call, 60 emails per plugin per hour, subject prefixed with the plugin name
hooks:player-actionsThe opt-in hooks in hooks.optIn (game:player:action). Without the grant the opt-in is skipped and the plugin’s callbacks for those hooks are never called (see Opt-in hooks)
hooks:account-dataThe personal and balance fields of the account hooks: email (and, API 1.4, extra) on auth:user:registered, ip on auth:user:login, and delta, balanceBefore, balanceAfter on balance:changed (any wallet:* capability also unlocks the balance:changed figures). Without it the hooks still fire with those fields removed
game:rakeThe game:rake:calculate filter. Without the grant the plugin’s filter callback is never called. High impact: it changes the rake on real-money cash tables
game:jackpot-contributionAPI 1.4. Label a jackpot contribution in the game:rake:calculate filter (kept apart from the rake, limited by the core, booked to the fund’s ledger) and registry.jackpots (declareFund, balance, payout). High impact: it takes money from real-money pots for a fund paid back to players. See Jackpot contributions
game:random-drawAPI 1.4. registry.random.int(maxExclusive, { purpose }): one integer from the certified generator per call, recorded in the audit trail, refused while the RNG health latch is closed. High impact: a plugin can decide money outcomes with it. See Certified random draws
game:bot-decideAPI 1.3. The game:bot:decide filter and registry.bots (list, get, isBot). Without the grant the filter callback is never called and registry.bots methods throw PluginCapabilityError. High impact: it chooses bot actions at every table, real-money tables included (see Bot decisions)
bots:chatAPI 1.4. registry.bots.say (one table chat line as a seated bot, moderated and length-limited like a player’s line), registry.bots.showBotBadge, the table:chat:message action (players’ table chat lines) and the game:bot:emote filter (choose a bot’s quick reaction, API 1.4, see server hooks). Without the grant say throws PluginCapabilityError and the hook never reaches the plugin. Medium impact: it can make any bot seated on this node speak at its table, private and tournament tables included, and it receives the moderated player chat of every table on this node, private and tournament tables included (see Bot table talk)
rake:readAPI 1.4. registry.rake.paidBetween and .paidByUser: rake each player paid at real-money cash tables, from the hand records, with the account facts a promotion needs (blocked, frozen, agent, referrer, flat rakeback, active self-exclusion). Bots never appear. Medium impact: it reveals how much each player plays for real money; it cannot move money (see Rake)
hands:read-ownAPI 1.4. registry.hands.listOwnHands(userId, limit?) and .getOwnHand(userId, gameId): one player’s own finished hands, as that player may see them (the same filter as their hand replay: own cards, the board, the actions and only opponents’ cards shown at showdown). A hand they did not play in, an unknown hand and an unfinished hand all return null. For a plugin that acts for the signed-in player; never pass another player’s id
risk:providerAPI 1.4. registry.risk.registerProvider(provider) and .unregisterProvider(kind): supply one check of a kind the engine cannot make itself: location (locate(request) -> country, region, concealed), device (assess(request) -> device id, risk score 0-100, signals), identity (verify(subject, request) -> verified, refer or rejected, with a method and a date), sanctions (screen(subject) -> clear, possible or hit, with list names) or exclusion-registry (lookup(subject) -> excluded and until when), or challenge (verify(token, request) -> success and whether the token was reused). .reportIdentityResult(reference, result) reports a later result of an identity check the plugin left pending (refer with a reference); the engine applies it only for the plugin that holds the request. One provider per kind for the whole engine (a second registration of a kind is refused); it leaves with the plugin. The engine calls it with a 2-second timeout and at most two attempts, applies the profile’s fail-open or fail-closed rule and records every decision in the risk decision log (never documents or secrets). High trust: a provider decides who may register, sign in, deposit and sit down for real money. See Risk providers
users:readregistry.users.getProfiles, .findByUsername, .search, .query, .stats (API 1.2). Profiles come from a fixed allowlist: never email, IP or balances (see users.md)
presenceregistry.presence.get and the user:online / user:offline hooks (API 1.2). Without the grant the plugin’s callbacks for those hooks are never called (see presence.md)
auth:providerregistry.auth.registerProvider, .unregisterProvider, .getCallbackUrl, .verifyIdToken, .reserveOnce, .identities.* and the auth:external:profile filter (API 1.4). High trust: a provider decides who is signed in. The plugin’s server:routes:admin routes also need settings:view to read and settings:edit to write
auth:signupThe auth:register:validate filter and the extra sign-up fields (API 1.4). High trust: it can refuse any sign-up and sees the username, email and IP of every sign-up
storage (API 1.4)Also unlocks registry.secrets (encrypted values with dynamic keys; values never appear in admin APIs)
player:eligibility (API 1.4)Also the tournament:eligibility-rule filter (answer a freeroll entry rule such as vip.level; advisory, no answer means not met). The player:eligibility filter: refuse a table seat, a tournament registration, a deposit, a withdrawal or a player transfer with a reason code. Veto only; a failing callback refuses real-money actions (ELIGIBILITY_CHECK_FAILED) and is ignored for play-money ones. Not needed to keep an anonymous provider’s accounts away from real money: core does that itself (REAL_EMAIL_REQUIRED). See Server Hooks
tournament:prize-pool (API 1.4)The tournament:prize-pool filter: set the prize pool of VIRTUAL_CHIPS (play-money) tournaments. High impact: core pays the pool from nothing, so every change is written to the admin audit log and a pool above the plugin’s bound (default 1000 times the core pool, set by a super-admin) is refused. See Server Hooks
cashier:purchase (API 1.4)registry.purchases (methods, create, get, reverse) and the cashier:purchase:confirmed / :failed / :reversed / :needs-review hooks: sell goods for real money through the payment providers that implement createPurchase. Core records a PURCHASE ledger row that moves no balance; the plugin delivers on confirmation. High trust: the plugin takes players’ money. See Wallet: purchases

Opt-in hooks (hooks:player-actions)

hooks:player-actions gates hooks rather than a registry namespace. A plugin that lists an opt-in hook in pokerEnginePlugin.hooks.optIn must also declare this capability:

{
  "capabilities": ["hooks:player-actions"],
  "hooks": { "optIn": ["game:player:action"] }
}
  • Validation. A manifest that opts in to game:player:action without declaring hooks:player-actions is invalid. The upload is rejected and npm run plugin:validate fails with hooks.optIn: opting in to game:player:action requires the "hooks:player-actions" capability; add "hooks:player-actions" to pokerEnginePlugin.capabilities. It is an error in both places, not a warning, because the SDK check reports exactly what the installer would refuse. Declaring the capability without an opt-in is allowed.
  • Loading. After register() the loader records the opt-in only if the plugin holds the granted capability. Otherwise it skips the opt-in and logs a warning (Plugin opt-in hooks skipped) with the hook names. This covers plugins loaded without the upload check, such as PAYMENT_PLUGINS entries whose stored grant lacks the capability.
  • Grant changes. Opt-ins follow every grant change: activation with consent records them, and deactivation, rollback or the circuit breaker drop them with the grant.
  • Fire time. The engine checks the grant again when it fires an opt-in hook, and a plugin’s addAction callback for an opt-in hook runs only while that plugin is opted in with the capability. A plugin that registers game:player:action without opting in never receives it, even when another plugin’s opt-in makes the engine fire the hook.
  • Admin API. GET /api/v1/admin/plugins and GET /api/v1/admin/plugins/:id return optInHooks: { declared, active, requiredCapability } for each plugin. declared comes from the loaded manifest and active lists the hooks the engine fires for the plugin. A hook in declared but not in active means the plugin lacks hooks:player-actions. Both lists are empty while the plugin is not loaded.

Gated hooks (game:rake and hooks:account-data)

These two capabilities gate hooks without an opt-in. The plugin declares the capability, the admin grants it at activation, and the plugin registers its callback as usual with registry.addFilter or registry.addAction. The loader wraps the callback and checks the grant every time the hook runs, so a grant revoked at runtime (deactivation, rollback, circuit breaker) takes effect on the next hand or event.

  • game:rake. A plugin’s game:rake:calculate callback runs only while the plugin holds game:rake. Without it the callback is a no-op that passes the rake through unchanged, and registering it logs a warning. The engine floors the final rake to whole chips and clamps it to zero, the contested pot and the table’s rake cap (when the table has one), whatever the filter returns. A value that is not a finite number, or is larger than Number.MAX_SAFE_INTEGER, keeps the configured rake.
  • hooks:account-data. auth:user:registered, auth:user:login and balance:changed fire for every plugin. A plugin without hooks:account-data receives a copy of the payload without email (registration), ip (login), or delta, balanceBefore and balanceAfter (balance changes). A plugin holding any wallet:* capability, which can already read balances through registry.wallet.getBalance, receives the balance:changed figures without hooks:account-data. The removed fields are typed as optional in @poker-engine/plugin-sdk, so check for them before use.

Certified random draws (game:random-draw)

registry.random.int(maxExclusive, { purpose }) (API 1.4, additive, optional on PluginRegistry) is the only random source a plugin may use for an outcome that moves money or prizes:

  • One integer in [0, maxExclusive), from the generator the core uses for its own outcome draws (crypto.randomInt, rejection sampling, no modulo bias). No floats, seeds or bytes.
  • Bounds: maxExclusive an integer from 2 to 1,000,000; purpose 1 to 200 characters (say what is drawn and from which inputs, for example the hand reference); at most 600 draws per plugin in any rolling minute on one server process.
  • Recorded: each draw is an append-only row in the admin audit trail (resource type plugin-random-draw, resource id the plugin id, details { purpose, minInclusive: 0, maxExclusive, result }) written before the result is returned.
  • Refused with PluginRandomRefusedError (code: 'PLUGIN_RANDOM_REFUSED', reason): rng-latch while the RNG health latch is closed (dealing is stopped too), rate-limit, invalid, record-failed. On a refusal the plugin draws nothing and must not fall back to Math.random, crypto or anything else.
  • Certified mode adds nothing: only release-signed plugins load there.

Jackpot contributions (game:jackpot-contribution)

API 1.4, additive. High impact: it takes money from real-money pots. With it (and game:rake), a plugin’s game:rake:calculate filter may return a labelled jackpotContribution: { amount, fundId } that the core keeps apart from the rake, limits, books to the fund’s ledger and reports on its own (see Server Hooks). Without the grant the contribution is dropped and the rake is unchanged. It also unlocks registry.jackpots:

  • declareFund({ fundId, name, percent, cap }): the fund players see with the table’s rake rule (its rate and cap per hand, never more than the operator’s limits). Declared funds leave with the plugin.
  • balance(fundId, currency): the fund’s balance, the sum of its ledger rows (a decimal string).
  • payout({ fundId, currency, userId, amount, idempotencyKey, reason }): the only way money leaves a fund. One serializable transaction under a lock on the fund: never more than the fund holds (JACKPOT_FUND_INSUFFICIENT), a negative fund ledger row and the player’s JACKPOT_PAYOUT wallet transaction together; a repeat with the same key returns the first payout (repeated: true). Nothing else, no admin route included, moves fund money.
  • entries({ fundId, currency?, kind?, limit?, cursor? }) (additive, optional): the plugin’s own fund’s ledger rows, newest first, up to 100 a page (25 by default), nextCursor for the next page. Each row: id, fundId, currency, kind (CONTRIBUTION, PAYOUT or SEED, an operator seed), amount (signed, two decimals), gameId, userId (the paid player, on a payout only; a seed’s staff member is never shown), reason, createdAt. A fund the plugin did not declare reads as empty.
  • One hand contributes to one fund: a plugin that runs several jackpots chooses one fund per hand in the rake filter. Several contributions per hand are not supported.
  • Operator seeds: staff with finance:transactions put the operator’s own money into a declared fund (Admin API POST /api/v1/admin/settings/jackpot-contributions/funds/:fundId/seed, { currency, amount, note?, requestId }, audited in the same transaction, insert-or-read on requestId, 409 JACKPOT_SEED_REQUEST_CONFLICT when the request id was already used for another fund or currency, refused in certified mode). It is the only way besides contributions that a fund grows; nothing takes fund money out except payout.
  • limits() (additive, optional): the operator limits { enabled, maxPercent, maxPerHand, locked }, read-only, so a plugin’s settings check can refuse a rate or cap above them and say so in certified mode. Call it as registry.jackpots?.limits?.().

Certified mode locks contributions off (jackpots.contributions: 'locked' in the compliance preset); the operator setting cannot switch them on there.

Bot decisions (game:bot-decide)

API 1.3. A plugin holding game:bot-decide can supply bot actions through the async game:bot:decide filter and read the bot list through registry.bots:

registry.bots.list();           // Promise<BotSummary[]>, ordered by name
registry.bots.get(botId);       // Promise<BotSummary | null>
registry.bots.isBot(playerId);  // boolean, from the bot manager
// BotSummary: { id, name, strategy, strategyProfileId, enabled, currentTableId, currentSeatIndex, sessionName,
//               engine, coreProfile }   // API 1.4: 'classic' | 'core'; { tier, character } | null
registry.bots.recentDecisions({ tableId?, handNumber?, botId?, id?, limit? });
// API 1.4: Promise<BotDecisionRecord[]>, newest first: { id, at, botId, tableId, handNumber, seatIndex,
//          actionIndex, trace }, core decisions of hands that have ended, on this node only

API 1.4 additions, both read-only. engine and coreProfile say how a bot decides: a core bot’s difficulty tier and character as it plays them now (the ones picked for it, or the ones drawn from the table’s default mix while it is seated on this node; null where unknown), null for a classic bot. recentDecisions reads the engine’s bounded in-memory store of core decision traces (by default the last 2,000 decisions of the last 6 hours per process; BOT_CORE_TRACE_STORE sets the size, 0 turns it off, and BOT_CORE_TRACE_STORE_HOURS the age) and returns a decision only once its hand has ended. A trace contains the bot’s own hole cards and how it read the hand: use it on admin routes (server:routes:admin) only, never on a public route or anywhere a player can see it. The ai-bots plugin’s Explain tab is the first user.

registry.bots is read-only: creating, seating and removing bots stays in the admin bot routes. The filter callback is a no-op without the grant (registering it logs a warning) and the grant is checked on every bot turn, so revoking it takes effect on the next decision. Whatever the plugin returns, the engine validates it against the legal actions and falls back to the built-in strategy on a timeout or an invalid result. See game:bot:decide.

Bot table talk (bots:chat)

API 1.4. A plugin holding bots:chat can let bots talk:

await registry.bots.say(botId, tableId, 'Nice hand.');  // { sent: true, message } or { sent: false, reason }
await registry.bots.showBotBadge();                     // the product's bot badge setting (false if unreadable)
registry.addAction('table:chat:message', ({ tableId, userId, username, message, timestamp }) => { /* players' lines */ });

say posts only for a bot seated at that table on this node (any table: private and tournament tables included), through the same chat switches, moderation, 200-character limit and history as a player’s line, under the bot’s table name. A line moderation would change is not sent (moderated), and the seat is checked again right before the broadcast. The engine allows one line per bot every 5 s and six bot lines per table per minute whatever the plugin asks. A line is not marked as coming from a bot: disclosure stays with the product’s bot badge setting. See table:chat:message.

POST /api/v1/admin/plugins/:id/activate takes an optional JSON body:

{ "grantCapabilities": ["storage", "wallet:credit-virtual", "bonus"] }
  • Plugin.grantedCapabilities starts as [] when the plugin is installed.
  • Activation adds grantCapabilities to the capabilities granted before. A grant for a capability the plugin did not declare is ignored.
  • If a declared capability is still not granted, activation is refused and nothing is loaded:
    HTTP 409 { "success": false, "error": { "code": "CAPABILITIES_NOT_GRANTED", "message": "Plugin \"progression\" needs the admin to grant these capabilities before it can be activated: wallet:credit-virtual, bonus", "missing": ["wallet:credit-virtual", "bonus"] } }
  • An unknown name in grantCapabilities returns 400 VALIDATION_ERROR.
  • When activation succeeds, the grant is saved on Plugin.grantedCapabilities. Later activations do not ask again.

GET /api/v1/admin/plugins and GET /api/v1/admin/plugins/:id return capabilities and grantedCapabilities as arrays on every plugin, so the admin UI can list them in the consent dialog.

Wallet caps

Every credit through wallet:credit-real, wallet:credit-virtual, wallet:credit-tickets or bonus counts against a per-plugin daily cap. Granting wallet:credit-real is not enough to pay real money: its cap defaults to 0 until a super-admin sets one in the plugin’s details (Wallet daily caps) or with PUT /api/v1/admin/plugins/:providerType/wallet-caps. Caps resolve admin value, then manifest (wallet.dailyCap, virtual and tickets only), then default (real 0, others unlimited). The admin can set a cap only for a balance whose credit capability (or bonus) the plugin declares. See Wallet.

In the admin panel, Activate on a plugin that declares capabilities opens a dialog that lists each one with a plain-language description (high-impact ones are flagged) and a Grant and activate button. The plugin list shows the declared capabilities as chips, with granted ones highlighted. See Admin: Plugins.

Upgrades

On upgrade the declared list is replaced by the new manifest’s list. The granted list keeps only the capabilities that the new version still declares. A capability that the upgrade adds is not granted automatically. Calls to it throw PluginCapabilityError until the admin deactivates the plugin and activates it again with the new capability in grantCapabilities.

Auto-discovered plugins (development)

Uploaded plugins are installed in the same plugins/ directory, so at startup the engine only skips the consent step for the plugins that ship in this repository (progression, daily-wheel, notifications, social, demo-plugin, ai-bots, social-login, steem-provider, telegram-auth, telegram-stars-provider, test-auth-provider, daily-rewards, season-pass, leagues, table-emotes, jackpot-spin, guest-login, store, stripe-provider, each with its own providerType), and only outside production (NODE_ENV is not production). When such a plugin has no Plugin row yet, or its row was written by the engine (installedBy: "system"), it is granted every capability it declares. The grant is logged (Auto-discovered plugin granted all declared capabilities) and written to Plugin.grantedCapabilities.

Every other folder is handled like an upload:

  • If it has a Plugin row, it loads with the grants stored on that row. Startup never adds a grant, so a capability that an upgrade added stays ungranted until the admin consents to it.
  • If it has no row (a plugin you scaffolded or copied in by hand, or an upload that failed half-way), its code is not loaded. The engine records it as an inactive plugin with nothing granted and logs a warning. Activate it in Extensions › Plugins, which asks for consent.

Plugins loaded from PAYMENT_PLUGINS use the grants stored on their Plugin row. If they have no row, they have no grants.

Runtime behaviour

  • Grants are held in memory per providerType (src/core/plugins/plugin-capabilities.ts). They are filled when the plugin loads or activates.
  • They are cleared whenever the plugin’s registration is rolled back. That happens on a failed load or activation, on deactivation, when the circuit breaker disables the plugin, and on deletion. Any timer or closure the plugin leaves running loses access at the same moment.
  • Every gated method calls assertCapability(providerType, capability) before it does anything else. Without the capability it throws PluginCapabilityError (code: PLUGIN_CAPABILITY_DENIED, HTTP status 403 if it reaches a route’s error handler).
import type { PluginRegistry } from '@poker-engine/plugin-sdk';

export async function register(registry: PluginRegistry) {
  registry.addAction('game:hand:completed', async (payload) => {
    try {
      await registry.storage.user(payload.winners[0].playerId).merge('stats', { lastWinAt: Date.now() });
    } catch (error) {
      registry.logger.warn('storage unavailable', { error: String(error) });
    }
  });
}

The capabilities that gate hooks are exported as OPT_IN_HOOKS_CAPABILITY (hooks:player-actions), RAKE_FILTER_CAPABILITY (game:rake), ACCOUNT_DATA_CAPABILITY (hooks:account-data), BOT_DECIDE_CAPABILITY (game:bot-decide, API 1.3) and PRESENCE_CAPABILITY (presence, gates user:online / user:offline) from plugin-manifest.ts, which also exports USERS_READ_CAPABILITY, and (API 1.4) AUTH_PROVIDER_CAPABILITY (auth:provider, gates auth:external:profile) and AUTH_SIGNUP_CAPABILITY (auth:signup, gates auth:register:validate).

Core helpers exported from src/core/plugins: PLUGIN_CAPABILITIES, PluginCapability, PluginCapabilityError, CapabilitiesNotGrantedError, assertCapability, hasCapability, getGrantedCapabilities, normalizeCapabilities, getPluginHookOptIns. onPluginCapabilitiesChanged(listener) in plugin-capabilities.ts runs after every grant change; the loader uses it to re-evaluate opt-ins.

Risk providers (risk:provider)

API 1.4, additive. A plugin that holds risk:provider registers a provider object with a kind, a display name (1-80 characters, describe what it does) and the one method of that kind:

registry.risk.registerProvider({
  kind: 'location',
  name: 'Address location lookup',
  async locate({ ip, deviceId, userId }) {
    return { country: 'XA', region: 'XA-01', concealed: false };
  },
});
KindMethodAnswer
locationlocate(request){ country, region, concealed? } (ISO 3166 codes; null when unplaced)
deviceassess(request){ deviceId, riskScore, signals }
identityverify(subject, request){ status: 'verified' | 'refer' | 'rejected', method, checkedAt, level? }
sanctionsscreen(subject){ outcome: 'clear' | 'possible' | 'hit', lists }
exclusion-registrylookup(subject){ excluded, until }
challengeverify(token, request){ success, reused? } (a human-presence challenge token, verified server to server)

request carries the user id, client address, user agent and a device id when known; subject only the fields the check needs (email, names, date of birth, country). Where the engine uses each answer (the country and region rule, KYC at registration, the central exclusion registry), the timeout, retries, fail rule and decision log are described in the Risk providers developer guide. The SDK test registry holds the provider in memory (registry.risk). The engine’s own deterministic providers are for tests and the laboratory test build only and are refused anywhere else.

Try the live demo Pricing

Have questions about Poker Engine? We reply fast.