# Incode Xamarin SDK Reference

The Incode Xamarin SDK is a wrapper around the native iOS and Android SDKs. This page documents its C# API — initialization, session configuration, and result callbacks.

For module behavior and configuration parameters, see the Module Configuration Reference (link). For iOS- and Android-specific behavior, refer to the [iOS SDK Reference](link) and [Android SDK Reference](link).

## IncodeOnboarding.Initialize

```csharp
IncodeOnboarding.Initialize(
    apiUrl: "YOUR_API_URL",
    apiKey: "YOUR_API_KEY"
);
```

**Parameters:**

| Parameter  | Type   | Required | Description                                                      |
| ---------- | ------ | -------- | ---------------------------------------------------------------- |
| `apiUrl`   | string | Yes      | API URL provided by Incode                                       |
| `apiKey`   | string | No       | API key provided by Incode. Omit when using token-based sessions |
| `testMode` | bool   | No       | Set to `true` when running on a simulator or emulator            |

## OnboardingSessionConfiguration

```csharp
var sessionConfig = new OnboardingSessionConfiguration
{
    ConfigurationId = "YOUR_WORKFLOW_ID",
    ExternalCustomerId = "your-user-id"
};
```

**Properties:**

| Property                 | Type       | Description                                              |
| ------------------------ | ---------- | -------------------------------------------------------- |
| `ConfigurationId`        | string     | Workflow or Flow ID from the Incode Dashboard            |
| `RegionCode`             | string     | User's region (`ALL`, `BR`, `IN`)                        |
| `Queue`                  | string     | Queue to attach this session to                          |
| `InterviewId`            | string     | Resume an existing session by ID                         |
| `Token`                  | string     | Resume an existing session by token                      |
| `ExternalId`             | string     | ID used outside the Incode Omni platform                 |
| `ExternalCustomerId`     | string     | Links the session to an entity in an external system     |
| `ValidationModules`      | List       | Validation modules for scoring                           |
| `CustomFields`           | Dictionary | Custom fields stored for this session                    |
| `E2eEncryptionEnabled`   | bool       | Enable end-to-end encryption                             |
| `MergeSessionRecordings` | bool       | Merge ID and face capture recordings into a single video |

## IncodeOnboarding.StartOnboarding

```csharp
await IncodeOnboarding.StartOnboarding(
    sessionConfig: sessionConfig,
    onSuccess: (result) => Console.WriteLine($"Complete: {result.InterviewId}"),
    onError: (error) => Console.WriteLine($"Failed: {error}")
);
```

**Callbacks:**

| Callback                                  | Description                                                  |
| ----------------------------------------- | ------------------------------------------------------------ |
| `onSuccess(OnboardingResult)`             | Flow completed. `result.InterviewId` contains the session ID |
| `onError(string)`                         | An error occurred                                            |
| `onUserCancelled()`                       | User cancelled the flow                                      |
| `onIdFrontCompleted(IdScanResult)`        | Front ID scan completed                                      |
| `onIdBackCompleted(IdScanResult)`         | Back ID scan completed                                       |
| `onIdProcessed(IdProcessResult)`          | ID processing completed                                      |
| `onSelfieScanCompleted(SelfieScanResult)` | Selfie scan completed                                        |
| `onFaceMatchCompleted(FaceMatchResult)`   | Face match completed                                         |
