-
Notifications
You must be signed in to change notification settings - Fork 0
Store API Integration
serdarakay edited this page Jun 20, 2025
·
1 revision
You can integrate the GameDistribution Store API into your GameMaker: HTML5 projects using the built-in JavaScript extension support. This enables you to fetch virtual store items, manage user inventory, and handle purchases through GameDistribution's store platform.
To get started:
- Export your project as HTML5.
- Open the generated
index.html
. - Add the following inside the
<head>
tag:
<script type="text/javascript">
window["GD_OPTIONS"] = {
gameId: "your-game-id",
onEvent: function(event) {
console.log("GD Event:", event);
}
};
</script>
<script src="https://html5.api.gamedistribution.com/main.js"></script>
β Make sure to replace
your-game-id
with your actual GameDistribution game ID.
Use the external_call
function to call the GameDistribution store API directly from GameMaker.
var script = "gdsdk.executeStoreAction({ action: 'api.items' }).then((items) => { console.log('Store Items:', items); });";
external_call("eval", script);
var script = "gdsdk.executeStoreAction({ action: 'api.buyProduct', payload: { sku: 'ss-enhance-shield-5', quantity: 1 } });";
external_call("eval", script);
You can also trigger store UI interactions:
external_call("eval", "gdsdk.executeStoreAction({ action: 'ui.open' });");
external_call("eval", "gdsdk.executeStoreAction({ action: 'ui.close' });");
π GameDistribution HTML5 SDK - Store API Usage
If you would like an example GameMaker HTML5 project with full Store API integration, please contact the GameDistribution team.