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

  1. 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


๐Ÿ“š Full Store API Docs

โžก๏ธ View the full HTML5 SDK Store API Documentation