Skip to main content
AlphaSDK is the official Swift client for the Alpha Camera REST API. It uses URLSession only (zero third-party dependencies) and exposes Swift concurrency throughout.

Install

Add to your Package.swift dependencies:
Then add AlphaSDK to your target’s dependencies:
In Xcode: File → Add Package Dependencies…, paste the URL, choose from 0.3.1. You also need a server reachable from the device. The Swift client does not ship a ServerManager class — start the server using the Node-based CLI from the server package, or, on macOS, spawn the bundled binary from your application using Process (recipe). iOS applications typically connect over the local network to a server running on a Mac, Raspberry Pi, or similar host.

Initialize

Constructor options

AlphaSDKClient is Sendable and safe to share across actors.

Common operations

List + connect a camera

Read a single property

Read every property at once

Set a property

Trigger the shutter

Pull a single live-view JPEG

For OSD-overlaid frames after try await client.liveView.enableOsd(cameraId: cameraId):
See the live-view polling recipe for a render loop.

Disconnect


Error handling

Every method throws AlphaSDKError, an enum with cases for transport failures and HTTP responses. Pattern-match the case (or, for HTTP responses, classify with HTTPError.kind):
HTTPError exposes statusCode, parsed body (with message / code / type), and kind (.notFound, .validation, .client, .server, …). All other failure modes are dedicated cases on AlphaSDKError itself (.timeout, .networkError, .decodingError, …).

Advanced

Custom request headers per call

Cancellation

Swift’s structured concurrency does the right thing — wrap the call in a Task and cancel:

Bring your own URLSession

Useful for proxying, intercepting, or testing:

What’s NOT in the client

By design, the following live in recipes rather than the generated SDK:

Versioning

AlphaSDK follows SemVer. Every release is git-tagged on the SwiftPM repository — see the CHANGELOG there for release notes.