# Installation

## Add to Cargo.toml

```toml
[dependencies]
akira-billing = "0.3"
```

Rust 2021 edition; MSRV 1.75.

## Features

| Feature | Default | Pulls | Use when |
|---------|---------|-------|----------|
| `tokio` | yes | `tokio` (full runtime, multi-thread) | Default — Tokio runtime for async calls |
| `loopback` | no | `loopback` server + `desktop` + `url` | Desktop apps that need browser-based OAuth |
| `desktop` | no | `keyring`, `machine-uid`, `aes-gcm` | Desktop apps that need OS keychain + token cipher + device fingerprint |

Default features pull only `tokio`. Pick `loopback` or `desktop` explicitly for desktop builds:

```toml
[dependencies.akira-billing]
version = "0.3"
features = ["desktop", "loopback"]
```

Disable defaults if you ship your own runtime (e.g. `smol`, `async-std`, or an `embassy` build):

```toml
[dependencies.akira-billing]
version = "0.3"
default-features = false
features = []
```

`reqwest` is wired with `rustls-tls` (no OpenSSL dependency) and `json` features. The crate has no `cargo` features for switching to native-tls — file an issue if you need it.

## Workspace usage

```toml
[workspace.dependencies]
akira-billing = { version = "0.3", features = ["desktop"] }

[dependencies]
akira-billing = { workspace = true }
```

## Optional dependencies

The `desktop` feature pulls optional crates that may need additional system libraries:

- **`keyring`** — uses Secret Service on Linux (libsecret), Keychain on macOS, Credential Manager on Windows. On Linux CI runners, install `libsecret-1-dev` or run a headless secret service (`gnome-keyring-daemon`).
- **`machine-uid`** — reads the per-machine identifier (no extra system libs).
- **`aes-gcm`** — pure Rust, no system libs.

## Verify

```bash
cargo build --features "loopback,desktop"
cargo test
```

`cargo test` runs the unit suite + signature fixtures (`tests/fixtures/signature-vectors.json`) shared with the Go SDK.

---

Navigation: [← Index](00-index.md) · **Installation** · [Quickstart →](02-quickstart.md)
