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

# Status & lifecycle

> Observe the MusterBox SDK status machine and diagnostics.

The SDK exposes an explicit, observable status machine.

## Status values

| Status          | Meaning                            |
| --------------- | ---------------------------------- |
| `Uninitialized` | No config accepted yet             |
| `Stopped`       | Initialized; no workers running    |
| `Running`       | Workers running; not authenticated |
| `Authenticated` | Valid session active               |

Read the current status programmatically:

```rust theme={"dark"}
use musterbox_sdk::status::SdkStatus;
let status = sdk.get_status();
match status {
  SdkStatus::Authenticated { .. } => { /* session active */ }
  _ => { /* not ready */ }
}
```

Browser:

```ts theme={"dark"}
const status = box.getStatus(); // { state: "authenticated", ... }
```

## What each transition means

| Transition                | Trigger                    |
| ------------------------- | -------------------------- |
| `Uninitialized → Stopped` | `initialize(config)`       |
| `Stopped → Running`       | `start()`                  |
| `Running → Authenticated` | `authenticate(...)`        |
| `Authenticated → Running` | `logout` (session revoked) |
| `Running → Stopped`       | `shutdown()`               |
| `Authenticated → Stopped` | `shutdown()`               |

## Diagnostics

Diagnostics give you the data you need to report a support issue:

| Capability        | Native                                 | Browser                |
| ----------------- | -------------------------------------- | ---------------------- |
| Health checks     | `musterbox diagnostics health`         | `box.getDiagnostics()` |
| Diagnostic bundle | `musterbox diagnostics generate`       | –                      |
| Corrupted storage | `musterbox storage verify` / `recover` | –                      |

<Tip>Include the diagnostic bundle when filing a support ticket. See [Support](/resources/support).</Tip>

## Session status

`get_session_status()` distinguishes the SDKSide session state from the
backend one (pending validation, active, expired). Use it to drive UI states
instead of guessing from player context alone.

Next: [Secure purchases](/sdk/purchases).
