iOS
Native iOS integration for the Surt Guardian SDK, distributed via Swift Package Manager. The SDK collects device signals, performs platform-native attestation via App Attest, and returns the backend's risk decision.
The SDK never holds a Surt API key. Your backend holds the sp_live_* key (server-side only) and exchanges it for a short-lived JWT that the app passes to verify().
Version
This guide covers SDK v0.3.0, which also fixes VPN detection.
Requirements
- iOS 14.0+
- Xcode 14+
- Swift 5.7+
1. Authentication
Add your access token to ~/.netrc so Xcode can clone the private repository:
~/.netrc
machine github.com
login surt-customer
password <YOUR_TOKEN>
Replace <YOUR_TOKEN> with the token provided by Surt.
tip
If ~/.netrc doesn't exist, create it. Make sure it has restricted permissions:
chmod 600 ~/.netrc
2. Add the Package
- In Xcode, go to File > Add Package Dependencies
- Enter the repository URL:
https://github.com/surtTech/surt-guardian-sdk - Set the version rule to "Up to Next Minor" from 0.3.0
- Click Add Package
- Select the SurtGuardianSDK library and add it to your target