Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

UseProductsResult

What useProducts answers.

buy<Key>(this, key, options?): Promise<BuyResult>

Asks the app to sell the player key: the app shows its own sheet, with the platform’s name, price and refund rule, and resolves with how the purchase ended. A consumable resolves bought once its grant is in a committed save, returned once its Spawnites went back, and queued at once where it waits for the player’s next seat. A context the product’s schema refuses, or a label past 60 characters, resolves unavailable before the sheet opens. A second call for a key while one is pending answers the same promise. Outside the app, it resolves unavailable.

Type Parameter
Key extends string
Parameter Type
this void
key Key
options? BuyOptions<Key>

Promise<BuyResult>


owns(this, key): boolean

Whether the player owns the durable product key, as the platform last answered: true once a purchase of it landed, and false once it was taken back, as a refund or a chargeback takes it. The component renders again as it changes. For what the page draws, such as the shop: a room decides what a product does with ownsProduct. False outside the app.

Parameter Type
this void
key string

boolean