Skip to content

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-swift

For the beta, pin the dependency to 0.1.0-beta.1.

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")
  • Swift 5.9+
  • iOS 15+
  • macOS 12+
  • tvOS 15+
  • watchOS 8+
  • visionOS 1+
import Auralog
import SwiftUI
@main
struct MyApp: App {
init() {
try? Auralog.initialize(
apiKey: "aura_your_api_key",
environment: "production",
captureMetricKit: true,
captureUnhandledExceptions: true
)
}
var body: some Scene {
WindowGroup {
RootView()
}
}
}

The SDK repository includes a runnable SwiftUI example:

Terminal window
AURALOG_API_KEY=aura_your_api_key swift run --package-path Examples/SwiftUIExample