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().
| Prop | Required | Notes |
|---|---|---|
questId | yes | The quest to load. |
quest | no | Seed row from the list, for instant render. Let the provider own it, do not mirror it in your own state. See Quest detail. |
authProfile | no | { socials, wallets } from the fan profile. Omit it and social and wallet gated quests stay disabled. |
fetchRewards | no | Flag. Loads the fan's reward allocations, which is what the claim button needs. Off by default. Needs a session. |
claimPayload | no | Details 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.
| Prop | Notes |
|---|---|
theme | Maps 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
| Part | Use |
|---|---|
Battlepass.Provider | Reads the season, the fan's membership and XP, and derives the lanes. Omit seasonId for the live season. |
Battlepass.Season | Season header. Render prop: { season, claimsEnabled, currentLevel, maxLevel }. |
Battlepass.Lane | Every lane in order, paid first. laneId renders one. |
Battlepass.Tier | One cell per level in a lane, gaps included. Render prop: { slot, level, gate, canClaim }. |
Battlepass.Claim | Claims one tier, every reward on it. Takes asChild. |
Battlepass.ClaimAll | Claims every tier that can settle on its own. Takes asChild. |
Battlepass.Provider prop | Notes |
|---|---|
seasonId | One season. Leave it off for the live one, including when there is no active season. |
authProfile | As on Quest.Provider, for tiers that gate on a linked account. |
Store
| Part | Use |
|---|---|
Store.Provider | Reads listings, balances, tiers and currency names |
Store.Listing | One listing, with its purchase gate worked out |
Store.Description | A listing's description. isPlain for a card. |
Store.Checkout | Holds the chosen price and the fan's details |
Store.Purchase | The buy button. Disables itself while the gate is locked. Takes asChild. |
Store.Provider prop | Notes |
|---|---|
enrichRequirements | Reads back details the fan already saved. Keep it on. |
filters | { sort, maxPrice, inStockOnly, tagIds }. Filtered on the server. |
page, limit | Paging. limit defaults to 20. |
Store.Checkout prop | Notes |
|---|---|
pricingOption | The price to charge. Pass the sale price yourself: the default is the first. |
requirementData | From toPurchaseRequirementData. Clears REQUIREMENTS_MISSING. |
QuestEvent
The event page, Joining and Results and rewards
| Part | Use |
|---|---|
QuestEvent.Provider | Reads one event, the fan's participation, the board, their rank and their rewards |
QuestEvent.Join | Joins or pre-registers. Disabled when joining is not possible. Takes asChild. |
QuestEvent.Sync | Refreshes a score on a score event. Takes asChild. |
QuestEvent.Claim | Claims one reward. Takes asChild. |
QuestEvent.LeaderboardPreviousPage | Previous page of the event board. Disabled on the first. Takes asChild. |
QuestEvent.LeaderboardNextPage | Next page. Disabled on the last. Takes asChild. |
QuestEvent.Provider prop | Notes |
|---|---|
eventId | The short id from your route, the full id, or the event's slug |
event | The row from the list, so the page paints at once. The full event still loads. |
leaderboardPage, onLeaderboardPageChange | Controlled board page, for your URL |
leaderboardLimit | Rows per board page. Defaults to 10. |
QuestEvent.Claim prop | Notes |
|---|---|
rewardAllocationId | Which reward. Required. |
payload | From toAllocationClaimPayload, for a prize that needs details |
onClaimed, onError | Called with the claimed reward, or the error |
The compound is QuestEvent, never Event, which is the browser's own global.
Avatar
| Part | Use |
|---|---|
Avatar.Provider | Reads the fan's slots and holds the draft. One per page, above everything that shows or edits the avatar. |
Avatar.Equip | Equips or unequips item in the draft. Disabled when it cannot be worn. Takes asChild. |
Avatar.Unequip | Puts slotId back to its default. Takes asChild. |
Avatar.Save | Saves every change in one request, then counts down its cooldown. Takes asChild. |
Avatar.Reset | Discards the draft. Takes asChild. |
Avatar.Provider prop | Notes |
|---|---|
saveCooldownMs | The wait after a save. Defaults to 15 seconds. 0 turns it off. |
onSaved, onSaveError | Called 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.
| Part | Use |
|---|---|
Avatar3D.Provider | Camera and capture state for one scene. Takes the community's config. |
Avatar3D.Scene | The 3D render of slots. Needs a sized wrapper. |
Avatar3D.ResetCamera | Puts the camera back. Renders only after the fan moves it. Takes asChild. |
Avatar3D.Capture | Takes a picture and calls onCapture with the file. Takes asChild. |
Avatar3D.Scene prop | Notes |
|---|---|
slots | The slots to draw. Pass the draft's, so equips show before saving. |
zoomTarget | From resolveAvatarZoomTarget. Where the camera points. |
onError | Fires once when 3D cannot render. Switch to the 2D stack. |
className, style | The wrapper. Give it a height. |
environmentFiles, dracoDecoderPath | Host the lighting and the model decoder yourself |
Leaderboard
| Part | Use |
|---|---|
Leaderboard.Provider | Reads one page of a board and the fan's own row |
Leaderboard.PreviousPage | Previous page. Disabled on the first. Takes asChild. |
Leaderboard.NextPage | Next page. Disabled on the last. Takes asChild. |
Leaderboard.Provider prop | Notes |
|---|---|
kind | LEADERBOARD_KIND.RESOURCE, the default, or LEADERBOARD_KIND.QUESTS |
page | Controlled page. Pass it with onPageChange, or leave both off. |
onPageChange | Fires from the pagers. How the page gets into your URL. |