# `openapp-sdk` (Rust)
Official Rust SDK for **OpenApp — Physical Security as a Service (PSaaS)**:
access control, intercom, invitations, and entity actions over the public HTTP API.
- Docs: [openapp.house/docs/sdk/rust](https://openapp.house/docs/sdk/rust/)
- OpenAPI: [openapp-openapi.json](https://openapp.house/docs/api-spec/openapp-openapi.json)
## Installation
Add from [crates.io](https://crates.io/crates/openapp-sdk):
```toml
[dependencies]
openapp-sdk = "0.1"
```
Pin the version to the latest release on crates.io.
## Requirements
- Rust stable (currently 1.95.x; MSRV declared in `Cargo.toml`)
- OpenApp API key
## Quick start
```rust
use openapp_sdk::Client;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::builder()
.api_key(std::env::var("OPENAPP_API_KEY")?)
.build()?;
let orgs = client.orgs().list().await?;
println!("{orgs:?}");
Ok(())
}
```
## Error handling
```rust
use openapp_sdk::{Client, SdkError};
async fn list_orgs(api_key: String) {
let client = match Client::builder().api_key(api_key).build() {
Ok(c) => c,
Err(err) => {
eprintln!("config/auth error: {err}");
return;
}
};
match client.orgs().list().await {
Ok(orgs) => println!("{orgs:?}"),
Err(SdkError::Auth(msg)) => eprintln!("auth error: {msg}"),
Err(SdkError::Api(api)) => eprintln!("api error: {} {}", api.status, api.message),
Err(other) => eprintln!("transport/sdk error: {other}"),
}
}
```
## Documentation
- [SDK overview](https://openapp.house/docs/sdk/)
- [API reference](https://openapp.house/docs/api-reference/)
- [AI index (llms.txt)](https://openapp.house/llms.txt)