# Combined Consent

The Combined Consent module shows the user one preconfigured [consent](https://developer.incode.com/docs/configuration-consents-tab) to review and accept, then records their agreement. Consents obtain the user's permission to collect and process their data. Most jurisdictions require this at the start of an identity verification journey. Consents are [configured in Dashboard](https://developer.incode.com/docs/configuration-consents-tab); the module presents what your Flow or Workflow configuration provides.

For an overview of this module and how it works, see [Data Sharing Consent](https://developer.incode.com/docs/combined-consent).

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 by ID and let the back end drive the steps. See [Integration Approaches](https://developer.incode.com/docs/ios-flow-configuration).

**Availability**: All variants.

## Add Combined Consent

Add the module with `addCombinedConsents()`.

```swift
flowConfig.addCombinedConsents(
    configuration: CombinedConsentsConfiguration(
        combinedConsents: "YOUR_COMBINED_CONSENTS_ID",   // consent id from Dashboard
        language: "en"                                   // optional
    )
)
```

## Configuration Options

Configure the module by passing an `CombinedConsentsConfiguration` to `addCombinedConsents(configuration:)`.

| Option             | Type      | Notes                                                                                                                |
| ------------------ | --------- | -------------------------------------------------------------------------------------------------------------------- |
| `combinedConsents` | `String`  | ID of the preconfigured consent to present. Fetch the consent ID from **Configuration** > **Consents** in Dashboard. |
| `language`         | `String?` | Language for the presented consents. Optional; if omitted, the SDK uses its default language.                        |

`combinedConsents` and `language` are write-only. You set them through the `CombinedConsentsConfiguration` initializer shown above, but you won't be able to read them back from an existing `CombinedConsentsConfiguration` instance.

## Result

```swift
func onCombinedConsentsGiven(_ result: CombinedConsentResult)
```

`CombinedConsentResult` fields:

- `success: Bool?`: `true` when the consent was submitted successfully.
- `error: IncdError?`

<br />
