Docs · VCoin items

SDK

VCoin items

Skins, unlocks and extras that players buy with the VCoins already in their wallet.

Your game never sends a price. Show items[].priceVc from init. When the player taps an item, call purchase(id): VPlay asks them to confirm, charges the price held on our server, and records ownership in one step. Buying something already owned does nothing. If the price changed since the sheet opened, the player is asked again.

JavaScript
// Show the prices VPlay sent you, never your own:
for (const item of vp.items) addShopRow(item.id, item.label, item.priceVc, item.owned);

const res = await VPlay.purchase("skin.amber");
if (res.status === "purchased") unlockSkin("skin.amber");
// cancelled | needs_signin | insufficient | unavailable | error: nothing to do,
// VPlay has already told the player.

Ownership is permanent and follows the player to every device they sign in on. Read it from init's entitlements, call entitlements(), or listen for the entitlements event.

Item ids and prices are set up with us when we register your game. Ids may use letters, numbers and . _ : -, up to 80 characters, for example skin.amber.