Installation
The Swift SDK is distributed as a Swift Package.
In Xcode, choose File → Add Package Dependencies… and enter:
https://github.com/auralog-ai/auralog-swiftFor the beta, pin the dependency to 0.1.0-beta.1.
Package.swift
Section titled “Package.swift”dependencies: [ .package(url: "https://github.com/auralog-ai/auralog-swift.git", exact: "0.1.0-beta.1")]Add the core product to your app target:
.product(name: "Auralog", package: "auralog-swift")If you use Apple’s swift-log, also add:
.product(name: "AuralogSwiftLog", package: "auralog-swift")Requirements
Section titled “Requirements”- Swift 5.9+
- iOS 15+
- macOS 12+
- tvOS 15+
- watchOS 8+
- visionOS 1+
Initialize in SwiftUI
Section titled “Initialize in SwiftUI”import Auralogimport SwiftUI
@mainstruct MyApp: App { init() { try? Auralog.initialize( apiKey: "aura_your_api_key", environment: "production", captureMetricKit: true, captureUnhandledExceptions: true ) }
var body: some Scene { WindowGroup { RootView() } }}Example app
Section titled “Example app”The SDK repository includes a runnable SwiftUI example:
AURALOG_API_KEY=aura_your_api_key swift run --package-path Examples/SwiftUIExample