Reference

Components

Quest, Battlepass, Store and Leaderboard, the four compounds in the SDK.

Four compounds: Quest, Battlepass, Store and Leaderboard. All of them render your markup. None ship CSS.

The newsfeed, prizes and account linking have no compound. They are hooks only, because there is no shared state worth a provider. See Hooks.

The asChild pattern

<Quest.Submit asChild>
  <button className="your-class">Complete</button>
</Quest.Submit>

The component attaches behaviour to your element. Your class names and props pass through unchanged.

Without asChild you get a bare unstyled element, which is rarely what you want in production.

Quest.Provider

Loads a quest, runs the state machine, provides useQuest().

PropRequiredNotes
questIdyesThe quest to load.
questnoSeed row from the list, for instant render. Let the provider own it, do not mirror it in your own state. See Quest detail.
authProfileno{ socials, wallets } from the fan profile. Omit it and social and wallet gated quests stay disabled.
fetchRewardsnoFlag. Loads the fan's reward allocations, which is what the claim button needs. Off by default. Needs a session.
claimPayloadnoDetails a prize claim requires. Build it with toAllocationClaimPayload. Claims that need details.

Quest.Frame

Wraps your detail UI inside the provider. Structural only.

Quest.Description

Renders the structured description.

PropNotes
themeMaps node types to your class names.

Theme keys: paragraph, heading.{h1,h2,h3}, list.{ul,ol,listitem}, link, text.{bold,italic,underline,strikethrough}, quote, code.

See Quest descriptions.

Quest.Submit

Submit CTA for empty-body templates. Visit, bind, progress, automatic.

<Quest.Submit asChild>
  <button disabled={!state.canSubmit}>{state.buttonLabel}</button>
</Quest.Submit>

Typed templates use actions.submit(payload) instead. This component submits with no body.

Quest.Accept

Accept step, for templates that have one. Same pattern.

Quest.Complete

Complete step, for templates that have one. Same pattern.

Quest.Claim

Claim CTA. Show when state.canClaim. Claims every waiting reward on the quest, not only the first.

{state.canClaim && (
  <Quest.Claim asChild>
    <button className="your-button">{state.buttonLabel}</button>
  </Quest.Claim>
)}

Disabled state

Put disabled on your own element, driven by state.canSubmit or state.canClaim.

<Quest.Submit asChild>
  <button disabled={!state.canSubmit}>{state.buttonLabel}</button>
</Quest.Submit>

Battlepass

Rendering a season

PartUse
Battlepass.ProviderReads the season, the fan's membership and XP, and derives the lanes. Omit seasonId for the live season.
Battlepass.SeasonSeason header. Render prop: { season, claimsEnabled, currentLevel, maxLevel }.
Battlepass.LaneEvery lane in order, paid first. laneId renders one.
Battlepass.TierOne cell per level in a lane, gaps included. Render prop: { slot, level, gate, canClaim }.
Battlepass.ClaimClaims one tier, every reward on it. Takes asChild.
Battlepass.ClaimAllClaims every tier that can settle on its own. Takes asChild.
Battlepass.Provider propNotes
seasonIdOne season. Leave it off for the live one, including when there is no active season.
authProfileAs on Quest.Provider, for tiers that gate on a linked account.

Store

Browsing the store and Buying

PartUse
Store.ProviderReads listings, balances, tiers and currency names
Store.ListingOne listing, with its purchase gate worked out
Store.DescriptionA listing's description. isPlain for a card.
Store.CheckoutHolds the chosen price and the fan's details
Store.PurchaseThe buy button. Disables itself while the gate is locked. Takes asChild.
Store.Provider propNotes
enrichRequirementsReads back details the fan already saved. Keep it on.
filters{ sort, maxPrice, inStockOnly, tagIds }. Filtered on the server.
page, limitPaging. limit defaults to 20.
Store.Checkout propNotes
pricingOptionThe price to charge. Pass the sale price yourself: the default is the first.
requirementDataFrom toPurchaseRequirementData. Clears REQUIREMENTS_MISSING.

QuestEvent

The event page, Joining and Results and rewards

PartUse
QuestEvent.ProviderReads one event, the fan's participation, the board, their rank and their rewards
QuestEvent.JoinJoins or pre-registers. Disabled when joining is not possible. Takes asChild.
QuestEvent.SyncRefreshes a score on a score event. Takes asChild.
QuestEvent.ClaimClaims one reward. Takes asChild.
QuestEvent.LeaderboardPreviousPagePrevious page of the event board. Disabled on the first. Takes asChild.
QuestEvent.LeaderboardNextPageNext page. Disabled on the last. Takes asChild.
QuestEvent.Provider propNotes
eventIdThe short id from your route, the full id, or the event's slug
eventThe row from the list, so the page paints at once. The full event still loads.
leaderboardPage, onLeaderboardPageChangeControlled board page, for your URL
leaderboardLimitRows per board page. Defaults to 10.
QuestEvent.Claim propNotes
rewardAllocationIdWhich reward. Required.
payloadFrom toAllocationClaimPayload, for a prize that needs details
onClaimed, onErrorCalled with the claimed reward, or the error

The compound is QuestEvent, never Event, which is the browser's own global.

Avatar

The avatar editor

PartUse
Avatar.ProviderReads the fan's slots and holds the draft. One per page, above everything that shows or edits the avatar.
Avatar.EquipEquips or unequips item in the draft. Disabled when it cannot be worn. Takes asChild.
Avatar.UnequipPuts slotId back to its default. Takes asChild.
Avatar.SaveSaves every change in one request, then counts down its cooldown. Takes asChild.
Avatar.ResetDiscards the draft. Takes asChild.
Avatar.Provider propNotes
saveCooldownMsThe wait after a save. Defaults to 15 seconds. 0 turns it off.
onSaved, onSaveErrorCalled after a save, or a failed one

Avatar3D

Rendering an avatar. Imported from @xborglabs/fanbase-react/avatar-3d, which needs React 19 and its own dependencies.

PartUse
Avatar3D.ProviderCamera and capture state for one scene. Takes the community's config.
Avatar3D.SceneThe 3D render of slots. Needs a sized wrapper.
Avatar3D.ResetCameraPuts the camera back. Renders only after the fan moves it. Takes asChild.
Avatar3D.CaptureTakes a picture and calls onCapture with the file. Takes asChild.
Avatar3D.Scene propNotes
slotsThe slots to draw. Pass the draft's, so equips show before saving.
zoomTargetFrom resolveAvatarZoomTarget. Where the camera points.
onErrorFires once when 3D cannot render. Switch to the 2D stack.
className, styleThe wrapper. Give it a height.
environmentFiles, dracoDecoderPathHost the lighting and the model decoder yourself

Leaderboard

Rendering a board

PartUse
Leaderboard.ProviderReads one page of a board and the fan's own row
Leaderboard.PreviousPagePrevious page. Disabled on the first. Takes asChild.
Leaderboard.NextPageNext page. Disabled on the last. Takes asChild.
Leaderboard.Provider propNotes
kindLEADERBOARD_KIND.RESOURCE, the default, or LEADERBOARD_KIND.QUESTS
pageControlled page. Pass it with onPageChange, or leave both off.
onPageChangeFires from the pagers. How the page gets into your URL.

On this page