Store API Integration - GameDistribution/gd-sdk-construct-3 GitHub Wiki

🧩 Using GameDistribution Store API in Construct 3

You can integrate the GameDistribution Store API directly in your Construct 3 projects using the JavaScript scripting system. This allows you to access virtual items, currencies, cart actions, and inventory management seamlessly.


βœ… 1. Enable JavaScript Scripting

To begin, make sure your project has JavaScript scripting enabled.

  1. Open your Construct 3 project.
  2. Go to the Scripts section in the Project panel.
  3. Create a new script file (e.g., store.js).

πŸ“· Script Selection


✍️ 2. Using Store API in Your Script

After adding the script, you can use the GameDistribution Store API just like in a standard HTML5 project.

Here’s an example of fetching store items:

const items = await gdsdk.executeStoreAction({ action: "api.items" });
console.log("Store items:", items);

To purchase a virtual product:

await gdsdk.executeStoreAction({
  action: "api.buyProduct",
  payload: {
    sku: "ss-enhance-shield-5",
    quantity: 1
  }
});

πŸ“· Script Selection


πŸ“š Related Documentation

To see the full list of store API methods and usage patterns, visit the main HTML5 SDK documentation:

πŸ”— GameDistribution HTML5 SDK - Store API Usage