# Get Started with the SmartSpectra C++ SDK (https://smartspectra.presagetech.com/docs/cpp)

> For the complete documentation index, see [llms.txt](https://smartspectra.presagetech.com/llms.txt). Any documentation page is available as markdown by appending `.md` to its URL.

# SmartSpectra C++ SDK

Cross-platform C++ SDK for measuring vitals and waveform shapes (pulse,
breathing, relative arterial pressure, and more) from a camera. Headless by
default with optional preview frames; runs on Linux, macOS, and Windows.

## Supported Platforms

| Platform | Status | Notes |
| --- | --- | --- |
| Ubuntu 22.04 / Mint 21 (amd64) | Experimental | Debian package available |
| Ubuntu 22.04 / Mint 21 (arm64) | Experimental | Debian package available |
| Ubuntu 24.04 / Mint 22 (amd64) | Experimental | Debian package available via `packages.presagetech.com` apt channel |
| Ubuntu 24.04 / Mint 22 (arm64) | Experimental | Debian package available via `packages.presagetech.com` apt channel |
| macOS Apple Silicon (14.0+) | Supported | Homebrew package available |
| Windows 10 / 11 (x64) | Experimental | ZIP distribution available |
| macOS Intel | Not supported | — |
| Debian 13 / Trixie (amd64) | Experimental | Debian package available |
| Debian 13 / Trixie (arm64) | Experimental | Debian package available |
| Debian 12 | Not supported | — |
| RHEL 9 / Fedora 41 | Not supported | — |

For platforms marked "Not supported" or anything not listed above, contact
[support@presagetech.com](mailto:support@presagetech.com) if you have a
specific need.

## Camera selection

On Linux, macOS, and Windows, discover cameras with `SmartSpectra::AvailableCameras(cameras)` and
choose one with `spectra.UseCamera(CameraSelection::ById(camera.id)).Build()`.
`Default()`, `Front()`, and `Back()` express a camera preference or requirement.
Discovery also exists in the native C++ API on iOS. See the
[camera selection migration notes](https://smartspectra.presagetech.com/docs/cpp/migration-guide.md#explicit-camera-selection)
for platform support, errors, and a complete example.

## Common Prerequisites

All platforms need:

- **CMake 3.22.1+**
- **C++20 compiler** (GCC, Clang, or MSVC 2022)
- An **API key** from [physiology.presagetech.com](https://physiology.presagetech.com/auth/login) —
  an AI assistant connected to the [SmartSpectra MCP Server](https://smartspectra.presagetech.com/docs/mcp-server.md) can fetch it
  from your account for you

The SDK package is self-contained — you do not need to install protobuf, curl,
or OpenSSL separately on any platform.

## Pick your platform

Each guide is self-contained: prerequisites → install → first running build.

> **Start with a full runnable sample:** choose the quickstart for your
> platform below. Each guide includes a complete `hello_vitals.cpp` and
> `CMakeLists.txt`.

- [**Linux Quickstart (Debian/Ubuntu/Mint)**](https://smartspectra.presagetech.com/docs/cpp/linux.md) — apt-based install for Debian 13 / Trixie, Ubuntu 22.04 / Mint 21, and Ubuntu 24.04 / Mint 22 (`amd64` + `arm64`)
- [**macOS Quickstart**](https://smartspectra.presagetech.com/docs/cpp/macos.md) — Homebrew formula, Apple Silicon
- [**Windows Quickstart**](https://smartspectra.presagetech.com/docs/cpp/windows.md) — prebuilt ZIP from GitHub Releases

## Scope

The quickstarts intentionally request only the breathing and cardio metric
bundles, which is enough to see live values on the console. See the
[C++ API reference](https://smartspectra.presagetech.com/docs/cpp/api-reference.md) for
the full `requested_metrics` catalog and custom-input pipeline.

If you need to redistribute a Linux desktop app without requiring end users to
configure the Presage apt source, see
[Redistribute SmartSpectra on Linux](https://smartspectra.presagetech.com/docs/redistribute_smartspectra_on_linux.md).

## Going further

Once your first build runs:

- [Configure which metrics to compute](https://smartspectra.presagetech.com/docs/cpp/metrics.md)
- [Headless mode](https://smartspectra.presagetech.com/docs/cpp/headless-mode.md) — C++ is headless by default; see the guide for video output callbacks
- [Redistribute SmartSpectra on Linux](https://smartspectra.presagetech.com/docs/redistribute_smartspectra_on_linux.md) — bundle the published Linux SDK tarball into your own `.deb`
- [Migration guide](https://smartspectra.presagetech.com/docs/cpp/migration-guide.md) — upgrading from v1.x or v2.x
- [API reference](https://smartspectra.presagetech.com/docs/cpp/api-reference.md)
- [LLM Insights](https://smartspectra.presagetech.com/docs/cpp/llm-insights.md) — natural-language analysis of the measured vitals from an LLM, on request

## Logging

SDK log verbosity defaults to warnings and errors only. To change it, set
`log_level` on the config before constructing `SmartSpectra`:

```cpp
SmartSpectraConfig config;
config.api_key = "...";
config.log_level = presage::smartspectra::SmartSpectraLogLevel::kInfo;
SmartSpectra spectra(config);
```

Levels are cumulative — `kDebug`, `kInfo`, `kWarning` (default), `kError`,
`kNone`. `kDebug` also enables verbose diagnostics where they exist, but it
cannot restore debug-only statements compiled out of release binaries. A
`GLOG_minloglevel` environment variable always takes precedence — when it is
set, the SDK leaves logging untouched.

## Bugs & Troubleshooting

- Each platform quickstart above ends with a Troubleshooting section covering platform-specific install, signing, and runtime issues.
- For additional support, contact [support@presagetech.com](mailto:support@presagetech.com) or [submit a GitHub issue](https://github.com/Presage-Security/SmartSpectra/issues).