Skip to content

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.

ModuleDepends onResourcesClient functions
itemsitems (project)
inventoryitemsinventory (player)list
rewardinventory
remote_configconfigs, overrides (project)get
leaderboardsrewardboards (project), entries (player)submit, top
questsrewardquests (project), quest_progress (player)list, claim
storerewardoffers (project), purchases (player)list, buy
battlepassrewardseasons, 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.

Player resource inventory (itemSlug, amount), updated with an optimistic version. The client function list returns the player’s inventory with item display data.

FunctionTriggerArgumentsResultErrors
listclient{}{items: [{itemSlug, amount, item: {slug, name, icon, rarity, description, properties, tags} | null}]}; properties is JSON text
grantmodule{playerId, itemSlug, amount} (amount 0 means 1){itemSlug, amount}
consumeadmin{playerId, itemSlug, amount}{itemSlug, amount}insufficient_inventory
adminGrantadmin{playerId, input: {item, quantity}}{itemSlug, amount}invalid_input
adminRemoveadmin{playerId, input: {item, quantity}}{itemSlug, amount}invalid_input, insufficient_inventory
FunctionTriggerArgumentsResult
grant, adminGrantmodule, 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.

Resources configs (key, typed value) and overrides (config by key, typed value, segment, schedule, priority).

FunctionArgumentsResultErrors
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.
  • type is string, number, bool or json. value is always a string: the string itself, decimal text for int and float configs ("3", "0.25"), "true"/"false", or compact JSON text.
  • Generated clients add helpers that parse values by key: remoteConfigString/Number/Bool/Json in TypeScript and RemoteConfigValues.TryGetString/Number/Bool/Json in 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;

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).

FunctionArgumentsResultErrors
submit{slug, score: number}{slug, score} with the stored best scoreboard_not_found
top{slug, limit?: integer 0..1000}{entries: [{rank, playerId, score}]}board_not_found
  • submit keeps the player’s best score: the highest for desc, the lowest for asc. Scores are JSON numbers, so fractional scores work. A numeric string is rejected by argument validation (invalid_parameters).
  • top returns entries in board order with rank from 1. limit defaults to 10 and is capped by maxEntries.
  • The reset schedule 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.

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).

FunctionArgumentsResultErrors
list{}{quests: [Quest]}kernel only
claim{slug}{slug, reward: Reward} (the granted reward)quest_not_found, already_claimed, quest_not_complete
  • Quest is {slug, name, position, status, objectives: [{id, type, counter, offer, item, amount, progress}], next, reward}. A quest without progress is active with progress 0; unused counter/offer/item and a missing next are "".
  • An objective of type counter adds the counter’s increments; purchase_offer adds one per store purchase of offer; purchase_item adds one per store purchase whose reward contains item. 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 the next of another quest unless it was unlocked.
  • claim grants the reward of a completed offered quest, marks it claimed and unlocks next.
  • Progress advances on counter.incremented and store.purchased events.

Resources offers (name, slug, image, position, price, reward, schedule, segment, maxPurchases) and player resource purchases (offer, boughtAt).

FunctionArgumentsResultErrors
list{}{offers: [Offer]}kernel only
buy{offerSlug}{offer, boughtAt}offer_not_found, offer_not_available, purchase_limit_reached
  • Offer is {slug, name, image, position, price: {currency, amount} | null, reward, maxPurchases, purchases}. price is null for a free offer, maxPurchases 0 means unlimited, purchases counts the player’s purchases, and image is "" when unset.
  • list returns the offers available to the calling player: schedule active or empty, segment matching or empty, fewer than maxPurchases purchases.
  • buy fails with offer_not_available when the schedule or segment does not match. Otherwise it debits the wallet, grants the reward, records the purchase and emits store.purchased.

See Currency Shop.

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).

FunctionArgumentsResultErrors
progress{}{season: {slug, name, premiumPrice}, progress: Progress, tiers: [{id, level, xp, reward, premiumReward}]}season_not_active
claim{tierId}Progress after the claimseason_not_active, tier_not_found, tier_locked, already_claimed
buyPremium{}Progressseason_not_active
  • Progress is {xp, premium, claimed: [tierId]}. premiumPrice is {currency, amount} or null; a null premiumReward means premium players get reward.
  • The current season is the one whose schedule is active.
  • claim grants a tier of the current season; premium players get premiumReward when it is set.
  • buyPremium debits premiumPrice once per season.
  • Each counter.incremented event adds xpSources[counter] × delta XP in the current season.