# Intro

The Intro module displays an introduction screen. It lists the documents and checks the user will need to complete.

How you use this module depends on your integration pattern. When the app defines the steps in code, you add the module to an `IncdOnboardingFlowConfiguration` as shown below; when the flow is defined in Dashboard, you reference it and let the back end drive the steps. See [Integration Approaches](https://developer.incode.com/docs/ios-flow-configuration).

**Availability:** All variants.

## Add Intro

Add the module with `addIntro()`. Intro is meant to run first, so add it before your capture modules.

```swift
flowConfig.addIntro(checks: [.id, .selfie])
```

### Example

The example below builds a flow whose Intro lists the ID and selfie checks, adds it as the first step, and then starts onboarding.

```swift
let flow = IncdOnboardingFlowConfiguration()
flow.addIntro(checks: [.id, .selfie])   // add Intro first
flow.addIdScan(scanStep: .both)
flow.addSelfieScan()
// ... add the rest of your capture modules

IncdOnboardingManager.shared.startOnboarding(
    sessionConfig: IncdOnboardingSessionConfiguration(token: "<SESSION_TOKEN>"),
    flowConfig: flow,
    delegate: self
)
```

## Configuration Options

Configure the module with `addIntro(checks:)`. It takes a single argument; an empty array (`checks: []`) is accepted and simply renders an intro screen listing no checks.

| Option   | Type           | Notes                                                                                                                                                           |
| -------- | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `checks` | `[IntroCheck]` | Sets the list of documents and checks shown on the intro screen: `.id`, `.passport`, `.insuranceCard`, `.proofOfAddress`, `.selfie`, or a combination of these. |

The intro checks you list should reflect the capture modules you add to the same flow, so the screen matches what the user is actually asked to complete.

## Result

Intro has no dedicated completion callback that hands back `IntroResult` and `IntroError` directly; those types are public but are consumed only internally. On success, the flow simply advances to the next module. If the user cancels the intro step, the delegate's `userCancelledSession()` is called; any other Intro failure surfaces through the delegate's `onError(_ error: IncdFlowError)`.

## Errors

The module's typed error is `IntroError` (`.error(IncdError)` or `.userCancelled`). In a code-defined flow, it is not delivered to your delegate directly:

- If the user dismisses the step, the delegate's `userCancelledSession()` is called.
- Any other failure surfaces through the delegate's `onError(_ error: IncdFlowError)`, reported as a generic error rather than the underlying `IncdError`.

<br />
