> ## Documentation Index
> Fetch the complete documentation index at: https://docs.deepidv.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Run a complete ID and face verification in an iOS app: create a session on your backend, proxy the SDK's requests, present DeepIDVWorkflowView, and receive the decision by webhook.

This guide takes you from an empty app to a verification your backend can act on. You need:

* A workflow built in the [Admin Console](https://app.deepidv.com) with an **ID verification** step and, optionally, a **face liveness** step. Copy its workflow ID.
* An API key from [API authentication](https://docs.deepidv.com/authentication.md). It stays on your backend.
* An iPhone or iPad running iOS 15 or later. The camera doesn't work in the iOS Simulator.

**1. Add the SDK**

In Xcode, choose **File > Add Package Dependencies…**, enter `https://github.com/Deep-Identity-Inc/deepidv-sdk-swift`, and add the **DeepIDV** library to your app. Details: [Installation](https://docs.deepidv.com/integrate/sdks/ios/installation.md).

**2. Declare camera access**

Add `NSCameraUsageDescription` to your app's `Info.plist`:

```xml theme={null}
<key>NSCameraUsageDescription</key>
<string>Used to scan your ID and take a selfie to verify your identity.</string>
```

**3. Create the session on your backend**

When a user starts verification, your backend creates a workflow session and returns its ID to the app. Remember which user it belongs to.

```javascript Node.js theme={null}
app.post("/verification/start", requireUser, async (req, res) => {
  const response = await fetch(
    `https://api.deepidv.com/v1/workflows/${process.env.DEEPIDV_WORKFLOW_ID}/sessions`,
    {
      method: "POST",
      headers: {
        "x-api-key": process.env.DEEPIDV_API_KEY,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        email: req.user.email,
        first_name: req.user.firstName,
        last_name: req.user.lastName,
        external_id: req.user.id,
      }),
    }
  );
  const { session_id } = await response.json();
  await db.verificationSessions.insert({ sessionId: session_id, userId: req.user.id });
  res.json({ sessionId: session_id });
});
```

**4. Proxy the SDK's requests**

The SDK calls the deepidv API for the session it runs. Point it at your backend, which checks the user and adds your API key. Copy the proxy from [Proxy mode](https://docs.deepidv.com/integrate/sdks/ios/proxy-mode.md).

> [!WARNING]
>
> Don't put your deepidv API key in the app. Anything shipped in an app can be extracted from it.

**5. Present the workflow**

Create one client, pointed at your proxy, and present `DeepIDVWorkflowView` with the session ID.

```swift theme={null}
import DeepIDV
import SwiftUI

struct VerifyButton: View {
    let client: DeepIDVClient          // created once, see below
    let sessionID: String              // from your backend
    @State private var isVerifying = false

    var body: some View {
        Button("Verify your identity") { isVerifying = true }
            .fullScreenCover(isPresented: $isVerifying) {
                DeepIDVWorkflowView(client: client, sessionID: sessionID) { result in
                    isVerifying = false
                    switch result {
                    case .success(let run):
                        // The user finished. The decision goes to your backend.
                        print("finished with status", run.sessionStatus.rawValue)
                    case .failure(let error):
                        if error.kind == .cancelled { return }
                        print("verification error:", error.kind)
                    }
                }
            }
    }
}

// Once, for example in your app's environment:
let client = DeepIDVClient(config: DeepIDVConfig(
    apiKey: userToken,  // your app's own sign-in token; your proxy swaps it for the deepidv key
    baseURL: URL(string: "https://api.example.com/deepidv")!
))
```

The view runs every step in the workflow, shows retries when a photo can't be used, and ends on a short thank-you screen before `onResult` fires.

**6. Receive the decision**

Subscribe to the `session.status.verified` and `session.status.rejected` [webhooks](https://docs.deepidv.com/webhooks/overview.md), or read the session with [Retrieve session](https://docs.deepidv.com/api-reference/sessions/retrieve-session.md). Grant access from there, not from `onResult`. See [Results and the decision](https://docs.deepidv.com/integrate/sdks/ios/workflows/results.md).

![Animation: an empty capture frame, the card recognized as a driver's license, the frame turning green as it holds still, then a tick when the photo is taken.](https://mintcdn.com/deep-identity-inc/KR_jLd52VE3haGnp/images/ios/document-capture-sequence.webp?fit=max\&auto=format\&n=KR_jLd52VE3haGnp\&q=85\&s=54df3762b47e114a589b8c1bb835a83c)

What your user sees: the document camera, then the closing screen.

## Next steps

> [card] [Run a workflow](https://docs.deepidv.com/integrate/sdks/ios/workflows/run-a-workflow.md)
>
> The three ways to start a run, and what each step shows.

> [card] [Document capture](https://docs.deepidv.com/integrate/sdks/ios/document-capture.md)
>
> Every capture screen and what triggers it.

> [card] [Branding](https://docs.deepidv.com/integrate/sdks/ios/branding.md)
>
> Your colors and fonts on every screen.

> [card] [Troubleshooting](https://docs.deepidv.com/integrate/sdks/ios/troubleshooting.md)
>
> Fixes for the common problems.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.