iOS quickstart
- 1
Add the package
swiftdependencies: [ .package(url: "https://github.com/neetixai/liveliness-sdks.git", from: "0.2.0") ]Or in Xcode: File ▸ Add Package Dependencies with the same URL.
- 2
Get a test key
bashcurl -X POST https://liveliness.neetix.in/v1/signup \ -H 'Content-Type: application/json' \ -d '{"email":"you@company.com"}'Do not ship a key in the app binaryAnything compiled into an iOS app can be extracted from it. Use a test key while building, and for production either mint short-lived keys from your own backend or use hosted verification links. App Attest (
NeetixAttestation) is what proves the call came from your real app. - 3
Make the call
swiftimport NeetixLiveliness let nx = NeetixClient(apiKey: "YOUR_KEY") let selfie = try Data(contentsOf: selfieURL) let card = try Data(contentsOf: idURL) let res = try await nx.faceMatch( person: .jpeg(selfie), card: .jpeg(card), clientRefId: "application-4821" ) print(res.verdict) // "approved" | "review" | "declined" print(res.result.isSameFace) print(res.warnings.map(\.code))verdictis aString, not an enum — compare it as one.warningsis a list ofApiWarningwithcode,severityanddescription.No key yet? The client can mint one without auth:
swiftlet s = try await NeetixClient().signup(email: "you@company.com") // s.apiKey is shown once — 1,000 free credits - 4
Use the guided capture view
NeetixCaptureViewis a full-screen SwiftUI capture flow: AVFoundation preview, an oval face guide or an ID-1 card guide, live brightness and motion-stability hints, auto-capture after 1.5 s of stable good frames with a countdown ring, a manual shutter fallback, and a retake/confirm step.Output is already normalised JPEG — longest side ≤ 1280 px, quality 0.8 — so it uploads as-is with no resizing step of your own.
swiftimport SwiftUI import NeetixLiveliness struct SelfieKycScreen: View { let nx = NeetixClient(apiKey: "YOUR_KEY") @State private var verdict: String? var body: some View { NeetixCaptureView(mode: .selfie) { jpeg in Task { let res = try await nx.liveness(person: .jpeg(jpeg)) verdict = res.status } } } }Use
mode: .documentfor the ID side — it switches to the back camera and the card guide.
Why guided capture matters
The engine rejects frames that are blurry, too dark, mis-aligned or have the
eyes closed. Without on-device guidance, the user finds out only after a
network round-trip and then has to retry blind. NeetixCaptureView runs those
checks against the live preview, so a bad frame is never submitted in the first
place — fewer retries, and fewer genuine users who give up.
Next
- Get started — verdicts, warnings and credits.
- REST API — what the client is calling underneath.