> For the complete documentation index, see [llms.txt](https://onestore-dev.gitbook.io/dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://onestore-dev.gitbook.io/dev/eng/tools/web-sdk/ov.md).

# 01. Overview

#### **What is the ONE store H5 Game SDK?**

The ONE store H5 Game SDK is a JavaScript SDK that game developers must integrate to serve HTML5 games inside the WebView environment of the ONE store app.

The SDK is loaded into the game page as a JavaScript module (ESM) and handles communication with the ONE store app on the game's behalf. The game cannot communicate with the app directly by any means other than the SDK.

#### **Scope of This Guide**

<table><thead><tr><th width="180">Area</th><th>Contents</th><th width="240">Related Page</th></tr></thead><tbody><tr><td>Lifecycle</td><td>Initialization · loading · start · pause · exit</td><td><a href="https://onestore-dev.gitbook.io/dev/eng/tools/web-sdk/lifecycle">03. Lifecycle Management</a></td></tr><tr><td>In-App Advertising</td><td>Rewarded ads · interstitial ads</td><td><a href="https://onestore-dev.gitbook.io/dev/eng/tools/web-sdk/iaa">04. In-App Advertising (IAA)</a></td></tr><tr><td>In-App Purchase</td><td>Purchase and payment of managed products</td><td><a href="https://onestore-dev.gitbook.io/dev/eng/tools/web-sdk/iap">05. In-App Purchase (IAP)</a></td></tr><tr><td>Product Details</td><td>Lookup of in-app product names and prices</td><td><a href="https://onestore-dev.gitbook.io/dev/eng/tools/web-sdk/iap">05. In-App Purchase (IAP)</a></td></tr></tbody></table>

#### **How the SDK Is Loaded**

The SDK file is loaded from ONE store's CDN.

```javascript
// Load at the top level of the game document, before the game code. (type="module" script)
import { createSDK } from "https://h5sdk.onestore.net/lib/{{version}}/onestore-h5-sdk.js";

var sdk = createSDK();
```

For the version to use in place of `{{version}}`, see [08. Release Notes](https://onestore-dev.gitbook.io/dev/eng/tools/web-sdk/releasenote).

{% hint style="info" %}
The SDK must be loaded before the game code. The SDK establishes a connection with the hosting page as soon as it loads. If it loads later than that, events that arrive immediately after initialization may be missed.
{% endhint %}

The game page is loaded by the ONE store hosting page inside an iframe. Game developers do not need to prepare any frame structure of their own. Communication with the app is handled by the SDK through the hosting page.

{% hint style="warning" %}
However, the script that calls the SDK must be placed at the **top level of the game document**. SDK initialization fails inside a nested iframe created by the game page itself.
{% endhint %}

#### **How Errors Are Delivered**

An error delivered from the SDK to the game carries two values: `e.reason` (a reason string for branching) and `e.message` (a message for logging). **Numeric error codes are not delivered.**

For the error delivery form of each API type and the full list of reasons, see [06. Error Reasons (reason)](https://onestore-dev.gitbook.io/dev/eng/tools/web-sdk/errors).
