> ## Documentation Index
> Fetch the complete documentation index at: https://docs.musterbox.org/llms.txt
> Use this file to discover all available pages before exploring further.

# SDK overview

> The MusterBox SDK surface — one Rust core, many packaging targets.

The MusterBox SDK is a Rust core library (version 1.0.0) that is packaged for
every supported engine and the browser. Its job is to be a reliable, secure
**bridge** between your game and the MusterBox backend — never a source of
authority.

## What the SDK does

* **Configures and validates** your integration (config schema 1) before any
  traffic leaves the device.
* **Manages the session lifecycle**: initialize → start → authenticate →
  refresh → logout → shutdown.
* **Flushes events** in batches over the event plane with offline buffering.
* **Polls realtime events** — session, wallet, and status events.
* **Drives secure purchases** through `PurchaseClient` with an on-device
  environment-integrity pre-flight.
* **Reports diagnostics** and environment health.

## Public surfaces by language

| Surface       | Entry point                   | Notes                             |
| ------------- | ----------------------------- | --------------------------------- |
| Rust          | `MusterBoxSdk`                | Native core, blocking + async     |
| C ABI         | `musterbox_ffi.h` (ABI 1.2.0) | 23 exported symbols, memory rules |
| WebAssembly   | `@musterbox/sdk-wasm`         | Compiled core for the browser     |
| TypeScript/JS | `@musterbox/sdk-js`           | camelCase wrapper over `sdk-wasm` |
| Godot         | `musterbox-godot`             | GDExtension, NativeScript API     |
| Unity         | `MusterBox` C# wrapper        | `MusterBoxSdk.Instance` singleton |
| Bevy          | Rust plugin                   | Same crate family as the core     |
| Unreal        | `MusterBox` plugin            | Blueprint/C++ module              |
| Cocos/Defold  | TypeScript / Lua bindings     | See engine pages                  |

## Core concepts used everywhere

* **Config** — validated `MusterBoxConfig`; invalid config fails fast with
  `InvalidConfig` before networking begins.
* **Runtime options** — `Manual` (you call `tick`) or `Threaded` (background
  worker) with a `TickBudget`.
* **Status** — an explicit lifecycle machine you can observe via
  `get_status`.
* **Errors** — `SdkError` with stable `SdkErrorCode`s (MBX-SDK-001 … 013).

## Start here

* [Installation](/sdk/installation)
* [Configuration](/sdk/configuration)
* [Initialization & lifecycle](/sdk/initialization)
* [Authentication](/sdk/authentication)
* [Sessions](/sdk/sessions)
* [Events & realtime](/sdk/events)
* [Secure purchases](/sdk/purchases)
* [Security & integrity](/sdk/security)
* [Errors](/sdk/errors)
* [CLI](/sdk/cli)
