DocsSmartSpectra
Browse documentation
iOS / Swift

Swift Quick Start

View MarkdownView source

This repo contains two build guides that produce similar user end states:

The only difference in builds is that the API key build gets up and running very fast, but hard-codes your API key. The OAuth build is more suitable for production deployments because it avoids hard-coding your API key.

Scope

These quickstarts intentionally request only:

  • SmartSpectraConfig.breathingMetrics
  • SmartSpectraConfig.cardioMetrics
  • MetricType.expressions

Please see the detailed documents for additional features.

To supply frames from your own camera or video decoder, use useCustomInput(). The SDK also supports its default camera capture through start(). The demo app’s Video Testing sample decodes a selected clip and submits frames through this public API.

Important Implementation Rules

Start by creating a new iOS app project named Cool Vitals.

The Quick Start is intended so that the developer can replace Cool Vitals/ContentView.swift as a full file.

  • Import SwiftUI, SmartSpectra, and AVFoundation.
  • Use let sdk = SmartSpectraSDK.shared.
  • Buffer pulse, breathing, arterial pressure, chest, and abdomen samples locally before drawing charts.

Logging

SDK log verbosity defaults to warnings and errors only. To change it, set logLevel on the SDK config:

SmartSpectraSDK.shared.config.logLevel = .info

Levels are cumulative — .debug, .info, .warning (default), .error, .none. .debug cannot restore debug-only statements compiled out of the release engine binary.

Choose Your Guide

Use Option 1: API Key for the fastest manual setup.

Use Option 2: OAuth if you need OAuth.

Either way, an AI assistant connected to the SmartSpectra MCP Server can do the account side for you — fetch your API key, or register your bundle ID and Apple team ID and download PresageService-Info.plist.

LLM Insights

See LLM Insights for natural-language analysis of the measured vitals.

Search quick starts, measurements, and API references.