> 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/pre.md).

# 02. Pre Preparations

#### **Game Page Requirement: Allow iframe Embedding**

The game page is loaded by the ONE store hosting page inside an iframe. Game developers do not need to prepare the frame structure, but **the game server must allow iframe embedding from ONE store domains**.

If it is blocked, **the game screen is not displayed**, so please check this early in development.

**Requirements**

<table><thead><tr><th width="360">Response header of the game URL</th><th>Result on ONE store</th></tr></thead><tbody><tr><td><code>X-Frame-Options: DENY</code> or <code>SAMEORIGIN</code></td><td>Blocked</td></tr><tr><td>CSP <code>frame-ancestors</code> without ONE store domains</td><td>Blocked</td></tr><tr><td>CSP <code>frame-ancestors</code> including ONE store domains (including a wildcard such as <code>*</code>)</td><td>Allowed</td></tr><tr><td>Neither header present</td><td>Allowed (open to every site)</td></tr></tbody></table>

If both headers are present, `frame-ancestors` takes precedence. `X-Frame-Options` cannot allow specific domains only. `ALLOW-FROM` is deprecated syntax and is ignored by current browsers.

**How to Fix**

**Option 1. Allow ONE store domains only (recommended)**

Your existing blocking policy stays in place, and embedding becomes possible only from ONE store.

```
Content-Security-Policy: frame-ancestors https://*.onestore.co.kr https://*.onestore.net
```

{% hint style="warning" %}
**Allow both domains above in full, not individual hosts.**

`frame-ancestors` checks **every ancestor screen** that wraps the game. Besides the game runtime screen, the **registration review tool** also wraps the game, and the two screens are on different ONE store domains.

If you list only the game runtime domain, **the registration review is blocked and your submission is rejected.**
{% endhint %}

**Option 2. Remove the blocking headers from the response (alternative)**

You must remove **both** `X-Frame-Options` and CSP `frame-ancestors`. If you remove only one, the remaining one keeps blocking.

{% hint style="warning" %}
**Please consider this before choosing Option 2.** `X-Frame-Options` is a security header intended to prevent clickjacking. Removing it lets **any site embed your game page in its own screen**, not just ONE store.

Option 1 is sufficient for serving on ONE store. Choose Option 2 only if you have determined it is acceptable under your own security policy.
{% endhint %}

{% hint style="warning" %}
**Both settings work only as HTTP response headers.** An `X-Frame-Options` or `frame-ancestors` value written as `<meta http-equiv>` in the HTML document is ignored by browsers.
{% endhint %}

**Verifying the Setting**

Based on the **final response headers** (after passing through your CDN and WAF), it is correct if neither header is present, or if `frame-ancestors` includes the ONE store domains above.

{% hint style="info" %}
Even if you do not recall setting them, these headers are often added by **the default security profile of your framework, CDN, or WAF**. Spring Security defaults to `DENY` and helmet defaults to `SAMEORIGIN`. If blocking continues after checking only the application settings, please check the layers in front of it.
{% endhint %}

{% hint style="info" %}
**ONE store domains may change with prior notice.** If you use the allowlist approach in Option 1, please check the latest values in this guide periodically. The game is not displayed on domains that are missing from the list.
{% endhint %}

#### **Load the SDK**

The SDK file is served from ONE store's CDN. Load it as a `type="module"` script at the top level of the game document, before the game code.

* `https://h5sdk.onestore.net/lib/{{version}}/onestore-h5-sdk.js`
* `https://h5sdk.onestore.net/lib/{{version}}/onestore-h5-sdk.min.js`

```javascript
import { createSDK } from "https://h5sdk.onestore.net/lib/{{version}}/onestore-h5-sdk.min.js";

var sdk = createSDK();
```

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

#### **Obtain an Ad Placement ID (placementId)**

{% hint style="warning" %}
To request ads, you must obtain an ad placement ID (placementId) in advance. Placement IDs are issued per game in the ONE store Developer Center (one each for rewarded and interstitial ads). A request with an unissued placement fails with no fallback. Please refer to [Monetization > In-app advertising](https://onestore-dev.gitbook.io/dev/eng/docs/apps/product/monetization/iaa) for the placement issuance procedure.
{% endhint %}

For how to request ads, see [04. In-App Advertising (IAA)](https://onestore-dev.gitbook.io/dev/eng/tools/web-sdk/iaa).

#### **Register In-App Products**

You must register **managed products** under the "App Monetization > In-App Products" menu in ONEconsole. The in-app product types supported for Web products are shown in the table below.

<table><thead><tr><th width="239">Product Type</th><th>Web Product</th></tr></thead><tbody><tr><td>Managed product</td><td>Supported</td></tr><tr><td>Subscription product</td><td>Not supported</td></tr></tbody></table>

* For details on product registration, please refer to the guide below.
  * [Registering a Product](https://onestore-dev.gitbook.io/dev/eng/docs/apps)

For how to request a purchase, see [05. In-App Purchase (IAP)](https://onestore-dev.gitbook.io/dev/eng/tools/web-sdk/iap).
