> ## Documentation Index
> Fetch the complete documentation index at: https://crossmint-devin-1787949784-wallet-docs-two-concept-model.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# CrossmintIdentityVerification

> Swift Structure

**Structure**

A view that shows Crossmint’s hosted identity verification (KYC) step.

```swift theme={null}
@MainActor struct CrossmintIdentityVerification
```

The view fills the space the layout gives it. The verification content scrolls inside the view. The Crossmint environment comes from the API key. Attach event handlers with `onReady(_:)`, `onComplete(_:)`, `onCancel(_:)`, and `onError(_:)`.
Document capture needs camera access. Add `NSCameraUsageDescription` to your app’s Info.plist.

## Initializers

### init(apiKey:credentials:locale:)

Creates an identity verification view.

```swift theme={null}
@MainActor init(apiKey: String, credentials: IdentityVerificationCredentials, locale: CheckoutLocale? = nil)
```

#### Parameters

| Parameter     | Description                                                                             |
| ------------- | --------------------------------------------------------------------------------------- |
| `apiKey`      | Your client-side API key. The key starts with `ck_`.                                    |
| `credentials` | The credentials of the pending verification, from the order.                            |
| `locale`      | The language of the verification UI. A `nil` value uses the default of the hosted page. |

## Instance Properties

| Property | Type        | Description                 |
| -------- | ----------- | --------------------------- |
| `body`   | `some View` | Inherited from `View.body`. |

## Instance Methods

### onCancel(\_:)

Adds an action to perform when the buyer dismisses the verification flow.

```swift theme={null}
@MainActor func onCancel(_ action: @escaping () -> Void) -> CrossmintIdentityVerification
```

### onComplete(\_:)

Adds an action to perform when the buyer finishes the verification. The status gives the result.

```swift theme={null}
@MainActor func onComplete(_ action: @escaping (IdentityVerificationStatus) -> Void) -> CrossmintIdentityVerification
```

### onError(\_:)

Adds an action to perform when the verification fails. `retriable` shows if a new attempt can work.

```swift theme={null}
@MainActor func onError(_ action: @escaping (IdentityVerificationError) -> Void) -> CrossmintIdentityVerification
```

### onReady(\_:)

Adds an action to perform when the verification UI finishes loading.

```swift theme={null}
@MainActor func onReady(_ action: @escaping () -> Void) -> CrossmintIdentityVerification
```
