DocsGame integration

In-game purchases

Set up a catalog and let the platform handle checkout and verified ownership.

Create your catalog

Each item has a stable SKU, such as golden-lantern. Use store_item_upsert to set its name, price and accepted tokens, and store_items to review the catalog.

An unlock is owned once. A consumable adds units that the game spends with looping.store.consume(). Prices can be in dollars, converted at checkout, or an exact amount of a supported token.

The game names an item by SKU. The platform owns its price and checkout. Read looping-store with skill_read before implementing purchases.

Checkout and ownership

JavaScript
const { items, mode } = await looping.store.items();
const owned = await looping.store.owned();

// In response to the player's Buy action:
const purchase = await looping.store.buy("golden-lantern");

// Restore verified ownership when the game loads again:
const updated = await looping.store.owned();

Present catalog prices in your shop, then call buy from a player action. Looping opens the checkout. Handle cancellation or refusal in the game and grant only the purchase returned by the platform.

Always restore ownership from owned() when loading a game. A local flag or player save is not proof of a purchase.

Protected content

Place paid files under paid/<sku>/. The host only serves them with a content ticket. Use looping.rooms.paidUrl or paidFetch through the SDK instead of linking to a paid file directly.

The build checker reports SKUs that are missing from the project's catalog. Keep the game's item names and protected folders aligned with that catalog.

Test and operate

Preview purchases use test mode and do not charge the player. Register looping.onCheck to let the platform exercise a purchase and read it back during a build check.

Use store_sales for settled purchases and store_settings to pause or resume checkout. Removing an item with store_item_remove stops sales; existing owners keep it.

Price increases take effect after 24 hours; reductions apply immediately. The platform reports pending changes in the catalog.