Collectibles API (BETA)
Read the card catalog deployed with your game and let players claim subscriber-exclusive VIP cards. Card ownership itself flows through the Entitlements API (each card is a non-consumable entitlement); the methods on this namespace are for catalog hydration and VIP-tier claims.
Overview
A card is one non-consumable entitlement plus a chunk of presentation metadata (title, rarity, art paths, etc.). The metadata lives in your project's rundot/collectibles.config.json and is deployed with rundot deploy. The Collectibles API gives end users a way to:
Fetch the deployed catalog on game init so they can render owned-vs-unowned cards.
Claim VIP-tier cards for which they are eligible (active subscription + completed series).
How players earn free / completion cards (watch threshold crossings, rule eval) is described in the Stats API. How players purchase premium cards is described in the Shop API. All three paths produce the same kind of artifact — an entitlement the platform records.
API
The Collectibles API lives on RundotGameAPI.collectibles. Two methods.
listCards()
const catalog = await RundotGameAPI.collectibles.listCards()
// CollectibleCard[]Returns the full card catalog for the current game. Pure metadata — no per-user state. Typically called once on game init and cached client-side; the catalog only changes on the next rundot deploy.
interface CollectibleCard {
cardId: string // = entitlementId on the platform
storyId: string
episodeId?: string
type: 'free' | 'premium' | 'vip' | 'completion'
rarity: 'common' | 'rare' | 'epic' | 'legendary'
title: string
description: string
artPath: string // CDN-relative; resolve via cdn.resolveAssetUrl
thumbPath: string
lockedArtPath?: string
priceRbOverride?: number // premium only
limitedTimeEnd?: string // ISO date, premium only
}To know which cards the player currently owns, intersect this catalog with RundotGameAPI.entitlements.listEntitlements() by cardId === entitlementId.
claimVipCard(seriesId, cardId)
Claims a VIP-tier collectible card for the current user. The server validates two preconditions before granting:
Subscription status — the user must be an active subscriber (RevenueCat-backed). Non-subscribers receive a 403 with the message "Subscription required to claim."
Series completion — the user must have completed the requested series (the server checks the
series_completed_{seriesId}stat).
On success the matching card entitlement is granted directly — no rule engine, no client-writable trigger stat involved. The promise resolves with { granted: true, cardId }.
On failure the promise rejects with an Error whose message is the server-supplied detail. Typical consumer pattern:
Each call is a single user-initiated action — direct RPC, no batching.
Authoring cards
Cards live in rundot/collectibles.config.json alongside the rules that grant them. See the Stats API for the full schema (cards + rules + series settings) and an end-to-end watch-threshold-grants-card example.
Related
Stats API — submit watch / progress stats that trigger rule-driven grants
Entitlements API — read card ownership, audit grants
Shop API — premium card purchase flow
Last updated