Skip to main content

1. Create an account

Sign up at grantiva.io/get-started with email, GitHub, or Google. Then add your first app from the dashboard — you’ll need your Apple Team ID and Bundle ID.

2. Add the SDK

Add the Grantiva Swift package to your Xcode project:
https://github.com/grantiva/sdk
Or add it to your Package.swift:
dependencies: [
    .package(url: "https://github.com/grantiva/sdk", from: "1.0.0")
]
Then add Grantiva to your target dependencies.
Requires iOS 18+ / macOS 15+ and Swift 6.0+. The SDK has zero external dependencies.

3. Initialize Grantiva

import Grantiva

let grantiva = Grantiva(teamId: "YOUR_TEAM_ID")
That’s it. The SDK reads your Bundle ID automatically from Bundle.main.

4. Attest the device

do {
    let result = try await grantiva.validateAttestation()
    print("Device verified: \(result.isValid)")
    print("Risk score: \(result.deviceIntelligence.riskScore)")
    // Send result.token to your backend as a Bearer token
} catch {
    print("Attestation failed: \(error)")
}
The returned JWT token contains device intelligence, risk score, and any custom claims you’ve configured in the dashboard.

5. Verify on your backend

Include the token in API requests from your app:
var request = URLRequest(url: apiURL)
request.setValue("Bearer \(result.token)", forHTTPHeaderField: "Authorization")
Your backend can decode the JWT to read device intelligence and make trust decisions.

Next steps

App Attest is not available in the iOS simulator. Always test attestation on a real device. For simulator development, initialize with an API key: Grantiva(teamId: "...", apiKey: "your-dev-key").