Installing the SDK
Install the Koard Merchant SDK to enable tap-to-pay functionality in your iOS application.
If you're ready to start developing, see our Tap to Pay configuration guide.
What you learn
In this guide, you'll learn:
- How to add the Koard SDK with Swift Package Manager
- How to install the SDK manually as an XCFramework
- How to configure embed settings for proper functionality
- How to verify your installation is working correctly
Prerequisites
Before you begin, ensure you have:
- Xcode 16.3 or later (required for building and distribution)
- iOS 17.4+ deployment target (minimum supported version)
- Swift 5.9+ (minimum Swift toolchain)
- iPhone XS or greater (supported hardware for tap-to-pay)
- Valid Koard merchant account (configured in Koard MMS)
- Sandbox Apple Account signed in on test device (dedicated iPhone with Developer Mode enabled)
Current version: The latest published release is 1.0.21, adding optional transaction metadata, deinit(), and isInitialized. See Transaction Metadata and SDK Lifecycle and Deinitialization. See the SDK CHANGELOG for behavior changes: 1.0.20 changed how prepare() and linkAccountAsync() report failures, which affects existing integrations.
Test Device: Use a dedicated test iPhone with your Sandbox Apple Account signed in. Avoid mixing production Apple IDs on the same hardware to prevent authentication conflicts.
Step 1: Add the SDK
We recommend Swift Package Manager for most projects. If you cannot use SPM, install the SDK manually as an XCFramework instead.
Option A: Swift Package Manager (Recommended)
- In Xcode, choose File → Add Package Dependencies…
- Enter the package URL:
https://github.com/koardlabs/koard-ios.git - Set the dependency rule to "Up to Next Major Version" starting from
1.0.21 - Add the
KoardSDKlibrary product to your app target
You can also add it directly to a Package.swift:
.package(url: "https://github.com/koardlabs/koard-ios.git", from: "1.0.21")
Then list KoardSDK as a dependency of your target.
Option B: Manual XCFramework
- Download the latest
KoardSDK.xcframework.zipfrom the Releases page or get it directly from the team - Extract the ZIP file to reveal the
KoardSDK.xcframeworkbundle - Drag
KoardSDK.xcframeworkinto your Xcode project (or use your target's General → Frameworks, Libraries, and Embedded Content → "+" → Add Other… → Add Files…) - Ensure "Copy items if needed" is checked and the framework is added to your app target
Note: The XCFramework format ensures compatibility across different architectures (iOS Simulator, iOS Device) and simplifies distribution compared to traditional frameworks.
Option C: CocoaPods
The SDK ships a podspec (KoardSDK), which vendors the same KoardSDK.xcframework. Add it to your Podfile:
pod 'KoardSDK', :git => 'https://github.com/koardlabs/koard-ios.git', :tag => '1.0.21'
Then run pod install and open the generated .xcworkspace.
Step 2: Configure Linking
The released KoardSDK 1.0.21 XCFramework contains a static binary. For a manual install, add it under your target's Frameworks, Libraries, and Embedded Content and select Do Not Embed. Xcode links the archive into your app; it must not be copied into the app as a dynamic framework.
Swift Package Manager handles linking the binary target. Do not add a second manual copy when using the package.
Step 3: Verify Installation
Check Framework Integration
- Build your project (⌘+B) to ensure there are no compilation errors
- Verify the package or framework appears in your project navigator
- For a manual install, check the framework is listed under "Frameworks, Libraries, and Embedded Content"
Test Basic Import
Add this import statement to one of your Swift files to verify the SDK is accessible:
import KoardSDK
If the import succeeds without errors, your installation is working correctly.
Step 4: Initialize the SDK
Once the SDK is installed, initialize it early in your app lifecycle with your KoardOptions and API key:
import KoardSDK
// Configure SDK options
let options = KoardOptions(
environment: .uat, // .uat | .production | .custom(String)
loggingLevel: .debug // .none | .error | .warning | .debug | .verbose
)
// Initialize with your API key
KoardMerchantSDK.shared.initialize(options: options, apiKey: "your-koard-api-key")
For details on retrieving your key, see Retrieving Your API Key. For authentication and payments, see Running Payments.
If something on this page fails, see SDK Installation Issues on the Troubleshooting page.
Next Step
Continue to Running Payments to implement payments and response handling in your app. Reuse your existing merchant and location.
If you are running the demo for the first time, continue in the iOS Quickstart.

