Install

Install on iOS

Add the Sankofa iOS SDK to your Xcode project via Swift Package Manager or CocoaPods, with first-class Swift and Objective-C support.

The Sankofa iOS SDK is a native Swift library with Objective-C interop. It includes six Sankofa products (Analytics, Catch, Switch, Config, Pulse, Replay) and uses GRDB for thread-safe SQLite-backed offline queueing. Apple Privacy Manifest support is built in.

OTA Deploy is not exposed on iOS — for hybrid apps that need OTA, use the React Native SDK.

Requirements

  • Xcode 15+ (Swift 5.9+)
  • iOS 13+ deployment target
  • Privacy Manifest support (Apple 2024 requirement) — bundled with the SDK

1. Add the SDK

In Xcode:

  1. Open File → Add Package Dependencies…
  2. Enter the URL: https://github.com/sankofa-hq/sankofa-ios
  3. Pick Up to Next Major Version from 0.1.0.
  4. Add the SankofaIOS library to your app target.

Or pin in Package.swift:

SwiftPackage.swift
.package(url: "https://github.com/sankofa-hq/sankofa-ios.git", from: "0.1.0")

2. Initialize at app launch

Initialize early — in @main's init() or application(_:didFinishLaunchingWithOptions:) — so device metadata flows into every event from the first frame.

SwiftApp.swift
import SwiftUI
import SankofaIOS

@main
struct YourApp: App {
  init() {
      Sankofa.shared.initialize(
          apiKey: ProcessInfo.processInfo.environment["SANKOFA_KEY"] ?? "",
          config: SankofaConfig(
              endpoint: "https://api.sankofa.dev",
              recordSessions: true,
              maskAllInputs: true
          )
      )
  }

  var body: some Scene {
      WindowGroup { ContentView() }
  }
}

Common config options

endpointStringdefault https://api.sankofa.dev
Server base URL.
recordSessionsBooldefault true
Enable session replay (screenshot mode).
maskAllInputsBooldefault true
Automatically mask all UITextField/UITextView views in replays.
debugBooldefault false
Verbose console logging during development.
trackLifecycleEventsBooldefault true
Auto-track $app_opened, foreground/background.
flushIntervalSecondsTimeIntervaldefault 30
How often the queued events are uploaded while the app is foregrounded.
batchSizeIntdefault 50
Maximum events per upload batch.
captureScaleCGFloatdefault 0.35
Replay screenshot resolution. Lower = smaller files.

3. Verify the install

Swift
Sankofa.shared.track("install_check", properties: ["from": "ios-quickstart"])

Build and run in the simulator or on a device. Open app.sankofa.devLive events — the event should appear with an ios source label within a few seconds.

What's next

Edit this page on GitHub