Store API Integration - GameDistribution/GD-Construct2 GitHub Wiki
๐ฎ Construct 2 Store API Integration
This guide explains how to use the GameDistribution Store API in a Construct 2 project using the Execute JavaScript action.
โ Prerequisites
-
Use the "Execute JavaScript" action in Construct 2 to interact with the Store API.
Example:gdsdk.executeStoreAction({ action: 'ui.open' });
๐ฆ Available Actions
Description | JavaScript Code |
---|---|
Open Store UI | gdsdk.executeStoreAction({ action: 'ui.open' }); |
Close Store UI | gdsdk.executeStoreAction({ action: 'ui.close' }); |
Get Virtual Items | await gdsdk.executeStoreAction({ action: 'api.items' }); |
Buy a Product | await gdsdk.executeStoreAction({ action: 'api.buyProduct', payload: { sku: 'ss-enhance-shield-5', quantity: 1 } }); |
Inventory Items | await gdsdk.executeStoreAction({ action: 'api.inventoryItems' }); |
More actions are available in the full documentation (see link below).
๐งช Example Game & Screenshot
-
๐ผ๏ธ Example UI:
๐ Full Store API Docs
โก๏ธ View the full HTML5 SDK Store API Documentation