> ## 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.

# Bevy

> Integrate the MusterBox SDK into a Bevy application.

The Bevy adapter is a Rust plugin (`musterbox-bevy`) built on the same crate
family as the core SDK, targeting **Bevy 0.19**.

## Add the dependency

Until crates.io publication, point Cargo at the packaged crate:

```bash theme={"dark"}
# dist/bevy/musterbox-bevy-1.0.0.tar.gz
cargo add musterbox-bevy --path ./vendor/musterbox-bevy
```

## Register the plugin

```rust theme={"dark"}
use bevy::prelude::*;
use musterbox_bevy::MusterBoxPlugin;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugin(MusterBoxPlugin::default())
        .add_systems(Update, tick_sdk)
        .run();
}

fn tick_sdk(musterbox: Res<MusterBox>) {
    musterbox.tick();
}
```

## Drive the flow from systems

```rust theme={"dark"}
fn on_ready(musterbox: Res<MusterBox>) {
    if let Ok(ctx) = musterbox.authenticate("player@example.com", "secret") {
        info!("authenticated: {:?}", ctx.credentials.session_id);
    }
}
```

The plugin exposes the core `MusterBoxSdk` surface (config, lifecycle,
session, events, purchases) as an ECS resource so systems observe a single
source of truth per app.

## Support matrix

| Bevy | SDK   | Crate            |
| ---- | ----- | ---------------- |
| 0.19 | 1.0.0 | `musterbox-bevy` |

Next: [Cocos Creator](/engines/cocos).
