# RUN.game SDK

The RUN.game SDK gives your HTML5 game access to monetization, multiplayer, storage, AI, and more — all through a single import.

## Quick Start

```typescript
import RundotGameAPI from '@series-inc/rundot-game-sdk/api'
```

Every API is accessed through `RundotGameAPI`. For example:

```typescript
// Save player progress
await RundotGameAPI.appStorage.setItem('level', '5')

// Show a rewarded ad
const result = await RundotGameAPI.ads.showRewardedAdAsync()

// Get server time
const time = await RundotGameAPI.time.requestTimeAsync()
```

## API Reference

### Monetization

| API                                           | What it does                                 |
| --------------------------------------------- | -------------------------------------------- |
| [Ads](/rundot-docs/readme/ads.md)             | Serve rewarded video and interstitial ads.   |
| [Purchases](/rundot-docs/readme/purchases.md) | Let players spend RunBucks on digital goods. |

### Messaging

| API                                                         | What it does                                     |
| ----------------------------------------------------------- | ------------------------------------------------ |
| [Notifications](/rundot-docs/readme/notifications.md)       | Schedule local notifications for re-engagement.  |
| [In-App Messaging](/rundot-docs/readme/in_app_messaging.md) | Display toast notifications and in-app messages. |

### Assets

| API                                                   | What it does                                                                 |
| ----------------------------------------------------- | ---------------------------------------------------------------------------- |
| [Assets](/rundot-docs/readme/assets.md)               | Load game assets from the CDN with caching, preloading, and WebView support. |
| [Shared Assets](/rundot-docs/readme/shared_assets.md) | Download host-provisioned asset bundles shared across titles.                |

### Game Systems

| API                                                                             | What it does                                                               |
| ------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| [Experiments](/rundot-docs/readme/experiments.md)                               | Run A/B tests, feature flags, and feature gates.                           |
| [Big Numbers](/rundot-docs/readme/bignumbers.md)                                | Handle exponential economies without losing precision.                     |
| [Multiplayer (BETA)](/rundot-docs/readme/multiplayer.md)                        | Build synchronous multiplayer sessions with real-time updates.             |
| [Simulation API (BETA)](/rundot-docs/readme/server_authoritative.md)            | Drive authoritative game state through the simulation system.              |
| [Simulation: Config Reference (BETA)](/rundot-docs/readme/simulation_config.md) | Define entities, recipes, loot tables, and lifecycle hooks in JSON config. |
| [Simulation: Energy System (BETA)](/rundot-docs/readme/energy_system.md)        | Implement regenerating energy/stamina with offline catch-up.               |
| [Simulation: Gacha System (BETA)](/rundot-docs/readme/gacha_system.md)          | Add loot boxes with weighted pools, pity counters, and guarantees.         |
| [Simulation: Building Timers (BETA)](/rundot-docs/readme/building_timers.md)    | Timed upgrades, build queues, and passive resource generation.             |
| [Sharing](/rundot-docs/readme/sharing.md)                                       | Share links, generate QR codes, and handle share parameters.               |
| [Leaderboards (BETA)](/rundot-docs/readme/leaderboard.md)                       | Competitive leaderboards with multiple security levels.                    |
| [Video (BETA)](/rundot-docs/readme/video.md)                                    | Hand off video playback to native Picture-in-Picture (iOS only).           |

### Device & Environment

| API                                               | What it does                                                    |
| ------------------------------------------------- | --------------------------------------------------------------- |
| [Safe Area](/rundot-docs/readme/safe_area.md)     | Read safe-area insets to avoid overlapping host UI and notches. |
| [Environment](/rundot-docs/readme/environment.md) | Detect device type, platform, screen size, and dev mode.        |

### AI

| API                             | What it does                                     |
| ------------------------------- | ------------------------------------------------ |
| [AI](/rundot-docs/readme/ai.md) | Generate text and images using hosted AI models. |

### Utility

| API                                                             | What it does                                                  |
| --------------------------------------------------------------- | ------------------------------------------------------------- |
| [Analytics](/rundot-docs/readme/analytics.md)                   | Record gameplay telemetry, funnel steps, and user properties. |
| [Context](/rundot-docs/readme/context.md)                       | Access launch parameters and share parameters.                |
| [Embedded Libraries](/rundot-docs/readme/embedded_libraries.md) | Load and manage embedded libraries shipped by the host.       |
| [Haptics](/rundot-docs/readme/haptics.md)                       | Trigger haptic feedback on supported devices.                 |
| [Lifecycles](/rundot-docs/readme/lifecycles.md)                 | React to host lifecycle changes (pause/resume/teardown).      |
| [Logging](/rundot-docs/readme/logging.md)                       | Stream structured logs for debugging and support.             |
| [Preloader](/rundot-docs/readme/preloader.md)                   | Control the native loading screen during heavy loads.         |
| [Profile](/rundot-docs/readme/profile.md)                       | Access the current user profile.                              |
| [Storage](/rundot-docs/readme/storage.md)                       | Persist player data at device, app, or global scope.          |
| [Time](/rundot-docs/readme/time.md)                             | Server time synchronization and formatting.                   |

***

New to RUN.game? See [Getting Started](/rundot-docs/readme/getting-started.md) | [Deploying Your Game](/rundot-docs/readme/deploying-your-game.md) | [Setting Your Game Thumbnail](/rundot-docs/readme/setting-your-game-thumbnail.md) | [Troubleshooting](/rundot-docs/readme/troubleshooting.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://series-1.gitbook.io/rundot-docs/readme.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
