iOS SDKs
The iOS SDK lives in ios-sdks, a Swift package publishing two products.
| Product | Purpose |
|---|---|
ThunderID | Core SDK: HTTP, token management, auth flows, PKCE, storage |
ThunderIDSwiftUI | SwiftUI component library built on the core |
Sources/ThunderID/ Core SDK (auth, token, http layers)
Sources/ThunderIDSwiftUI/ SwiftUI component library
Playground/ App for exercising the SDK from source
Tests/ Unit tests
Tests/e2e/ End-to-end suite
Commands
swift build
swift test
swiftlint lint --strict
The quickstart sample lives in quickstarts/ios in the samples repository and depends on the published SDK. To run it against your local changes, Tests/e2e/scripts/prepare-sample.sh fetches it into Tests/e2e/.quickstart and points it at your checkout; open Package.swift there in Xcode to run it on a simulator or device.
Playground
Playground/ is a SwiftUI app that uses the SDK from this checkout through a local package reference, so it always runs your changes. It has four tabs: capability checks for each SDK feature with a pass or fail reason, a component explorer with live controls and generated SwiftUI code, a session inspector for tokens and claims, and an SDK event log. Copy Sources/Config.plist.example to Sources/Config.plist, fill in your server URL and application, then open Playground.xcodeproj in Xcode and run the Playground scheme. The pull request builder builds it, so keep its checks and stories in step when you change a capability or a component.
Code Style
- Swift 5.9 or later, targeting iOS 16 and macOS 13 as a minimum.
- No third-party dependencies in
Sources/. OnlyFoundation,CryptoKit, andSwiftUI. - Prefer
async/throwsover completion handlers. - Mark internal helpers
privateand expose only intentional API aspublic.
swiftlint lint --strict gates CI, and every violation fails the build. The rules that catch people most often are a 120-character line limit, alphabetically sorted imports, } else { on one line, trailing closure syntax, and identifiers of at least three characters. Run it locally before opening a pull request.
Vendor Naming
The SDK is white-labelable: a consuming app overrides the brand namespace through ThunderIDConfig.vendor. Do not hardcode thunderid in a runtime name that override should control, such as a Keychain service name or a log tag. Resolve it from config.vendor instead.
An entry point whose purpose is to represent the SDK itself, such as ThunderIDClient, is a fixed identity and keeps the name.