> For the complete documentation index, see [llms.txt](https://series-1.gitbook.io/rundot-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://series-1.gitbook.io/rundot-docs/readme.md).

# 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.requestTimeAsync()
```

## API Reference

### Monetization

| API                                                 | What it does                                                   |
| --------------------------------------------------- | -------------------------------------------------------------- |
| [Ad Monetization](/rundot-docs/readme/ads.md)       | Serve rewarded video and interstitial ads to earn revenue.     |
| [Purchases](/rundot-docs/readme/purchases.md)       | Let players spend RunBucks on digital goods.                   |
| [Shop](/rundot-docs/readme/shop.md)                 | List shop items and run the purchase flow for digital goods.   |
| [Entitlements](/rundot-docs/readme/entitlements.md) | Track and consume what players own (items, passes, power-ups). |

### 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](/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                                                                      |
| ----------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| [Runtime Environment](/rundot-docs/readme/runtime-environment.md) | Storage scopes, the network allowlist, and device features the platform provides. |
| [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.     |
| [Attribution](/rundot-docs/readme/attribution.md)               | Read the web campaign and UTM parameters the player arrived with. |
| [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) | [Testing Locally With Playground](/rundot-docs/readme/playground.md) | [Deploying Your Game](/rundot-docs/readme/deploying-your-game.md) | [rundot CLI Reference](/rundot-docs/readme/cli-reference.md) | [Marketing Your Game (BETA)](/rundot-docs/readme/marketing-your-game.md) | [Runtime Environment](/rundot-docs/readme/runtime-environment.md) | [Setting Your Game Thumbnail](/rundot-docs/readme/setting-your-game-thumbnail.md) | [Troubleshooting](/rundot-docs/readme/troubleshooting.md)
