Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 18
Store API Integration
serdarakay edited this page Jun 17, 2025
·
1 revision
GameDistribution HTML5 SDK now includes powerful Store API features. This guide explains how to open the store UI, retrieve virtual products and currencies, manage the cart and inventory, and handle user authentication using the gdsdk.executeStoreAction() method.
- UI Control
- Fetch Store Data
- Inventory Management
- Cart Operations
- Product Purchase & Consumption
- User Authentication
- Store-Related Events
// Open the store UIgdsdk.executeStoreAction({action: 'ui.open'});// Close the store UIgdsdk.executeStoreAction({action: 'ui.close'});
## 📦FetchStoreData// Get virtual itemsconstitems=awaitgdsdk.executeStoreAction({action: 'api.items'});// Get bundlesconstbundles=awaitgdsdk.executeStoreAction({action: 'api.bundles'});// Get virtual currenciesconstcurrencies=awaitgdsdk.executeStoreAction({action: 'api.virtualCurrencies'});// Get currency packagesconstcurrencyPackages=awaitgdsdk.executeStoreAction({action: 'api.virtualCurrencyPackages'});
## 🎒InventoryManagement// Get inventory itemsconstinventoryItems=awaitgdsdk.executeStoreAction({action: 'api.inventoryItems'});// Get inventory currenciesconstinventoryCurrencies=awaitgdsdk.executeStoreAction({action: 'api.inventoryCurrencies'});
## 🛍️CartOperations// Add product to cartawaitgdsdk.executeStoreAction({action: 'api.addToCart',payload: {sku: 'your-sku',quantity: 1}});// Remove product from cartawaitgdsdk.executeStoreAction({action: 'api.removeFromCart',payload: {sku: 'your-sku'}});// Update item quantityawaitgdsdk.executeStoreAction({action: 'api.updateCartItem',payload: {sku: 'your-sku',quantity: 3}});// Get current cart contentsconstcart=awaitgdsdk.executeStoreAction({action: 'api.getCurrentCart'});// Clear cartawaitgdsdk.executeStoreAction({action: 'api.clearCart'});// Purchase cartawaitgdsdk.executeStoreAction({action: 'api.buyCart'});
## 💸ProductPurchase&Consumption// Buy a single productawaitgdsdk.executeStoreAction({action: 'api.buyProduct',payload: {sku: 'your-sku',quantity: 1}});// Consume an item from inventoryawaitgdsdk.executeStoreAction({action: 'api.consume',payload: {sku: 'your-sku',quantity: 1}});
## 🔐UserAuthentication// Get login infoconstloginInfo=awaitgdsdk.executeStoreAction({action: 'api.loginInfo'});// Check if user is logged inconstisLoggedIn=awaitgdsdk.executeStoreAction({action: 'api.isLoggedIn'});// Loginawaitgdsdk.executeStoreAction({action: 'api.login'});// Logoutawaitgdsdk.executeStoreAction({action: 'api.logout'});Gamedistribution.com offers a free service for developers and publishers. We help game developers monetize and distribute their games. We offer publishers a wide range of high quality cross platform games.
