This repository provides a Swift Package Manager (SPM) mirror for the ThreatMetrix iOS SDK (version 7.7.93).
The official ThreatMetrix SDK is distributed as pre-compiled binary frameworks (.xcframework
), but the vendor does not currently offer an official SPM distribution. This mirror package wraps these binaries, making it easy to integrate and manage ThreatMetrix as a standard SPM dependency in Xcode projects.
- Modern Dependency Management: To allow our projects to use Swift Package Manager exclusively, avoiding the need for manual framework management, CocoaPods, or Carthage for this specific dependency.
- Consistency: Ensures all teams use the same version and configuration of the ThreatMetrix SDK.
- Simplified Integration: Drastically simplifies the setup process for new projects or new developers.
You can add ThreatMetrix to your project as a Swift Package dependency in Xcode.
- In Xcode, open your project and navigate to File > Add Packages...
- In the search bar, paste the repository URL:
https://github.com/hyperdevs-team/threadmetrix-spm-mirror.git
- For Dependency Rule, select Up to Next Major Version and enter
7.7.93
. - Click Add Package.
- Choose the products to add to your app's target.
This package offers two ways to add the frameworks, giving you flexibility based on your needs.
For most use cases, simply add the ThreatMetrixKit
product to your target. This single library automatically includes and links all the necessary ThreatMetrix frameworks.
ThreatMetrixKit
This is the simplest and safest way to ensure all dependencies are correctly linked.
If you need to optimize your app's binary size and only require specific modules, you can add them individually. The package manifest handles the internal dependencies between them (e.g., adding TMXProfilingConnections
will automatically include the base TMXProfiling
framework).
TMXProfiling
(Core framework)TMXProfilingConnections
TMXSensors
TMXBehavioSec
TMXAuthentication
Example: If your app only needs profiling and connections, you would add the TMXProfilingConnections
product to your target. SPM will resolve and link both TMXProfilingConnections.xcframework
and its required dependency, TMXProfiling.xcframework
.
To update to a new version of the ThreatMetrix SDK:
- Replace the
.xcframework
files in theFrameworks/
directory with the new ones. - Update the version number and any necessary product/target definitions in
Package.swift
. - Commit the changes.
- Create a new Git tag that matches the new SDK version (e.g.,
git tag 7.8.0
). - Push the commit and the new tag to the remote repository (
git push && git push --tags
).