First-party modules
These modules are published to the marketplace by Rudder and written in Go. The current version of every first-party module is 5.0.0. Install them from Modules in the dashboard; each one adds its own section to the sidebar. Game clients call their client functions through a generated module client; every function has typed arguments, a typed result and declared error codes. See Modules.
| Module | Depends on | Resources | Client functions |
|---|---|---|---|
items | — | items (project) | — |
inventory | items | inventory (player) | list |
reward | inventory | — | — |
remote_config | — | configs, overrides (project) | get |
leaderboards | reward | boards (project), entries (player) | submit, top |
quests | reward | quests (project), quest_progress (player) | list, claim |
store | reward | offers (project), purchases (player) | list, buy |
battlepass | reward | seasons, tiers (project), battlepass_progress (player) | progress, claim, buyPremium |
Rewards everywhere use one shape, granted by reward.grant: Reward is {currencies: {slug: integer}, items: {slug: number}, counters: {slug: integer}}, always with all three maps.
insufficient_funds is a kernel code: any function that debits a wallet can return it, and generated clients always include it.
Project resource items (name, slug, icon, rarity, description, properties, tags). The slug is filled from the name while the item is new and locked afterwards. The admin function itemsCount backs the dashboard stat. items has no client functions.
inventory
Section titled “inventory”Player resource inventory (itemSlug, amount), updated with an optimistic version. The client function list returns the player’s inventory with item display data.
| Function | Trigger | Arguments | Result | Errors |
|---|---|---|---|---|
list | client | {} | {items: [{itemSlug, amount, item: {slug, name, icon, rarity, description, properties, tags} | null}]}; properties is JSON text | |
grant | module | {playerId, itemSlug, amount} (amount 0 means 1) | {itemSlug, amount} | |
consume | admin | {playerId, itemSlug, amount} | {itemSlug, amount} | insufficient_inventory |
adminGrant | admin | {playerId, input: {item, quantity}} | {itemSlug, amount} | invalid_input |
adminRemove | admin | {playerId, input: {item, quantity}} | {itemSlug, amount} | invalid_input, insufficient_inventory |
reward
Section titled “reward”| Function | Trigger | Arguments | Result |
|---|---|---|---|
grant, adminGrant | module, admin | {playerId, reward: Reward} | {ok} |
grant applies a whole reward in one call and is callable by modules that depend on reward; adminGrant is the same operation for admins.
remote_config
Section titled “remote_config”Resources configs (key, typed value) and overrides (config by key, typed value, segment, schedule, priority).
| Function | Arguments | Result | Errors |
|---|---|---|---|
get | {} | {values: {[key]: {type, value}}} | kernel only |
- For each config, the override with the highest priority whose schedule is active (or empty) and whose segment matches the player (or is empty) replaces the value.
typeisstring,number,boolorjson.valueis always a string: the string itself, decimal text forintandfloatconfigs ("3","0.25"),"true"/"false", or compact JSON text.- Generated clients add helpers that parse values by key:
remoteConfigString/Number/Bool/Jsonin TypeScript andRemoteConfigValues.TryGetString/Number/Bool/Jsonin C#. See remote_config helpers. - An override value must have its config’s type; the dashboard rejects mismatches.
const config = await modules(client).remoteConfig.get({});const multiplier = remoteConfigNumber(config, 'reward_multiplier') ?? 1;leaderboards
Section titled “leaderboards”Resources boards (name, slug, resetPeriod never/daily/weekly/monthly, order desc/asc, maxEntries, rewards by rank range) and player resource entries (board by slug, score).
| Function | Arguments | Result | Errors |
|---|---|---|---|
submit | {slug, score: number} | {slug, score} with the stored best score | board_not_found |
top | {slug, limit?: integer 0..1000} | {entries: [{rank, playerId, score}]} | board_not_found |
submitkeeps the player’s best score: the highest fordesc, the lowest forasc. Scores are JSON numbers, so fractional scores work. A numeric string is rejected by argument validation (invalid_parameters).topreturns entries in board order withrankfrom 1.limitdefaults to 10 and is capped bymaxEntries.- The
resetschedule runs hourly in both environments. A board with a reset period is reset once the next boundary (00:00 UTC; Monday for weekly; the 1st for monthly) after its last reset has passed: players whose rank falls in a reward range get that reward, then all entries are deleted. - Admins can reset a board immediately from its detail page.
See Leaderboard Tournament for a full example.
quests
Section titled “quests”Resources quests (name, slug, status draft/active/archived, position, schedule, segment, objectives, next, reward) and player resource quest_progress (quest, status active/completed/claimed, objectives, claimed).
| Function | Arguments | Result | Errors |
|---|---|---|---|
list | {} | {quests: [Quest]} | kernel only |
claim | {slug} | {slug, reward: Reward} (the granted reward) | quest_not_found, already_claimed, quest_not_complete |
Questis{slug, name, position, status, objectives: [{id, type, counter, offer, item, amount, progress}], next, reward}. A quest without progress isactivewithprogress0; unusedcounter/offer/itemand a missingnextare"".- An objective of type
counteradds the counter’s increments;purchase_offeradds one per store purchase ofoffer;purchase_itemadds one per store purchase whose reward containsitem. A quest completes when every objective reaches its amount. - A quest is offered to a player when it is
active, its schedule is active (or empty), its segment matches (or is empty), and it is not thenextof another quest unless it was unlocked. claimgrants the reward of a completed offered quest, marks it claimed and unlocksnext.- Progress advances on
counter.incrementedandstore.purchasedevents.
Resources offers (name, slug, image, position, price, reward, schedule, segment, maxPurchases) and player resource purchases (offer, boughtAt).
| Function | Arguments | Result | Errors |
|---|---|---|---|
list | {} | {offers: [Offer]} | kernel only |
buy | {offerSlug} | {offer, boughtAt} | offer_not_found, offer_not_available, purchase_limit_reached |
Offeris{slug, name, image, position, price: {currency, amount} | null, reward, maxPurchases, purchases}.priceis null for a free offer,maxPurchases0 means unlimited,purchasescounts the player’s purchases, andimageis""when unset.listreturns the offers available to the calling player: schedule active or empty, segment matching or empty, fewer thanmaxPurchasespurchases.buyfails withoffer_not_availablewhen the schedule or segment does not match. Otherwise it debits the wallet, grants the reward, records the purchase and emitsstore.purchased.
See Currency Shop.
battlepass
Section titled “battlepass”Resources seasons (name, slug, schedule, premiumPrice, xpSources mapping counter to XP), tiers (season, level, xp, reward, premiumReward) and player resource battlepass_progress (season, xp, premium, claimed).
| Function | Arguments | Result | Errors |
|---|---|---|---|
progress | {} | {season: {slug, name, premiumPrice}, progress: Progress, tiers: [{id, level, xp, reward, premiumReward}]} | season_not_active |
claim | {tierId} | Progress after the claim | season_not_active, tier_not_found, tier_locked, already_claimed |
buyPremium | {} | Progress | season_not_active |
Progressis{xp, premium, claimed: [tierId]}.premiumPriceis{currency, amount}or null; a nullpremiumRewardmeans premium players getreward.- The current season is the one whose schedule is active.
claimgrants a tier of the current season; premium players getpremiumRewardwhen it is set.buyPremiumdebitspremiumPriceonce per season.- Each
counter.incrementedevent addsxpSources[counter] × deltaXP in the current season.